[BUILD] Paralelize cleaning of examples

make clean     1:50 -> 1:55 (no change)
make clean -j8 1:30 -> 0:28 (strongly faster)

Measured on Core i7 (4 cores, each HT) @ 3GHz
This commit is contained in:
BuFran
2013-07-10 13:46:51 +02:00
committed by Karl Palsson
parent 92624b7d01
commit 2b8b526df0

View File

@@ -54,15 +54,15 @@ $(EXAMPLE_DIRS): lib
examples: $(EXAMPLE_DIRS) examples: $(EXAMPLE_DIRS)
$(Q)true $(Q)true
# Bleh http://www.makelinux.net/make3/make3-CHP-6-SECT-1#make3-CHP-6-SECT-1 clean: $(EXAMPLE_DIRS:=.clean)
clean:
$(Q)$(MAKE) -C libopencm3 clean $(Q)$(MAKE) -C libopencm3 clean
$(Q)for i in $(EXAMPLE_DIRS); do \
if [ -d $$i ]; then \ %.clean:
printf " CLEAN $$i\n"; \ $(Q)if [ -d $* ]; then \
$(MAKE) -C $$i clean SRCLIBDIR=$(SRCLIBDIR) || exit $?; \ printf " CLEAN $*\n"; \
fi; \ $(MAKE) -C $* clean SRCLIBDIR=$(SRCLIBDIR) || exit $?; \
done fi;
.PHONY: build lib examples $(EXAMPLE_DIRS) install clean .PHONY: build lib examples $(EXAMPLE_DIRS) install clean