##################### # Build pseudo-pass # ##################### ifneq (,$(filter build,$(MAKECMDGOALS))) rule_targets = $(value $(1)_targets) rule_deps = $(value $(1)_deps) rule_msg = $(value $(1)_msg) rule_cmd = $(value $(1)_cmd) # Usage: $(eval $(call build_rule,)) define build_rule $(rule_targets): $(rule_deps) #$(omk_inc_file) @$(QUIET_CMD_ECHO) " "$(rule_msg)"$$@" #"$$(call strip_out,$$@)" $(Q)$(rule_cmd) endef # Goals are included only for this directory and all subdirectories # TODO: What if a target depends on a library from different # subtree. Then the library would be remade even if it should not # because its __goals.omk.inc is not included. -include $(shell true; find $(OMK_WORK_DIR) -name '__goals.omk.inc') # `true' is a hack for MinGW # Definition of rules is included everywhere to allow multi-directory # targets. -include $(shell true; find $(BUILD_OMK_DIR) -name '*.omk.inc' -not -name '__goals.omk.inc') # `true' is a hack for MinGW # FIXME: Disable automatic remake of included files $(foreach rule,$(prepared_rules),$(eval $(call build_rule,$(rule)))) .PHONY: build build: $(omk_goals) endif # (,$(filter build,$(MAKECMDGOALS)))