]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Added support for renamed_include_GEN_HEADERS
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 26 Aug 2008 13:21:00 +0000 (13:21 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 26 Aug 2008 13:21:00 +0000 (13:21 +0000)
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

snippets/include
snippets/linux
snippets/rtems
snippets/sdcc
snippets/sysless
snippets/vxworks

index c2191178cf11ac755913f88f0d97bc98cfd1b29c..2c781f22443a6cba4e24caa1fb1802fb74052b67 100644 (file)
@@ -19,16 +19,22 @@ endif
 
 # Syntax: $(call include-pass-template,<include dir>,<keyword>)
 define include-pass-template
 
 # Syntax: $(call include-pass-template,<include dir>,<keyword>)
 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:
 endef
 
 # Local Variables:
index f79f7582d883114ac0238093b2cf25cecb960935..61b9928eb78f1704253484910187212d137fdd4d 100644 (file)
@@ -671,13 +671,13 @@ check-dir:
 
 install-local:                 # TODO
 
 
 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)
 ifeq ($(CONFIG_RTLINUX),y)
-       $(call include-pass-template,$(KERN_INCLUDE_DIR),rtlinux)
+$(eval $(call include-pass-template,$(KERN_INCLUDE_DIR),rtlinux))
 endif
 
 endif
 
+
 ifdef USER_RULE_TEMPLATES
 
 # User-space static libraries and applications object files
 ifdef USER_RULE_TEMPLATES
 
 # User-space static libraries and applications object files
index e45428f647dca9a79a28dcde7f4935a21cf1f96c..9a51b2c42091b27f280fceed74c074f4e5e55491 100644 (file)
@@ -304,8 +304,7 @@ check-dir:
        @$(call mkdir_def,$(USER_UTILS_DIR))
        @$(call mkdir_def,$(USER_TESTS_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
 
 
 ifdef USER_RULE_TEMPLATES
 
index 900bfc4b0d7430d3104acef4fea3aebc088f6e53..dc6a578c5a4c18b12a68c45ce27c4dc1060c7efb 100644 (file)
@@ -334,8 +334,9 @@ dep-local:
 
 install-local:
 
 
 install-local:
 
+$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include))
+
 include-pass-local:
 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), \
        @$(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), \
index 1018323e820ec14a03044a0a63d2fe85e971fea7..1b02ea8d5a9aea6ad9a95b30f042c0bf5fdbe3f9 100644 (file)
@@ -252,8 +252,9 @@ dep-local:
 
 install-local:
 
 
 install-local:
 
+$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include))
+
 include-pass-local:
 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, $(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 ; )
 
index d71b501313c7876790d13100bbdbd67baf6c6e57..06c76a0359fc5824436c5103f7f88080baa614c7 100644 (file)
@@ -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))
 
 $(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))
 
 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))