apenwarr-redo/redoconf/default.precompile.od
Avery Pennarun 1a3c11f220 redoconf: a stub rc_include() now sources ./redoconf.rc automatically.
This lets us remove the awkward ". ./redoconf.rc" line from zillions
of .od scripts, without paying the price of *always* including that
whole file every time default.do.sh is used.
2019-03-02 04:24:58 -05:00

30 lines
861 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.
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