]> rtime.felk.cvut.cz Git - omk.git/blobdiff - snippets/config_h.omk
Apply allow sources in subdirectories to rtems and sdcc rules.
[omk.git] / snippets / config_h.omk
index 98f717f452eac50e0132c229f0b3caccf6c4ef49..6bbcac517e6d04531ba1ef82d083ebd4eaf14ead 100644 (file)
@@ -12,7 +12,7 @@
 define BUILD_CONFIG_H_template
 
 $(addprefix $(1)/,$(notdir $(addsuffix .stamp,$(2)))) : $(CONFIG_FILES)
-       @$(QUIET_CMD_ECHO) "  CONFGEN $$(@:%.stamp=%)"
+       @$(QUIET_CMD_ECHO) "  CONFGEN $(notdir $(2))"
        @if [ ! -d `dirname $(2).tmp` ] ; then \
                mkdir -p `dirname $(2).tmp` ; fi
        @echo "/* Automatically generated from */" > "$(2).tmp"
@@ -20,14 +20,14 @@ $(addprefix $(1)/,$(notdir $(addsuffix .stamp,$(2)))) : $(CONFIG_FILES)
        $(if $(DOXYGEN),@echo "/** @file */" >> "$(2).tmp")
        @echo "#ifndef $(4)" >> "$(2).tmp"
        @echo "#define $(4)" >> "$(2).tmp"
-       @( $(foreach x, $(shell echo '$($(3))' | tr 'x\t ' 'x\n\n' | sed -e 's/^\([^ =]*\)\(=[^ ]\+\|\)$$/\1/' ), \
+       @( $(foreach x, $(shell echo '$($(3))' | tr 'x\t ' 'x\n\n' | $(SED4OMK) -e 's/^\([^ =]*\)\(=[^ ]\+\|\)$$/\1/' ), \
                echo '$(x).$($(x))' ; ) echo ; ) | \
-               sed -e '/^[^.]*\.n$$$$/d' -e '/^[^.]*\.$$$$/d' -e 's/^\([^.]*\)\.[ym]$$$$/\1.1/' | \
-               sed -n -e 's/^\([^.]*\)\.\(.*\)$$$$/#define \1 \2/p' \
+               $(SED4OMK) -e '/^[^.]*\.n$$$$/d' -e '/^[^.]*\.$$$$/d' -e 's/^\([^.]*\)\.[ym]$$$$/\1.1/' | \
+               $(SED4OMK) -n -e 's/^\([^.]*\)\.\(.*\)$$$$/#define \1 \2/p' \
                  >> "$(2).tmp"
        @echo "#endif /*$(4)*/" >> "$(2).tmp"
        @touch "$$@"
-       @if cmp --quiet "$(2).tmp" "$(2)" ; then rm "$(2).tmp"; \
+       @if cmp -s "$(2).tmp" "$(2)" ; then rm "$(2).tmp"; \
        else mv "$(2).tmp" "$(2)" ; \
        echo "Updated configuration $(2)" ; fi
 
@@ -72,14 +72,7 @@ include-pass-local: $(kern_config_h_stamp_files)
 
 endif
 
-clean-local: clean-local-config-h
-
-clean-local-config-h:
+clean-local::
        @$(foreach confh,$(config_h_stamp_files) $(kern_config_h_stamp_files),\
            if [ -e $(confh) ] ; then rm $(confh) ; fi ; \
        )
-
-
-# Local Variables:
-# mode:makefile
-# End: