apenwarr-redo/redoconf/default.precompile.od
Avery Pennarun 6dae51f4d2 Experimental new redoconf C/C++ build/autoconfiguration system.
To test it out, try this:
	./do -j10 build
	cd docs/cookbook/c
	redo -j10 test

It should detect all the compilers on your system and make three
separate builds for each one: normal, debug, and optimized.  Then it
tries to run a test program under each one.

If there are windows cross compilers and you also have 'wine'
installed, it'll try running the test program under wine as well.

redoconf currently has no documentation other than the example program.
We'll fix that later.
2019-02-23 06:52:25 -05:00

31 lines
877 B
Text

# Run the extra steps necessary before compiling
# C/C++ programs of the specified type.
#
# Notably, we have to precompile any precompiled
# headers. We also generate redoconf.h in case
# programs want to include it.
. ./redoconf.rc
rc_include _all.rc
case ${1%.precompile} in
cc) pch_files="$PRE_CC_TARGETS" ;;
cc-fpic) pch_files="$PRE_CC_TARGETS_FPIC" ;;
cxx) pch_files="$PRE_CXX_TARGETS" ;;
cxx-fpic) pch_files="$PRE_CXX_TARGETS_FPIC" ;;
*) exit 42 ;;
esac
IFS="$NL"
set -f
redo-ifchange "redoconf.h" $pch_files
# Subtle:
# Don't consider this target to have changed unless
# the precompiled header's stamp has changed.
# We generate redoconf.h, in case
# a C program wants to include it, but we
# don't care if it has changed, because the C program
# will have its own dependency on that file.
for d in $t; do
cat "$d.stamp"
done | redo-stamp