mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
Dump compiler args and defines.
As part of the build, dump the compiler arguments and defines per target into files.
This commit is contained in:
@@ -53,12 +53,34 @@ rule cc
|
|||||||
description = Compiling $name
|
description = Compiling $name
|
||||||
command = $cc -MMD -MF $out.d $ccflags $cflags -o $out -c $in
|
command = $cc -MMD -MF $out.d $ccflags $cflags -o $out -c $in
|
||||||
|
|
||||||
|
rule dump_cc_defs
|
||||||
|
description = Dumping CC defines for $target
|
||||||
|
command = echo "" | $cc $ccflags $cflags -dM -E - > $out
|
||||||
|
|
||||||
|
rule dump_cc_run
|
||||||
|
description = Dumping CC arguments for $target
|
||||||
|
command = $
|
||||||
|
echo "#!/bin/bash" > $out; $
|
||||||
|
echo '$cc $ccflags $cflags $$*' > $out; $
|
||||||
|
chmod a+x $out
|
||||||
|
|
||||||
rule cxx
|
rule cxx
|
||||||
deps = gcc
|
deps = gcc
|
||||||
depfile = $out.d
|
depfile = $out.d
|
||||||
description = Compiling $name
|
description = Compiling $name
|
||||||
command = $cxx -MMD -MF $out.d $cxxflags $ccflags -o $out -c $in
|
command = $cxx -MMD -MF $out.d $cxxflags $ccflags -o $out -c $in
|
||||||
|
|
||||||
|
rule dump_cxx_defs
|
||||||
|
description = Dumping C++ defines for $target
|
||||||
|
command = echo "" | $cxx -x c++ $cxxflags $ccflags -dM -E - > $out
|
||||||
|
|
||||||
|
rule dump_cxx_run
|
||||||
|
description = Dumping C++ arguments for $target
|
||||||
|
command = $
|
||||||
|
echo "#!/bin/bash" > $out; $
|
||||||
|
echo '$cc $cxxflags $ccflags $$*' > $out; $
|
||||||
|
chmod a+x $out
|
||||||
|
|
||||||
rule nasm
|
rule nasm
|
||||||
deps = gcc
|
deps = gcc
|
||||||
depfile = $out.d
|
depfile = $out.d
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
builddir = $builddir/{{ target }}
|
builddir = $builddir/{{ target }}
|
||||||
|
target = {{ target }}
|
||||||
|
|
||||||
{% block variables %}
|
{% block variables %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -15,3 +16,9 @@ objcopy = objcopy
|
|||||||
{% for module in modules %}
|
{% for module in modules %}
|
||||||
subninja {{ module.name }}.ninja
|
subninja {{ module.name }}.ninja
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
build ${builddir}/cc.defs : dump_cc_defs | {{ buildfile }}
|
||||||
|
build ${builddir}/cxx.defs : dump_cxx_defs | {{ buildfile }}
|
||||||
|
build ${builddir}/cc.run : dump_cc_run | {{ buildfile }}
|
||||||
|
build ${builddir}/cxx.run : dump_cxx_run | {{ buildfile }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user