Permalink
Browse files

Process multiple goals sequentially.

git-svn-id: file:///openmsx-svn/code/openmsx/trunk@6692 7512d703-071c-0410-b5c2-d2bdd895b7d1
  • Loading branch information...
mthuurne committed Jul 2, 2007
1 parent 1044ce4 commit c834bed98b18bbd934f4fee7110c7656db39d2f5
Showing with 48 additions and 1 deletion.
  1. +1 −1 GNUmakefile
  2. +9 −0 build/entry-seq.mk
  3. +38 −0 build/entry.mk
View
@@ -1 +1 @@
include build/main.mk
include build/entry.mk
View
@@ -0,0 +1,9 @@
# $Id$
#
# Declares a dependency between each pair of consecutive goals in GOAL_SEQUENCE.
$(word 2,$(GOAL_SEQUENCE)): $(word 1,$(GOAL_SEQUENCE))
GOAL_SEQUENCE:=$(wordlist 2,999999,$(GOAL_SEQUENCE))
ifneq ($(words $(GOAL_SEQUENCE)),1)
include build/entry-seq.mk
endif
View
@@ -0,0 +1,38 @@
# $Id$
#
# Entry point of build system.
#
# Do a sanity check on the given goal(s) and processes them sequentially.
# Sequential processing is needed because for example "clean" and "all" cannot
# run in parallel. Some goals might be able to run in parallel, but that is an
# optimization we can do later, if it is really worth it.
# All goals we want to expose to the user.
USER_GOALS:=3rdparty all bindist clean dist install probe run staticbindist
# Mark all goals as logical targets.
.PHONY: $(USER_GOALS)
# Reject unknown goals.
UNKNOWN_GOALS:=$(filter-out $(USER_GOALS),$(MAKECMDGOALS))
ifneq ($(UNKNOWN_GOALS),)
ifeq ($(words $(UNKNOWN_GOALS)),1)
$(error Unknown goal: $(UNKNOWN_GOALS))
else
$(error Unknown goals: $(UNKNOWN_GOALS))
endif
endif
# Make default goal explicit.
MAKECMDGOALS?=all
ifeq ($(words $(MAKECMDGOALS)),1)
# Single goal, run it in actual Makefile.
include build/main.mk
else
# Multiple goals are given, process them sequentially.
GOAL_SEQUENCE:=$(MAKECMDGOALS)
include build/entry-seq.mk
$(MAKECMDGOALS):
@$(MAKE) --no-print-directory -f build/main.mk $@
endif

0 comments on commit c834bed

Please sign in to comment.