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 @@
# 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/')))
TARG:=$(TARG).exe
......@@ -21,14 +21,14 @@ clean:
rm -f *.$(HOST_O) $(TARG) $(CLEANFILES)
nuke: clean
rm -f "$(GOROOT)/bin/go-tool/$(TARG)"
rm -f "$(GOROOT)/bin/tool/$(TARG)"
ifneq ($(NOINSTALL),1)
install: $(QUOTED_GOROOT)/bin/go-tool/$(TARG)
install: $(QUOTED_GOROOT)/bin/tool/$(TARG)
endif
$(QUOTED_GOROOT)/bin/go-tool/$(TARG): $(TARG)
mkdir -p "$(GOROOT)/bin/go-tool" && cp $(TARG) "$(GOROOT)/bin/go-tool/$(TARG)"
$(QUOTED_GOROOT)/bin/tool/$(TARG): $(TARG)
mkdir -p "$(GOROOT)/bin/tool" && cp $(TARG) "$(GOROOT)/bin/tool/$(TARG)"
y.tab.h: $(YFILES)
bison -y $(HOST_YFLAGS) $(YFILES)
......
......@@ -98,15 +98,15 @@ GOBIN=$(QUOTED_GOROOT)/bin
endif
QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
AS=$(QUOTED_GOROOT)/bin/go-tool/$(O)a
CC=$(QUOTED_GOROOT)/bin/go-tool/$(O)c
GC=$(QUOTED_GOROOT)/bin/go-tool/$(O)g
LD=$(QUOTED_GOROOT)/bin/go-tool/$(O)l
AS=$(QUOTED_GOROOT)/bin/tool/$(O)a
CC=$(QUOTED_GOROOT)/bin/tool/$(O)c
GC=$(QUOTED_GOROOT)/bin/tool/$(O)g
LD=$(QUOTED_GOROOT)/bin/tool/$(O)l
OS=568vq
CFLAGS=-FVw
HOST_CC=$(QUOTED_GOROOT)/bin/go-tool/quietgcc
HOST_LD=$(QUOTED_GOROOT)/bin/go-tool/quietgcc
HOST_CC=$(QUOTED_GOROOT)/bin/tool/quietgcc
HOST_LD=$(QUOTED_GOROOT)/bin/tool/quietgcc
HOST_O=o
HOST_YFLAGS=-d
HOST_AR?=ar
......
......@@ -36,8 +36,7 @@ set -e
s/\$GOROOT/"$GOROOT"/g
s/\$WORK/"$WORK"/g
s;"\$GOBIN"/go;&_bootstrap;g
s/go_bootstrap-tool/go-tool/g
s;"\$GOBIN"/go-tool;"$GOROOT"/bin/go-tool;g
s;"\$GOBIN"/tool;"$GOROOT"/bin/tool;g
s; \./; ;g
'
)>$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)
@true
install-default: $(TARG)
cp $(TARG) "$(GOROOT)"/bin/go-tool/$(TARG)
cp $(TARG) "$(GOROOT)"/bin/tool/$(TARG)
......@@ -232,7 +232,7 @@ Loop:
}
// 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{
"cmd/api": true,
"cmd/cgo": true,
......@@ -300,7 +300,7 @@ func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string
elem = ctxt.GOOS + "_" + ctxt.GOARCH + "/" + elem
}
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 {
p.target = filepath.Join(t.BinDir(), elem)
}
......
......@@ -31,7 +31,7 @@ var (
toolGOOS = runtime.GOOS
toolGOARCH = runtime.GOARCH
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"
......@@ -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() {
f, err := os.Open(toolDir)
if err != nil {
......
......@@ -32,7 +32,7 @@ install-darwin: $(TARG)
@true
install-default: $(TARG)
cp $(TARG) "$(GOROOT)"/bin/go-tool/$(TARG)
cp $(TARG) "$(GOROOT)"/bin/tool/$(TARG)
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
fi
# Create target directories
mkdir -p "$GOROOT/bin/go-tool"
mkdir -p "$GOROOT/bin/tool"
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/{6cov,6nm,cgo,ebnflint,goapi,gofix,goinstall,gomake,gopack,gopprof,gotest,gotype,govet,goyacc,quietgcc}
......@@ -44,13 +45,13 @@ export MAKEFLAGS
unset CDPATH # in case user has it set
rm -f "$GOBIN"/quietgcc
rm -f "$GOROOT/bin/go-tool/quietgcc"
rm -f "$GOROOT/bin/tool/quietgcc"
CC=${CC:-gcc}
export CC
sed -e "s|@CC@|$CC|" < "$GOROOT"/src/quietgcc.bash > "$GOROOT"/bin/go-tool/quietgcc
chmod +x "$GOROOT"/bin/go-tool/quietgcc
sed -e "s|@CC@|$CC|" < "$GOROOT"/src/quietgcc.bash > "$GOROOT"/bin/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 "$GOMAKE"
(
......
......@@ -31,7 +31,7 @@ func init() {
gcPath = gcName
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) {
......
......@@ -27,7 +27,7 @@ if [ "$GOROOT" = "" ]; then
fi
# 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
do
for arch in $GOARCHES
......@@ -39,7 +39,7 @@ do
done
# 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
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