]> rtime.felk.cvut.cz Git - omk.git/blob - snippets/build
Formating changes, added Emacs modelines
[omk.git] / snippets / build
1
2 ##################### -*- makefile-gmake -*-
3 # Build pseudo-pass #
4 #####################
5
6 ifneq (,$(filter build,$(MAKECMDGOALS)))
7 rule_targets = $(value $(1)_targets)
8 rule_deps    = $(value $(1)_deps)
9 rule_msg     = $(value $(1)_msg)
10 rule_cmd     = $(value $(1)_cmd)
11
12 # Usage: $(eval $(call build_rule,<target>))
13 define build_rule
14 $(rule_targets): $(rule_deps) #$(omk_inc_file)
15         @$(QUIET_CMD_ECHO) "  "$(rule_msg)"$$@" #"$$(call strip_out,$$@)"
16         $(Q)$(rule_cmd)
17 endef
18
19 # TODO: Include __goals.omk.inc only in the subtree
20 -include $(shell true; find $(BUILD_OMK_DIR) -name '*.omk.inc') # `true' is a hack for MinGW
21 # FIXME: Disable automatic remake of included files
22
23 $(foreach rule,$(prepared_rules),$(eval $(call build_rule,$(rule))))
24
25 .PHONY: build
26
27 build: $(omk_goals)
28
29 endif # (,$(filter build,$(MAKECMDGOALS)))