]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Corrected generation of defines from config options for complex values.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 16 Sep 2007 15:40:00 +0000 (15:40 +0000)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 16 Sep 2007 15:40:00 +0000 (15:40 +0000)
The words boundary finding have sometimes not allow to eliminate whole
value part. The separators (spaces or tabulator characters) are converted
to newlines first now and whole lines are processed then.

darcs-hash:20070916154019-ff715-fbae584556617a07d1d6bc580d82ca9c741e547f.gz

snippets/config_h

index 4ca3783f7b763a9b20ac70b90fbee01be47ff638..653364f5da4e3c9610b97f4fbddcf0a123864322 100644 (file)
@@ -20,7 +20,7 @@ $(1) : $(wildcard $(CONFIG_FILE)) $(wildcard $(CONFIG_FILE)-default)
        $(if $(DOXYGEN),@echo "/** @file */" >> "$(1).tmp")
        @echo "#ifndef $(3)" >> "$(1).tmp"
        @echo "#define $(3)" >> "$(1).tmp"
-       @( $(foreach x, $(shell echo '$($(2))' | sed -e 's/\<\([^ =]*\)\(=[^ ]\+\|\)\>/\1/g' ), \
+       @( $(foreach x, $(shell echo '$($(2))' | sed -e 's/[ \t]/\n/g' | sed -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' \