Commit 6c5e4e18 authored by Russ Cox's avatar Russ Cox

build: allow clean.bash to work on fresh checkout

Must be invoked as ./clean.bash --gomake make
(or --gomake gmake, depending on the name of
GNU make).

R=niemeyer
CC=golang-dev
https://golang.org/cl/4023065
parent 4fa6d57f
...@@ -25,8 +25,8 @@ for i in lib9 libbio libmach cmd pkg \ ...@@ -25,8 +25,8 @@ for i in lib9 libbio libmach cmd pkg \
do( do(
cd "$GOROOT"/src/$i || exit 1 cd "$GOROOT"/src/$i || exit 1
if test -f clean.bash; then if test -f clean.bash; then
bash clean.bash bash clean.bash --gomake $MAKE
else else
gomake clean $MAKE clean
fi fi
)done )done
...@@ -3,9 +3,14 @@ ...@@ -3,9 +3,14 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
gomake=gomake
if [ $1 == "--gomake" -a "$2" != "" ]; then
gomake=$2
fi
for i in cc 6l 6a 6c 8l 8a 8c 8g 5l 5a 5c 5g gc 6g gopack nm cgo cov ebnflint godefs godoc gofmt goinstall gotest goyacc hgpatch prof for i in cc 6l 6a 6c 8l 8a 8c 8g 5l 5a 5c 5g gc 6g gopack nm cgo cov ebnflint godefs godoc gofmt goinstall gotest goyacc hgpatch prof
do do
cd $i cd $i
gomake clean $gomake clean
cd .. cd ..
done done
...@@ -211,19 +211,19 @@ test.dirs: $(addsuffix .test, $(TEST)) ...@@ -211,19 +211,19 @@ test.dirs: $(addsuffix .test, $(TEST))
bench.dirs: $(addsuffix .bench, $(BENCH)) bench.dirs: $(addsuffix .bench, $(BENCH))
%.clean: %.clean:
+cd $* && gomake clean +cd $* && $(MAKE) clean
%.install: %.install:
+cd $* && gomake install +cd $* && $(MAKE) install
%.nuke: %.nuke:
+cd $* && gomake nuke +cd $* && $(MAKE) nuke
%.test: %.test:
+cd $* && gomake test +cd $* && $(MAKE) test
%.bench: %.bench:
+cd $* && gomake bench +cd $* && $(MAKE) bench
clean: clean.dirs clean: clean.dirs
......
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