summaryrefslogtreecommitdiff
path: root/make/model.make
diff options
context:
space:
mode:
Diffstat (limited to 'make/model.make')
-rw-r--r--make/model.make23
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
contact: Jan Huwald // Impressum