OXYGENHUB
◆ main openmsx / build / entry.mk
1.3 KiB · Makefile · last changed chore(): initial commit 1 month ago source blame history raw
1
# Entry point of build system.
2
#
3
# Do a sanity check on the given action(s) and processes them sequentially.
4
# Sequential processing is needed because for example "clean" and "all" cannot
5
# run in parallel. Some actions might be able to run in parallel, but that is
6
# an optimization we can do later, if it is really worth it.
7
8
# All actions we want to expose to the user.
9
USER_ACTIONS:=\
10
	3rdparty all app bindist clean createsubs dist install probe run \
11
	staticbindist
12
13
# Mark all actions as logical targets.
14
.PHONY: $(USER_ACTIONS)
15
16
# Reject unknown actions.
17
UNKNOWN_ACTIONS:=$(filter-out $(USER_ACTIONS),$(MAKECMDGOALS))
18
ifneq ($(UNKNOWN_ACTIONS),)
19
ifeq ($(words $(UNKNOWN_ACTIONS)),1)
20
$(error Unknown action: $(UNKNOWN_ACTIONS))
21
else
22
$(error Unknown actions: $(UNKNOWN_ACTIONS))
23
endif
24
endif
25
26
ifeq ($(MAKECMDGOALS),)
27
# Make default action explicit.
28
MAKECMDGOALS:=all
29
.PHONY: default
30
default: all
31
endif
32
33
ifeq ($(words $(MAKECMDGOALS)),1)
34
# Single action, run it in this Make process.
35
include build/main.mk
36
else
37
# Multiple actions are given, process them sequentially.
38
# If the same action is given more than once, some warnings will be displayed,
39
# but they will all be executed.
40
ACTION_COUNTER:=$(MAKECMDGOALS:%=x)
41
include build/entry-seq.mk
42
$(MAKECMDGOALS): sequence-$(words $(MAKECMDGOALS))
43
	@true
44
endif