Skip to content

Commit

Permalink
build: improve subdir rules
Browse files Browse the repository at this point in the history
Use subdirectory build rules from QEMU. They allow a parallel build of
all available subdirectory targets.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1101 f158a5a8-5612-0410-a976-696ce0be7e32
  • Loading branch information
blueswirl committed Mar 3, 2013
1 parent 6abc66b commit e7028ba
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,24 @@ clean:
$(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..."
Expand Down

0 comments on commit e7028ba

Please sign in to comment.