Allow for ninja files to regenerate themselves

This commit is contained in:
Justin C. Miller
2019-02-02 11:52:05 -08:00
parent 0f8efdb55e
commit 8d23fac6cc
3 changed files with 58 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
ninja_required_version = 1.3
builddir = {{ buildroot }}
srcroot = {{ srcroot }}
@@ -46,9 +47,24 @@ rule lib
description = Archiving $name
command = $ar qcs $out $in
rule regen
generator = true
description = Regenrating build files
command = {{ generator }} ${builddir}
{% for target in targets %}
subninja {{ target }}/target.ninja
{% endfor %}
build $
{%- for buildfile in buildfiles %}
{{ buildfile }} $
{%- endfor %}
: regen | $
{%- for template in templates %}
{{ template }} $
{%- endfor %}
{{ generator }}
# vim: et ts=4 sts=4 sw=4