2 [ -z "$QCCFLAGS_WATERMARK" ] && export QCCFLAGS_WATERMARK=$(git describe --tags --dirty='~')
6 # This script attempts to build the codebase in every possible header configuration,
7 # to check that all files #include what they need, so that we can eventually move away
8 # from a unity build and into incremental compilation.
10 # If these files exist from previous compilation, `./all compile` will stop
11 # detecting changes after running this script so delete them to trigger
12 # a recompile next time.
13 if [ -f ../../csprogs.dat ]; then
17 if [ -f ../../menu.dat ]; then
21 if [ -f ../../progs.dat ]; then
28 : ${QCC:=$PWD/../../../../gmqcc/gmqcc}
33 -DWATERMARK="\"$QCCFLAGS_WATERMARK\""
38 QCCDEFS="${QCCDEFS[@]}"
42 # Without -O3, GMQCC thinks some variables are used uninitialized if the initialization is done inside an `if (1)` block
43 # (which is created by e.g. BEGIN_MACRO) which would cause the compilation units test to fail.
44 # There doesn't appear to be any measurable increase in compile time
45 # and it allows us to get rid of some explicit initializations which are just useless noise.
56 -Wno-implicit-function-pointer
57 -Wno-missing-return-values
59 QCCFLAGS="${QCCFLAGS[@]} ${NOWARN[@]}"
65 declare -l prog="${1}"
66 declare -l file="${2}"
68 includes="-include lib/_all.inc"
69 [ -f ${prog}/_all.qh ] && includes="${includes} -include ${prog}/_all.qh"
70 qpp ${file} test-${prog}.dat \
72 -I. ${QCCIDENT} ${QCCDEFS} > ${WORKDIR}/${prog}.qc
73 qcc ${QCCFLAGS} -o ../${WORKDIR}/test-${prog}.dat ../${WORKDIR}/${prog}.qc >/dev/null
77 declare -l prog="${1}"
78 find ${prog} -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
79 check1 ${prog} ${file}
83 if [ ${#@} -eq 0 ]; then