]> rtime.felk.cvut.cz Git - omk/sssa.git/commitdiff
Generated header files didn't depend on all config.files.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 1 May 2008 02:43:00 +0000 (02:43 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 1 May 2008 02:43:00 +0000 (02:43 +0000)
darcs-hash:20080501024350-f2ef6-6843dd83fa476fab51ffb37cd8d3ecbb414cff4e.gz

snippets/base
snippets/config_h
tests/headers/generated/runtest

index b20f19d217178525225ea6da3fe971205c2d7520..412336fa50f974d918c1f606015c5a8b88f36228 100644 (file)
@@ -79,8 +79,12 @@ CONFIG_FILE_OK = y
 endif
 endif #$(CONFIG_FILE_OK)
 
+
+CONFIG_FILES ?= $(wildcard $(CONFIG_FILE)-default) $(wildcard $(MAKERULES_DIR)/config.target) $(wildcard $(CONFIG_FILE))
+
+
 export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR
-export CONFIG_FILE OMK_SERIALIZE_INCLUDED OMK_VERBOSE OMK_SILENT
+export CONFIG_FILE CONFIG_FILES OMK_SERIALIZE_INCLUDED OMK_VERBOSE OMK_SILENT
 # OMK_SERIALIZE_INCLUDED has to be exported to submakes because passes
 # must to be serialized only in the toplevel make.
 
index 1170302eff06d7a493d01d6f5843526386b29218..35cd3aa0000481d00190ff39a365954a17184013 100644 (file)
 # Syntax: $(call BUILD_CONFIG_H_template,<stamp_dir>,<header_file_path>,<list_of_options_to_export>,<header_barrier>)
 define BUILD_CONFIG_H_template
 
-$(addprefix $(1)/,$(notdir $(addsuffix .stamp,$(2)))) : $(wildcard $(CONFIG_FILE)) $(wildcard $(CONFIG_FILE)-default)
+$(addprefix $(1)/,$(notdir $(addsuffix .stamp,$(2)))) : $(CONFIG_FILES)
        @$(QUIET_CMD_ECHO) "  CONFGEN $$(@:%.stamp=%)"
        @if [ ! -d `dirname $(2).tmp` ] ; then \
                mkdir -p `dirname $(2).tmp` ; fi
        @echo "/* Automatically generated from */" > "$(2).tmp"
-       @echo "/* config file: $$< */" >> "$(2).tmp"
+       @echo "/* config files: $$(^:$(MAKERULES_DIR)/%=%) */" >> "$(2).tmp"
        $(if $(DOXYGEN),@echo "/** @file */" >> "$(2).tmp")
        @echo "#ifndef $(4)" >> "$(2).tmp"
        @echo "#define $(4)" >> "$(2).tmp"
index 452fe663feec0bcdce668782fab503f4d77154e6..f91e1cf103d51c4ea6e57a73b4f940367e7f59ef 100755 (executable)
@@ -8,17 +8,17 @@ make include-pass || error "Can't run make include-pass"
 GC=./_compiled/include/global.h
 test -f "$GC" || error "Can't find the produced global config"
 
-grep -Fv "/* config file:" $GC | diff -u correct/global.h - || error "Global config differs"
+grep -Fv "/* config files:" $GC | diff -u correct/global.h - || error "Global config differs"
 
 make || error "Can't run make to produce local config"
 make CFLAGS=-Wall || error "Make failed with custom CFLAGS"
 LC=$(find _build -wholename '*/lincan/lincan_config.h')
 test -f "$LC" || error "Can't find the produced local config"
-grep -Fv "/* config file:" $LC | diff -u correct/lincan_config.h - || error "Local config differs"
+grep -Fv "/* config files:" $LC | diff -u correct/lincan_config.h - || error "Local config differs"
 
 TLC=$(find _build -name 'toplevel_config.h')
 test -f "$TLC" || error "Can't find the produced local config"
-grep -Fv "/* config file:" $TLC | diff -u correct/toplevel_config.h - || error "Toplevel local config differs"
+grep -Fv "/* config files:" $TLC | diff -u correct/toplevel_config.h - || error "Toplevel local config differs"
 
 touch -t 200001010000 $LC
 stat -c '%z' $LC > stat.log1