]> rtime.felk.cvut.cz Git - omk.git/blobdiff - snippets/config_h
Link command detection is done by make instead of shell. Should be faster.
[omk.git] / snippets / config_h
index bc7f507389291691816904c31f2bf704170c68e4..70f45479f9fab1566f39def5bb2e5d8e104e49cb 100644 (file)
@@ -9,7 +9,7 @@
 define BUILD_CONFIG_H_template
 
 $(1) : $(wildcard $(CONFIG_FILE)) $(wildcard $(CONFIG_FILE)-default)
-       @$(QUIET_CMD_ECHO) "  CONFGEN $$@ in `pwd`"
+       @$(QUIET_CMD_ECHO) "  CONFGEN $$(@:$(MAKERULES_DIR)/%=%)"
        @if [ ! -d `dirname $(1).tmp` ] ; then \
                mkdir `dirname $(1).tmp` ; fi
        @echo "/* Automatically generated from */" > "$(1).tmp"
@@ -22,8 +22,7 @@ $(1) : $(wildcard $(CONFIG_FILE)) $(wildcard $(CONFIG_FILE)-default)
                sed -n -e 's/^\([^.]*\)\.\(.*\)$$$$/#define \1 \2/p' \
                  >> "$(1).tmp"
        @echo "#endif /*$(3)*/" >> "$(1).tmp"
-       @if cmp --quiet "$(1).tmp" "$(1)" ; then \
-       echo rm "$(1).tmp" ; \
+       @if cmp --quiet "$(1).tmp" "$(1)" ; then rm "$(1).tmp"; touch "$(1)" ; \
        else mv "$(1).tmp" "$(1)" ; \
        echo Updated configuration "$(1)" ; fi
 
@@ -31,6 +30,9 @@ endef
 
 ifdef LOCAL_CONFIG_H
 
+# This must be declared after the default cflags are assigned!
+# Override is used to override command line assignemnt.
+override CFLAGS += -I.
 $(eval $(call BUILD_CONFIG_H_template,$(LOCAL_CONFIG_H),default_CONFIG,_LOCAL_CONFIG_H) )
 
 endif