]> Cypherpunks.ru repositories - gostls13.git/commitdiff
build: remove unnecessary references to GOBIN and GOROOT
authorChristian Himpel <chressie@googlemail.com>
Mon, 30 Aug 2010 19:40:56 +0000 (15:40 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 30 Aug 2010 19:40:56 +0000 (15:40 -0400)
All scripts and makefiles assume that GOBIN is correctly set
in PATH.

R=rsc
CC=golang-dev
https://golang.org/cl/2043041

19 files changed:
doc/Makefile
doc/codelab/wiki/Makefile
doc/progs/run
misc/cgo/stdio/Makefile
misc/cgo/stdio/test.bash
src/Make.common
src/clean.bash
src/cmd/gc/mkbuiltin
src/make.bash
src/pkg/exp/eval/Makefile
src/pkg/exp/eval/test.bash
src/pkg/exp/ogle/Makefile
src/pkg/image/jpeg/Makefile
src/pkg/runtime/Makefile
src/quietgcc.bash
src/run.bash
test/bench/timing.sh
test/run
test/run-arm

index fbc4286d3cd720da9a79ff57d543abf2f993d77a..d992a39f380fd016809091c410a592430dfcbd89 100644 (file)
@@ -2,10 +2,10 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include $(GOROOT)/src/Make.inc
+include ../src/Make.inc
 
 TARG=htmlgen
 GOFILES=\
        htmlgen.go\
 
-include $(GOROOT)/src/Make.cmd
+include ../src/Make.cmd
index 8d09cc554720e46c38d2fd9fa72a967b71a3141a..e0549fc8edec03417983e8817eeda11efc181211 100644 (file)
@@ -6,12 +6,7 @@ include ../../../src/Make.inc
 
 all: index.html
 
-# ugly hack to deal with whitespaces in $GOROOT
-nullstring :=
-space := $(nullstring) # a space at the end
-QUOTED_GOROOT:=$(subst $(space),\ ,$(GOROOT))
-
-include $(QUOTED_GOROOT)/src/Make.common
+include ../../../src/Make.common
 
 CLEANFILES+=index.html srcextract.bin htmlify.bin
 
@@ -23,7 +18,7 @@ test: final.bin
        rm -f final.6 final.bin
 
 %.bin: %.$O
-       $(QUOTED_GOBIN)/$(LD) -o $@ $<
-%.$O: 
-       $(QUOTED_GOBIN)/$(GC) $*.go
+       $(LD) -o $@ $<
+%.$O:
+       $(GC) $*.go
 
index 19cc425650396c64ba33d647a2b2737b180ef2f4..3489a882a97354d8024e39d30cb29ee10109e35c 100755 (executable)
@@ -5,9 +5,7 @@
 
 set -e
 
-GOBIN="${GOBIN:-$HOME/bin}"
-
-eval $("$GOBIN"/gomake -f ../../src/Make.inc go-env)
+eval $(gomake -f ../../src/Make.inc go-env)
 
 if [ -z "$O" ]; then
        echo 'missing $O - maybe no Make.$GOARCH?' 1>&2
@@ -34,11 +32,11 @@ for i in \
 ; do
        BASE=$(basename $i .go)
 
-       "$GOBIN"/$GC $i
+       $GC $i
 done
 
 function testit {
-       "$GOBIN"/$LD $1.$O
+       $LD $1.$O
        x=$(echo $(./$O.out $2 2>&1))  # extra echo canonicalizes
        if [ "$x" != "$3" ]
        then
@@ -47,7 +45,7 @@ function testit {
 }
 
 function testitpipe {
-       "$GOBIN"/$LD $1.$O
+       $LD $1.$O
        x=$(echo $(./$O.out | $2 2>&1))  # extra echo canonicalizes
        if [ "$x" != "$3" ]
        then
@@ -76,7 +74,7 @@ testitpipe sieve "sed 10q" "2 3 5 7 11 13 17 19 23 29"
 testitpipe sieve "sed 10q" "2 3 5 7 11 13 17 19 23 29"
 
 # server hangs; don't run it, just compile it
-"$GOBIN"/$GC server.go
+$GC server.go
 testit server1 "" ""
 
 rm -f $O.out *.$O
index 08e29393100f903280df8bdae723fd7a7335e86e..ba49d9402aeef38de0f605e02efda95a329e3a6c 100644 (file)
@@ -15,5 +15,5 @@ CLEANFILES+=hello fib chain run.out
 include ../../../src/Make.pkg
 
 %: install %.go
-       $(QUOTED_GOBIN)/$(GC) $*.go
-       $(QUOTED_GOBIN)/$(LD) -o $@ $*.$O
+       $(GC) $*.go
+       $(LD) -o $@ $*.$O
index b8b5f6911ec5d66ebb5c6512afec8b09b49a2b62..82e3f7b45bf6ece426723d9904ce7fcd7d52441b 100755 (executable)
@@ -4,8 +4,7 @@
 # license that can be found in the LICENSE file.
 
 set -e
-GOBIN="${GOBIN:-$HOME/bin}"
-"$GOBIN"/gomake hello fib chain
+gomake hello fib chain
 echo '*' hello >run.out
 ./hello >>run.out
 echo '*' fib >>run.out
@@ -13,4 +12,4 @@ echo '*' fib >>run.out
 echo '*' chain >>run.out
 ./chain >>run.out
 diff run.out golden.out
-"$GOBIN"/gomake clean
+gomake clean
index c1cafa55015c8f739f15cb3f908fb69addec5f7d..e3f415a1f5ea42d99e1759e7a51440670948efa6 100644 (file)
@@ -6,7 +6,7 @@ clean:
        rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES)
 
 %.make:
-       (cd $* && $(QUOTED_GOBIN)/gomake install)
+       (cd $* && gomake install)
 
 .PHONY: all clean nuke install coverage test bench testpackage-clean\ 
        importpath dir
index a62f33998c508442ecc74a1c1119010ea41ddde9..8f34310545c08e9f98ab025cb027c9b790868eb9 100755 (executable)
@@ -27,6 +27,6 @@ do(
        if test -f clean.bash; then
                bash clean.bash
        else
-               "$GOBIN"/gomake clean
+               gomake clean
        fi
 )done
index 8da0da04993a085532f8a73a9b52bed6c2d9ed1c..754844e1f6cbe0ff78feef235bb5e46d2696b184 100755 (executable)
@@ -20,7 +20,7 @@ gcc -o mkbuiltin1 mkbuiltin1.c
 rm -f _builtin.c
 for i in runtime unsafe
 do
-       "$GOBIN"/$GC -A $i.go
+       $GC -A $i.go
        O=$O ./mkbuiltin1 $i >>_builtin.c
 done
 
index ad5c5444b47a953ff75e1839911704366dbc34c6..c778d922af60b0db6dbeb441c36f1bf4dbdb986a 100755 (executable)
@@ -71,10 +71,10 @@ do
                                bash make.bash
                                ;;
                        pkg)
-                               "$GOBIN"/gomake install
+                               gomake install
                                ;;
                        *)
-                               "$GOBIN"/gomake install
+                               gomake install
                        esac
                )  || exit 1
        esac
@@ -84,7 +84,7 @@ done
 # Implemented as a function so that all.bash can repeat the output
 # after run.bash finishes running all the tests.
 installed() {
-       eval $("$GOBIN"/gomake -f Make.inc go-env)
+       eval $(gomake -f Make.inc go-env)
        echo
        echo ---
        echo Installed Go for $GOOS/$GOARCH in "$GOROOT".
index a623d0fd460956c0f39ecd7409486cad68e6a2e3..2b716b14c47b894946b9dceaf7bffbf876fb0a7e 100644 (file)
@@ -22,16 +22,16 @@ GOFILES=\
 include ../../../Make.pkg
 
 main.$O: main.go $(pkgdir)/$(TARG).a
-       $(QUOTED_GOBIN)/$(GC) $<
+       $(GC) $<
 
 eval: main.$O
-       $(QUOTED_GOBIN)/$(LD) -o $@ $<
+       $(LD) -o $@ $<
 
 gen.$O: gen.go
-       $(QUOTED_GOBIN)/$(GC) $<
+       $(GC) $<
 
 generate: gen.$O $(pkgdir)/$(TARG).a
-       $(QUOTED_GOBIN)/$(LD) -o $@ $<;\
+       $(LD) -o $@ $<;\
        ./generate > expr1.go;\
        gofmt -w expr1.go
 
index 5d9ba1ae7f04b31ca97a6ab3c76f83c6a9e02d44..50b61fd00932caad98de5ae816c3921c84a0e675 100755 (executable)
 
 set -e
 
-GOBIN="${GOBIN:-$HOME/bin}"
-
-"$GOBIN"/gomake
-"$GOBIN"/6g main.go && "$GOBIN"/6l main.6
+gomake
+6g main.go && 6l main.6
 (
 for i in $(egrep -l '// \$G (\$D/)?\$F\.go \&\& \$L \$F\.\$A && \./\$A\.out' "$GOROOT"/test/*.go "$GOROOT"/test/*/*.go)
 do
index 1d1d78289eeaf8ffbfcd320662fc4a63bec880be..ef65d36c81897e44bd9b61ad4910f8037452d8f9 100644 (file)
@@ -23,7 +23,7 @@ CLEANFILES+=ogle
 include ../../../Make.pkg
 
 main.$O: main.go package
-       $(QUOTED_GOBIN)/$(GC) -I_obj $<
+       $(GC) -I_obj $<
 
 ogle: main.$O
-       $(QUOTED_GOBIN)/$(LD) -L_obj -o $@ $<
+       $(LD) -L_obj -o $@ $<
index 82d04c402def737c9126a1b413e8ae02b8534e96..5c5f97e7182be4ab238bae89905769a28c4f64ba 100644 (file)
@@ -2,7 +2,7 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include $(GOROOT)/src/Make.inc
+include ../../../Make.inc
 
 TARG=image/jpeg
 GOFILES=\
@@ -10,4 +10,4 @@ GOFILES=\
        idct.go\
        reader.go\
 
-include $(GOROOT)/src/Make.pkg
+include ../../../Make.pkg
index cd08cfe98aa5579138072ff419a08922ba90eb6f..643f4572b5d44ea7739751648b54422a18651da7 100644 (file)
@@ -123,10 +123,10 @@ $(GOARCH)/asm.h: mkasmh.sh runtime.acid.$(GOARCH)
        mv -f $@.x $@
 
 goc2c: goc2c.c
-       $(QUOTED_GOBIN)/quietgcc -o $@ $<
+       quietgcc -o $@ $<
 
 mkversion: mkversion.c
-       $(QUOTED_GOBIN)/quietgcc -o $@ -I "$(GOROOT)/include" $< "$(GOROOT)/lib/lib9.a"
+       quietgcc -o $@ -I "$(GOROOT)/include" $< "$(GOROOT)/lib/lib9.a"
 
 version.go: mkversion
        ./mkversion >version.go
@@ -136,32 +136,32 @@ version.go: mkversion
        mv -f $@.tmp $@
 
 %.$O:  $(GOARCH)/%.c
-       $(QUOTED_GOBIN)/$(CC) $(CFLAGS) $<
+       $(CC) $(CFLAGS) $<
 
 %.$O:  $(GOOS)/%.c
-       $(QUOTED_GOBIN)/$(CC) $(CFLAGS) $<
+       $(CC) $(CFLAGS) $<
 
 %.$O:  $(GOOS)/$(GOARCH)/%.c
-       $(QUOTED_GOBIN)/$(CC) $(CFLAGS) $<
+       $(CC) $(CFLAGS) $<
 
 %.$O:  $(GOARCH)/%.s $(GOARCH)/asm.h
-       $(QUOTED_GOBIN)/$(AS) $<
+       $(AS) $<
 
 %.$O:  $(GOOS)/$(GOARCH)/%.s $(GOARCH)/asm.h
-       $(QUOTED_GOBIN)/$(AS) $<
+       $(AS) $<
 
 # for discovering offsets inside structs when debugging
 runtime.acid.$(GOARCH): runtime.h proc.c
-       $(QUOTED_GOBIN)/$(CC) $(CFLAGS) -a proc.c >$@
+       $(CC) $(CFLAGS) -a proc.c >$@
 
 # 386 traceback is really amd64 traceback
 ifeq ($(GOARCH),386)
 traceback.$O:  amd64/traceback.c
-       $(QUOTED_GOBIN)/$(CC) $(CFLAGS) $<
+       $(CC) $(CFLAGS) $<
 endif
 
 # NaCl closure is special.
 ifeq ($(GOOS),nacl)
 closure.$O: nacl/$(GOARCH)/closure.c
-       $(QUOTED_GOBIN)/$(CC) $(CFLAGS) $<
+       $(CC) $(CFLAGS) $<
 endif
index dd3db364266f375e982332125528e3c2372edfbe..ca3bf8f32f1db83bd1da044c252b83102a0af7ab 100755 (executable)
@@ -4,7 +4,7 @@
 # license that can be found in the LICENSE file.
 
 # The master for this file is $GOROOT/src/quietgcc.bash
-# Changes made to $HOME/bin/quietgcc will be overridden.
+# Changes made to $GOBIN/quietgcc will be overridden.
 
 # Gcc output that we don't care to see.
 ignore=': error: .Each undeclared identifier'
index 0b37031c2bf0c64ceb220fb21125404ff5484d16..1100f52f2a7f69f0ac3ccf1bd7f2df76df3c9943 100755 (executable)
@@ -36,11 +36,11 @@ maketest() {
                (
                        xcd $i
                        if $rebuild; then
-                               "$GOBIN"/gomake clean
-                               time "$GOBIN"/gomake
-                               "$GOBIN"/gomake install
+                               gomake clean
+                               time gomake
+                               gomake install
                        fi
-                       "$GOBIN"/gomake test
+                       gomake test
                ) || exit $?
        done
 }
@@ -53,36 +53,36 @@ maketest \
 
 (xcd pkg/sync;
 if $rebuild; then
-       "$GOBIN"/gomake clean;
-       time "$GOBIN"/gomake
+       gomake clean;
+       time gomake
 fi
-GOMAXPROCS=10 "$GOBIN"/gomake test
+GOMAXPROCS=10 gomake test
 ) || exit $?
 
 (xcd cmd/gofmt
 if $rebuild; then
-       "$GOBIN"/gomake clean;
-       time "$GOBIN"/gomake
+       gomake clean;
+       time gomake
 fi
-time "$GOBIN"/gomake smoketest
+time gomake smoketest
 ) || exit $?
 
 (xcd cmd/ebnflint
 if $rebuild; then
-       "$GOBIN"/gomake clean;
-       time "$GOBIN"/gomake
+       gomake clean;
+       time gomake
 fi
-time "$GOBIN"/gomake test
+time gomake test
 ) || exit $?
 
 (xcd ../misc/cgo/stdio
-"$GOBIN"/gomake clean
+gomake clean
 ./test.bash
 ) || exit $?
 
 (xcd pkg/exp/ogle
-"$GOBIN"/gomake clean
-time "$GOBIN"/gomake ogle
+gomake clean
+time gomake ogle
 ) || exit $?
 
 (xcd ../doc/progs
index 3e54de2d73385fdc612b466fb0de09857369f019..c52c0af94a6fffa50988d7958263a6a0439d0ff6 100755 (executable)
@@ -5,9 +5,7 @@
 
 set -e
 
-GOBIN="${GOBIN:-$HOME/bin}"
-
-eval $("$GOBIN"/gomake --no-print-directory -f ../../src/Make.inc go-env)
+eval $(gomake --no-print-directory -f ../../src/Make.inc go-env)
 PATH=.:$PATH
 
 mode=run
@@ -18,11 +16,11 @@ X-test)
 esac
 
 gc() {
-       "$GOBIN"/$GC $1.go; "$GOBIN"/$LD $1.$O
+       $GC $1.go; $LD $1.$O
 }
 
 gc_B() {
-       "$GOBIN"/$GC -B $1.go; "$GOBIN"/$LD $1.$O
+       $GC -B $1.go; $LD $1.$O
 }
 
 runonly() {
index 2ce31d5a0a7c3941ac312f2e696444f3a89b88ea..4ca77541409dea1b022773da39ef180892475c66 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -3,8 +3,7 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-GOBIN="${GOBIN:-$HOME/bin}"
-eval $("$GOBIN"/gomake --no-print-directory -f ../src/Make.inc go-env)
+eval $(gomake --no-print-directory -f ../src/Make.inc go-env)
 
 case X"$GOARCH" in
 Xamd64)
@@ -35,7 +34,7 @@ unset GREP_OPTIONS    # in case user has a non-standard set
 
 failed=0
 
-PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$HOME/bin}:`pwd`
+PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$GOROOT/bin}:`pwd`
 
 RUNFILE=/tmp/gorun-$$-$USER
 TMP1FILE=/tmp/gotest1-$$-$USER
index 2cf2d5685be2ebdeff414481fac3494d66c44c8f..a62df10ca4b953a5bb93e1e76713c53964078fb0 100755 (executable)
@@ -24,7 +24,7 @@ export G=${A}g
 export L=${A}l
 export GOTRACEBACK=0
 
-PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$HOME/bin}:`pwd`
+PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$GOROOT/bin}:`pwd`
 
 RUNFILE=/tmp/gorun-$$-$USER
 TMP1FILE=/tmp/gotest1-$$-$USER