diff options
author | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
commit | 420d2ef464d4a741028e132e662d5626806a41f5 (patch) | |
tree | 1aca6eb512e4ed0fb5f3c10c528cb998b6ffd695 /make/model.make |
Diffstat (limited to 'make/model.make')
-rw-r--r-- | make/model.make | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/make/model.make b/make/model.make new file mode 100644 index 0000000..758cf55 --- /dev/null +++ b/make/model.make @@ -0,0 +1,23 @@ +# model/$basefile_$name_value.auto.model +.SECONDEXPANSION: +model/%.auto.model: BASE=$(shell echo "$(@F)" | sed 's/\(.*\).auto.model/\1/' | cut -f1 -d_) +model/%.auto.model: NAME=$(shell echo "$(@F)" | sed 's/\(.*\).auto.model/\1/' | cut -f2 -d_) +model/%.auto.model: VALUE=$(shell echo "$(@F)" | sed 's/\(.*\).auto.model/\1/' | cut -f3 -d_) +model/%.auto.model: model/$$(BASE).model + @[ -n "$(BASE)" -a -n "$(NAME)" -a -n "$(VALUE)" ] || (echo "Missing parameter"; false) + @echo Generating $@ + @echo -e 'include "$(BASE)";\n' \ + 'const const { double $(NAME) = $(VALUE); }' \ + > $@ + +# model/$basefile_$name_value.auto.model +.SECONDEXPANSION: +model/%.autoint.model: BASE=$(shell echo "$(@F)" | sed 's/\(.*\).autoint.model/\1/' | cut -f1 -d_) +model/%.autoint.model: NAME=$(shell echo "$(@F)" | sed 's/\(.*\).autoint.model/\1/' | cut -f2 -d_) +model/%.autoint.model: VALUE=$(shell echo "$(@F)" | sed 's/\(.*\).autoint.model/\1/' | cut -f3 -d_) +model/%.autoint.model: model/$$(BASE).model + @[ -n "$(BASE)" -a -n "$(NAME)" -a -n "$(VALUE)" ] || (echo "Missing parameter"; false) + @echo Generating $@ + @echo -e 'include "$(BASE)";\n' \ + 'const const { int $(NAME) = $(VALUE); }' \ + > $@
\ No newline at end of file |