File: entry.mk

package info (click to toggle)
openmsx 0.8.2-2.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 15,796 kB
  • sloc: cpp: 124,615; xml: 22,614; tcl: 7,336; python: 3,789; asm: 1,154; sh: 69; makefile: 25
file content (46 lines) | stat: -rw-r--r-- 1,366 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# $Id: entry.mk 9850 2009-05-23 14:31:38Z mthuurne $
#
# Entry point of build system.
#
# Do a sanity check on the given action(s) and processes them sequentially.
# Sequential processing is needed because for example "clean" and "all" cannot
# run in parallel. Some actions might be able to run in parallel, but that is
# an optimization we can do later, if it is really worth it.

# All actions we want to expose to the user.
USER_ACTIONS:=\
	3rdparty all app bindist clean createsubs dist install probe run \
	staticbindist

# Mark all actions as logical targets.
.PHONY: $(USER_ACTIONS)

# Reject unknown actions.
UNKNOWN_ACTIONS:=$(filter-out $(USER_ACTIONS),$(MAKECMDGOALS))
ifneq ($(UNKNOWN_ACTIONS),)
ifeq ($(words $(UNKNOWN_ACTIONS)),1)
$(error Unknown action: $(UNKNOWN_ACTIONS))
else
$(error Unknown actions: $(UNKNOWN_ACTIONS))
endif
endif

ifeq ($(MAKECMDGOALS),)
# Make default action explicit.
MAKECMDGOALS:=all
.PHONY: default
default: all
endif

ifeq ($(words $(MAKECMDGOALS)),1)
# Single action, run it in this Make process.
include build/main.mk
else
# Multiple actions are given, process them sequentially.
# If the same action is given more than once, some warnings will be displayed,
# but they will all be executed.
ACTION_COUNTER:=$(MAKECMDGOALS:%=x)
include build/entry-seq.mk
$(MAKECMDGOALS): sequence-$(words $(MAKECMDGOALS))
	@true
endif