From: Michal Sojka Date: Tue, 26 Aug 2008 13:21:00 +0000 (+0000) Subject: Added support for renamed_include_GEN_HEADERS X-Git-Tag: v0.1-sssa~45 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/omk.git/commitdiff_plain/c58097452ae99625405af4a4636e10e6e003530b Added support for renamed_include_GEN_HEADERS The support for include files was reworked. Now, all *_GEN_HEADERS and renamed_*_GEN_HEADERS targets are supported automatically by instantiation of include-pass-template macro. darcs-hash:20080826132143-f2ef6-64baabeb80bc97554fa008d1bb7fab3e78f53dd3.gz --- diff --git a/snippets/include b/snippets/include index c219117..2c781f2 100644 --- a/snippets/include +++ b/snippets/include @@ -19,16 +19,22 @@ endif # Syntax: $(call include-pass-template,,) define include-pass-template - @$(foreach f, $($(2)_HEADERS), cmp --quiet $(SOURCES_DIR)/$(f) $(1)/$(notdir $(f)) \ - || $(call cp_cmd,$(SOURCES_DIR)/$(f),$(1)/$(notdir $(f))) || exit 1 ; ) - @$(foreach f, $($(2)_GEN_HEADERS), cmp --quiet $(f) $(1)/$(notdir $(f)) \ - || $(call cp_cmd,$(LOCAL_BUILD_DIR)/$(f),$(1)/$(notdir $(f))) || exit 1 ; ) # FIXME: Use correct build dir, then document it - @$(foreach f, $(nobase_$(2)_HEADERS), cmp --quiet $(SOURCES_DIR)/$(f) $(1)/$(f) \ - || ( mkdir -p $(1)/$(dir $(f)) && $(call cp_cmd,$(SOURCES_DIR)/$(f),$(1)/$(f)) ) || exit 1 ; ) - @$(foreach f, $(renamed_$(2)_HEADERS), \ - srcfname=`echo '$(f)' | sed -e 's/^\(.*\)->.*$$/\1/'` ; destfname=`echo '$(f)' | sed -e 's/^.*->\(.*\)$$/\1/'` ; \ - cmp --quiet $(SOURCES_DIR)/$${srcfname} $(1)/$${destfname} \ - || ( mkdir -p `dirname $(1)/$${destfname}` && $(call cp_cmd,$(SOURCES_DIR)/$${srcfname},$(1)/$${destfname}) ) || exit 1 ; ) +include-pass-local: include-pass-local-$(2) +include-pass-local-$(2): $$($(2)_GEN_HEADERS) $$(foreach f,$$(renamed_$(2)_GEN_HEADERS),$$(shell echo '$$(f)' | sed -e 's/^\(.*\)->.*$$$$/\1/')) + @$$(foreach f, $$($(2)_HEADERS), cmp --quiet $$(SOURCES_DIR)/$$(f) $(1)/$$(notdir $$(f)) \ + || $$(call cp_cmd,$$(SOURCES_DIR)/$$(f),$(1)/$$(notdir $$(f))) || exit 1 ; ) + @$$(foreach f, $$($(2)_GEN_HEADERS), cmp --quiet $$(f) $(1)/$$(notdir $$(f)) \ + || $$(call cp_cmd,$$(LOCAL_BUILD_DIR)/$$(f),$(1)/$$(notdir $$(f))) || exit 1 ; ) # FIXME: Use correct build dir, then document it + @$$(foreach f, $$(nobase_$(2)_HEADERS), cmp --quiet $$(SOURCES_DIR)/$$(f) $(1)/$$(f) \ + || ( mkdir -p $(1)/$$(dir $$(f)) && $$(call cp_cmd,$$(SOURCES_DIR)/$$(f),$(1)/$$(f)) ) || exit 1 ; ) + @$$(foreach f, $$(renamed_$(2)_HEADERS), \ + srcfname=`echo '$$(f)' | sed -e 's/^\(.*\)->.*$$$$/\1/'` ; destfname=`echo '$$(f)' | sed -e 's/^.*->\(.*\)$$$$/\1/'` ; \ + cmp --quiet $$(SOURCES_DIR)/$$$${srcfname} $(1)/$$$${destfname} \ + || ( mkdir -p `dirname $(1)/$$$${destfname}` && $$(call cp_cmd,$$(SOURCES_DIR)/$$$${srcfname},$(1)/$$$${destfname}) ) || exit 1 ; ) + @$$(foreach f, $$(renamed_$(2)_GEN_HEADERS), \ + srcfname=`echo '$$(f)' | sed -e 's/^\(.*\)->.*$$$$/\1/'` ; destfname=`echo '$$(f)' | sed -e 's/^.*->\(.*\)$$$$/\1/'` ; \ + cmp --quiet $$$${srcfname} $(1)/$$$${destfname} \ + || ( mkdir -p `dirname $(1)/$$$${destfname}` && $$(call cp_cmd,$$(LOCAL_BUILD_DIR)/$$$${srcfname},$(1)/$$$${destfname}) ) || exit 1 ; ) endef # Local Variables: diff --git a/snippets/linux b/snippets/linux index f79f758..61b9928 100644 --- a/snippets/linux +++ b/snippets/linux @@ -671,13 +671,13 @@ check-dir: install-local: # TODO -include-pass-local: $(include_GEN_HEADERS) - $(call include-pass-template,$(USER_INCLUDE_DIR),include) - $(call include-pass-template,$(KERN_INCLUDE_DIR),kernel) +$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include)) +$(eval $(call include-pass-template,$(KERN_INCLUDE_DIR),kernel)) ifeq ($(CONFIG_RTLINUX),y) - $(call include-pass-template,$(KERN_INCLUDE_DIR),rtlinux) +$(eval $(call include-pass-template,$(KERN_INCLUDE_DIR),rtlinux)) endif + ifdef USER_RULE_TEMPLATES # User-space static libraries and applications object files diff --git a/snippets/rtems b/snippets/rtems index e45428f..9a51b2c 100644 --- a/snippets/rtems +++ b/snippets/rtems @@ -304,8 +304,7 @@ check-dir: @$(call mkdir_def,$(USER_UTILS_DIR)) @$(call mkdir_def,$(USER_TESTS_DIR)) -include-pass-local: - $(call include-pass-template,$(USER_INCLUDE_DIR),include) +$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include)) ifdef USER_RULE_TEMPLATES diff --git a/snippets/sdcc b/snippets/sdcc index 900bfc4..dc6a578 100644 --- a/snippets/sdcc +++ b/snippets/sdcc @@ -334,8 +334,9 @@ dep-local: install-local: +$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include)) + include-pass-local: - $(call include-pass-template,$(USER_INCLUDE_DIR),include) @$(foreach f, $(lib_LDSCRIPTS), cmp --quiet $(SOURCES_DIR)/$(f) $(USER_LIB_DIR)/$(notdir $(f)) \ || $(call cp_cmd,$(SOURCES_DIR)/$(f),$(USER_LIB_DIR)/$(notdir $(f))) || exit 1 ; ) @$(foreach f, $(asm_build_HEADERS), \ diff --git a/snippets/sysless b/snippets/sysless index 1018323..1b02ea8 100644 --- a/snippets/sysless +++ b/snippets/sysless @@ -252,8 +252,9 @@ dep-local: install-local: +$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include)) + include-pass-local: - $(call include-pass-template,$(USER_INCLUDE_DIR),include) @$(foreach f, $(lib_LDSCRIPTS), cmp --quiet $(SOURCES_DIR)/$(f) $(USER_LIB_DIR)/$(notdir $(f)) \ || $(call cp_cmd,$(SOURCES_DIR)/$(f),$(USER_LIB_DIR)/$(notdir $(f))) || exit 1 ; ) diff --git a/snippets/vxworks b/snippets/vxworks index d71b501..06c76a0 100644 --- a/snippets/vxworks +++ b/snippets/vxworks @@ -181,8 +181,7 @@ $(eval $(call omk_pass_template,clean,$(USER_OBJS_DIR),,always)) $(eval $(call omk_pass_template,install,$(USER_OBJS_DIR),,always)) $(eval $(call omk_pass_template,include-pass,$(USER_OBJS_DIR),,always)) -include-pass-local: - $(call include-pass-template,$(USER_INCLUDE_DIR),include) +$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include)) library-pass-local: $(addprefix $(USER_INCLUDE_DIR)/,$(cmetric_include_HEADERS)) \ $(lib_LIBRARIES:%=$(USER_LIB_DIR)/lib%.a) $(shared_LIBRARIES:%=$(USER_LIB_DIR)/lib%.$(SOLIB_EXT))