mirror of
https://github.com/golang/go
synced 2024-11-21 22:04:39 -07:00
build: tidy intermediate files during build
This CL changes the behavior of 'make install' and 'make test' in the src/cmd directory and the src/pkg directory to have each recursive make clean up after itself immediately. It does the same in test/run, removing $F.$A and $A.out (the common byproducts) between runs. On machines with slow disks and aggressive kernel caching, cleaning up immediately can mean that the intermediate objects never get written to disk. This change eliminates almost all the disk waiting during all.bash on my laptop (a Thinkpad X201s with an SSD running Linux). 147.50u 19.95s 277.34r before 148.53u 21.64s 179.59r after R=golang-dev, r, iant2 CC=golang-dev https://golang.org/cl/4413042
This commit is contained in:
parent
1d26908d3f
commit
1499c78281
@ -5,6 +5,15 @@
|
||||
clean:
|
||||
rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES)
|
||||
|
||||
install.clean: install
|
||||
rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES)
|
||||
|
||||
test.clean: test
|
||||
rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES)
|
||||
|
||||
testshort.clean: testshort
|
||||
rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES)
|
||||
|
||||
%.make:
|
||||
$(MAKE) -C $* install
|
||||
|
||||
|
@ -233,18 +233,18 @@ bench.dirs: $(addsuffix .bench, $(BENCH))
|
||||
|
||||
%.install:
|
||||
+@echo install $*
|
||||
+@$(MAKE) -C $* install >$*/build.out 2>&1 || (echo INSTALL FAIL $*; cat $*/build.out; exit 1)
|
||||
+@$(MAKE) -C $* install.clean >$*/build.out 2>&1 || (echo INSTALL FAIL $*; cat $*/build.out; exit 1)
|
||||
|
||||
%.nuke:
|
||||
+$(MAKE) -C $* nuke
|
||||
|
||||
%.test:
|
||||
+@echo test $*
|
||||
+@$(MAKE) -C $* test >$*/test.out 2>&1 || (echo TEST FAIL $*; cat $*/test.out; exit 1)
|
||||
+@$(MAKE) -C $* test.clean >$*/test.out 2>&1 || (echo TEST FAIL $*; cat $*/test.out; exit 1)
|
||||
|
||||
%.testshort:
|
||||
+@echo test $*
|
||||
+@$(MAKE) -C $* testshort >$*/test.out 2>&1 || (echo TEST FAIL $*; cat $*/test.out; exit 1)
|
||||
+@$(MAKE) -C $* testshort.clean >$*/test.out 2>&1 || (echo TEST FAIL $*; cat $*/test.out; exit 1)
|
||||
|
||||
%.bench:
|
||||
+$(MAKE) -C $* bench
|
||||
|
Loading…
Reference in New Issue
Block a user