Commit b3750ff5 authored by Russ Cox's avatar Russ Cox

build: rename $GOROOT/bin/go-tool to $GOROOT/bin/tool.

The go- is redundant now that the directory is required
to be inside $GOROOT.  Rob LGTMed the idea.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5618044
parent 9de9c957
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Makefile for commands written in C. # Makefile for commands written in C.
# Tools always go into $GOROOT/bin/go-tool # Tools always go into $GOROOT/bin/tool
ifeq (windows,$(findstring windows, $(shell uname | tr A-Z a-z | sed 's/mingw/windows/'))) ifeq (windows,$(findstring windows, $(shell uname | tr A-Z a-z | sed 's/mingw/windows/')))
TARG:=$(TARG).exe TARG:=$(TARG).exe
...@@ -21,14 +21,14 @@ clean: ...@@ -21,14 +21,14 @@ clean:
rm -f *.$(HOST_O) $(TARG) $(CLEANFILES) rm -f *.$(HOST_O) $(TARG) $(CLEANFILES)
nuke: clean nuke: clean
rm -f "$(GOROOT)/bin/go-tool/$(TARG)" rm -f "$(GOROOT)/bin/tool/$(TARG)"
ifneq ($(NOINSTALL),1) ifneq ($(NOINSTALL),1)
install: $(QUOTED_GOROOT)/bin/go-tool/$(TARG) install: $(QUOTED_GOROOT)/bin/tool/$(TARG)
endif endif
$(QUOTED_GOROOT)/bin/go-tool/$(TARG): $(TARG) $(QUOTED_GOROOT)/bin/tool/$(TARG): $(TARG)
mkdir -p "$(GOROOT)/bin/go-tool" && cp $(TARG) "$(GOROOT)/bin/go-tool/$(TARG)" mkdir -p "$(GOROOT)/bin/tool" && cp $(TARG) "$(GOROOT)/bin/tool/$(TARG)"
y.tab.h: $(YFILES) y.tab.h: $(YFILES)
bison -y $(HOST_YFLAGS) $(YFILES) bison -y $(HOST_YFLAGS) $(YFILES)
......
...@@ -98,15 +98,15 @@ GOBIN=$(QUOTED_GOROOT)/bin ...@@ -98,15 +98,15 @@ GOBIN=$(QUOTED_GOROOT)/bin
endif endif
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN)) QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
AS=$(QUOTED_GOROOT)/bin/go-tool/$(O)a AS=$(QUOTED_GOROOT)/bin/tool/$(O)a
CC=$(QUOTED_GOROOT)/bin/go-tool/$(O)c CC=$(QUOTED_GOROOT)/bin/tool/$(O)c
GC=$(QUOTED_GOROOT)/bin/go-tool/$(O)g GC=$(QUOTED_GOROOT)/bin/tool/$(O)g
LD=$(QUOTED_GOROOT)/bin/go-tool/$(O)l LD=$(QUOTED_GOROOT)/bin/tool/$(O)l
OS=568vq OS=568vq
CFLAGS=-FVw CFLAGS=-FVw
HOST_CC=$(QUOTED_GOROOT)/bin/go-tool/quietgcc HOST_CC=$(QUOTED_GOROOT)/bin/tool/quietgcc
HOST_LD=$(QUOTED_GOROOT)/bin/go-tool/quietgcc HOST_LD=$(QUOTED_GOROOT)/bin/tool/quietgcc
HOST_O=o HOST_O=o
HOST_YFLAGS=-d HOST_YFLAGS=-d
HOST_AR?=ar HOST_AR?=ar
......
...@@ -36,8 +36,7 @@ set -e ...@@ -36,8 +36,7 @@ set -e
s/\$GOROOT/"$GOROOT"/g s/\$GOROOT/"$GOROOT"/g
s/\$WORK/"$WORK"/g s/\$WORK/"$WORK"/g
s;"\$GOBIN"/go;&_bootstrap;g s;"\$GOBIN"/go;&_bootstrap;g
s/go_bootstrap-tool/go-tool/g s;"\$GOBIN"/tool;"$GOROOT"/bin/tool;g
s;"\$GOBIN"/go-tool;"$GOROOT"/bin/go-tool;g
s; \./; ;g s; \./; ;g
' '
)>$targ )>$targ
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -38,4 +38,4 @@ install-darwin: $(TARG) ...@@ -38,4 +38,4 @@ install-darwin: $(TARG)
@true @true
install-default: $(TARG) install-default: $(TARG)
cp $(TARG) "$(GOROOT)"/bin/go-tool/$(TARG) cp $(TARG) "$(GOROOT)"/bin/tool/$(TARG)
...@@ -232,7 +232,7 @@ Loop: ...@@ -232,7 +232,7 @@ Loop:
} }
// isGoTool is the list of directories for Go programs that are installed in // isGoTool is the list of directories for Go programs that are installed in
// $GOROOT/bin/go-tool. // $GOROOT/bin/tool.
var isGoTool = map[string]bool{ var isGoTool = map[string]bool{
"cmd/api": true, "cmd/api": true,
"cmd/cgo": true, "cmd/cgo": true,
...@@ -300,7 +300,7 @@ func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string ...@@ -300,7 +300,7 @@ func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string
elem = ctxt.GOOS + "_" + ctxt.GOARCH + "/" + elem elem = ctxt.GOOS + "_" + ctxt.GOARCH + "/" + elem
} }
if t.Goroot && isGoTool[p.ImportPath] { if t.Goroot && isGoTool[p.ImportPath] {
p.target = filepath.Join(t.Path, "bin/go-tool", elem) p.target = filepath.Join(t.Path, "bin/tool", elem)
} else { } else {
p.target = filepath.Join(t.BinDir(), elem) p.target = filepath.Join(t.BinDir(), elem)
} }
......
...@@ -31,7 +31,7 @@ var ( ...@@ -31,7 +31,7 @@ var (
toolGOOS = runtime.GOOS toolGOOS = runtime.GOOS
toolGOARCH = runtime.GOARCH toolGOARCH = runtime.GOARCH
toolIsWindows = toolGOOS == "windows" toolIsWindows = toolGOOS == "windows"
toolDir = filepath.Join(build.Path[0].Path, "bin", "go-tool") toolDir = filepath.Join(build.Path[0].Path, "bin", "tool")
) )
const toolWindowsExtension = ".exe" const toolWindowsExtension = ".exe"
...@@ -81,7 +81,7 @@ func runTool(cmd *Command, args []string) { ...@@ -81,7 +81,7 @@ func runTool(cmd *Command, args []string) {
} }
} }
// listTools prints a list of the available tools in the go-tools directory. // listTools prints a list of the available tools in the tools directory.
func listTools() { func listTools() {
f, err := os.Open(toolDir) f, err := os.Open(toolDir)
if err != nil { if err != nil {
......
...@@ -32,7 +32,7 @@ install-darwin: $(TARG) ...@@ -32,7 +32,7 @@ install-darwin: $(TARG)
@true @true
install-default: $(TARG) install-default: $(TARG)
cp $(TARG) "$(GOROOT)"/bin/go-tool/$(TARG) cp $(TARG) "$(GOROOT)"/bin/tool/$(TARG)
install-pprof: pprof install-pprof: pprof
cp pprof "$(GOROOT)"/bin/go-tool/pprof cp pprof "$(GOROOT)"/bin/tool/pprof
...@@ -22,10 +22,11 @@ if ld --version 2>&1 | grep 'gold.* 2\.20' >/dev/null; then ...@@ -22,10 +22,11 @@ if ld --version 2>&1 | grep 'gold.* 2\.20' >/dev/null; then
fi fi
# Create target directories # Create target directories
mkdir -p "$GOROOT/bin/go-tool" mkdir -p "$GOROOT/bin/tool"
mkdir -p "$GOROOT/pkg" mkdir -p "$GOROOT/pkg"
# Remove old, pre-go-tool binaries. # Remove old, pre-tool binaries.
rm -rf "$GOROOT"/bin/go-tool
rm -f "$GOROOT"/bin/[568][acgl] rm -f "$GOROOT"/bin/[568][acgl]
rm -f "$GOROOT"/bin/{6cov,6nm,cgo,ebnflint,goapi,gofix,goinstall,gomake,gopack,gopprof,gotest,gotype,govet,goyacc,quietgcc} rm -f "$GOROOT"/bin/{6cov,6nm,cgo,ebnflint,goapi,gofix,goinstall,gomake,gopack,gopprof,gotest,gotype,govet,goyacc,quietgcc}
...@@ -44,13 +45,13 @@ export MAKEFLAGS ...@@ -44,13 +45,13 @@ export MAKEFLAGS
unset CDPATH # in case user has it set unset CDPATH # in case user has it set
rm -f "$GOBIN"/quietgcc rm -f "$GOBIN"/quietgcc
rm -f "$GOROOT/bin/go-tool/quietgcc" rm -f "$GOROOT/bin/tool/quietgcc"
CC=${CC:-gcc} CC=${CC:-gcc}
export CC export CC
sed -e "s|@CC@|$CC|" < "$GOROOT"/src/quietgcc.bash > "$GOROOT"/bin/go-tool/quietgcc sed -e "s|@CC@|$CC|" < "$GOROOT"/src/quietgcc.bash > "$GOROOT"/bin/tool/quietgcc
chmod +x "$GOROOT"/bin/go-tool/quietgcc chmod +x "$GOROOT"/bin/tool/quietgcc
export GOMAKE="$GOROOT"/bin/go-tool/make export GOMAKE="$GOROOT"/bin/tool/make
rm -f "$GOBIN"/gomake rm -f "$GOBIN"/gomake
rm -f "$GOMAKE" rm -f "$GOMAKE"
( (
......
...@@ -31,7 +31,7 @@ func init() { ...@@ -31,7 +31,7 @@ func init() {
gcPath = gcName gcPath = gcName
return return
} }
gcPath = filepath.Join(runtime.GOROOT(), "/bin/go-tool/", gcName) gcPath = filepath.Join(runtime.GOROOT(), "/bin/tool/", gcName)
} }
func compile(t *testing.T, dirname, filename string) { func compile(t *testing.T, dirname, filename string) {
......
...@@ -27,7 +27,7 @@ if [ "$GOROOT" = "" ]; then ...@@ -27,7 +27,7 @@ if [ "$GOROOT" = "" ]; then
fi fi
# Use goc2c to translate .goc files into arch-specific .c files. # Use goc2c to translate .goc files into arch-specific .c files.
"$GOROOT"/bin/go-tool/quietgcc -o goc2c -I "$GOROOT/include" goc2c.c "$GOROOT/lib/lib9.a" "$GOROOT"/bin/tool/quietgcc -o goc2c -I "$GOROOT/include" goc2c.c "$GOROOT/lib/lib9.a"
for file in *.goc for file in *.goc
do do
for arch in $GOARCHES for arch in $GOARCHES
...@@ -39,7 +39,7 @@ do ...@@ -39,7 +39,7 @@ do
done done
# Version constants. # Version constants.
"$GOROOT"/bin/go-tool/quietgcc -o mkversion -I "$GOROOT/include" mkversion.c "$GOROOT/lib/lib9.a" "$GOROOT"/bin/tool/quietgcc -o mkversion -I "$GOROOT/include" mkversion.c "$GOROOT/lib/lib9.a"
GOROOT="$GOROOT_FINAL" ./mkversion >z.tmp GOROOT="$GOROOT_FINAL" ./mkversion >z.tmp
mv z.tmp zversion.go mv z.tmp zversion.go
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment