mirror of
https://github.com/golang/go
synced 2024-11-25 07:57:56 -07:00
build: reduce the use of subshells in recursive make
Using make -C $* rather than (cd $* ; make) results in a small, but measurable improvement in build times where compilation is not the major component. eg. before - ~/go/src/pkg$ time make real 0m1.176s user 0m0.639s sys 0m0.399s after - ~/go/src/pkg$ time make real 0m0.916s user 0m0.571s sys 0m0.243s There are other places in the distribution src/make.common for example that could also benefit from this change. R=adg CC=golang-dev, rsc https://golang.org/cl/4174055
This commit is contained in:
parent
79ba1ce076
commit
8a8ecda54a
@ -6,7 +6,7 @@ clean:
|
|||||||
rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES)
|
rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES)
|
||||||
|
|
||||||
%.make:
|
%.make:
|
||||||
(cd $* && gomake install)
|
gomake -C $* install
|
||||||
|
|
||||||
.PHONY: all clean nuke install coverage test bench testpackage-clean\
|
.PHONY: all clean nuke install coverage test bench testpackage-clean\
|
||||||
importpath dir
|
importpath dir
|
||||||
|
@ -211,19 +211,19 @@ test.dirs: $(addsuffix .test, $(TEST))
|
|||||||
bench.dirs: $(addsuffix .bench, $(BENCH))
|
bench.dirs: $(addsuffix .bench, $(BENCH))
|
||||||
|
|
||||||
%.clean:
|
%.clean:
|
||||||
+cd $* && $(MAKE) clean
|
+$(MAKE) -C $* clean
|
||||||
|
|
||||||
%.install:
|
%.install:
|
||||||
+cd $* && $(MAKE) install
|
+$(MAKE) -C $* install
|
||||||
|
|
||||||
%.nuke:
|
%.nuke:
|
||||||
+cd $* && $(MAKE) nuke
|
+$(MAKE) -C $* nuke
|
||||||
|
|
||||||
%.test:
|
%.test:
|
||||||
+cd $* && $(MAKE) test
|
+$(MAKE) -C $* test
|
||||||
|
|
||||||
%.bench:
|
%.bench:
|
||||||
+cd $* && $(MAKE) bench
|
+$(MAKE) -C $* bench
|
||||||
|
|
||||||
clean: clean.dirs
|
clean: clean.dirs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user