blob: 758cf559884958a96734ea61a3e022ab09199129 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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); }' \
> $@
|