Commit 3ddf271a authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

nmk: scritps/macro.mk -- Enhance gen-built-in

Add ability to specify prerequsites and phony targets.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent c58cd755
......@@ -10,13 +10,21 @@ define include-once
endef
# Helper to build built-in target in directory.
# $(eval $(call gen-built-in,<dir>))
# $(eval $(call gen-built-in,<dir>,<prerequsite>,<phony>))
define gen-built-in
$(1)/%:
$(1)/%: $(2)
$$(Q) $$(MAKE) $$(build)=$(1) $$@
$(1):
ifneq ($(3),)
$(3): $(2)
$$(Q) $$(MAKE) $$(build)=$(1) all
.PHONY: $(3)
$(1)/built-in.o: $(3)
else
$(1): $(2)
$$(Q) $$(MAKE) $$(build)=$(1) all
.PHONY: $(1)
$(1)/built-in.o: $(1)
endif
endef
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment