feat(pyratemp): successfully generating make deps

After minor modifications to pyratemp, it certainly does the job.

What it **does NOT** do:

* multiple outputs per template/command invocation
* NICE embedding of code (like GSL can)

It will do the job nonetheless, but mako might be worth a look
This commit is contained in:
Sebastian Thiel
2015-03-01 15:08:37 +01:00
parent 179c64c5e7
commit c0bfeabbc3
7 changed files with 269 additions and 36 deletions

24
src/pyra/deps.pyra Normal file
View File

@@ -0,0 +1,24 @@
$!setvar("api_info", "[]")!$#!
<!--(for a in api.list)-->
$!setvar("gen_root", "directories.output + '/' + a.name + '_' + a.version")!$#!
$!setvar("api_name", "a.name+a.version")!$#!
$!setvar("api_clean", "api_name+'-clean'")!$#!
$!gen_root!$: $!directories.api_base!$/$!a.name!$/$!a.version!$/$!a.name!$-api.json
$!api_name!$: $!gen_root!$
$!api_clean!$:
rm -Rf $!gen_root!$
$!api_info.append((api_name, api_clean, gen_root))!$#!
<!--(end)-->
.PHONY += $(.PHONY) $!' '.join(a[0] for a in api_info)!$ $!' '.join(a[1] for a in api_info)!$
help-api:
<!--(for a in api_info)-->
$(info $!a[0]!$ - build the $!a[0]!$ api)
$(info $!a[1]!$ - clean all generated files of the $!a[0]!$ api)
<!--(end)-->
clean-api: $!' '.join(a[1] for a in api_info)!$