Author: blueswirl Date: Sun Mar 3 10:02:29 2013 New Revision: 1101 URL: http://tracker.coreboot.org/trac/openbios/changeset/1101
Log: build: improve subdir rules
Use subdirectory build rules from QEMU. They allow a parallel build of all available subdirectory targets.
Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/Makefile
Modified: trunk/openbios-devel/Makefile ============================================================================== --- trunk/openbios-devel/Makefile Thu Feb 28 00:06:10 2013 (r1100) +++ trunk/openbios-devel/Makefile Sun Mar 3 10:02:29 2013 (r1101) @@ -15,18 +15,24 @@ $(MAKE) -C $$dir clean; \ done
-build: - @printf "Building..." +build: start-build @for dir in $(ODIRS); do \ $(MAKE) -C $$dir > $$dir/build.log 2>&1 && echo "ok." || \ ( echo "error:"; tail -15 $$dir/build.log; exit 1 ) \ done
-build-verbose: +SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGETS)) +SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) + +quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1)) + +build-verbose: start-build $(SUBDIR_RULES) + +subdir-%: + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C obj-$* V="$(V)" all,) + +start-build: @echo "Building..." - @for dir in $(ODIRS); do \ - $(MAKE) -C $$dir || exit 1; \ - done
run: @echo "Running..."