@ $(RM) $(WORKDIR)/qccversion.*
@ echo $(QCCVERSION) > $@
+export WORKDIR
export CPP
export QCC
export QCCDEFS
{
it = m_findtooltipitem(main, pos);
- if (it.instanceOfListBox && it.isScrolling(it)) it = world;
+ if (it.instanceOfListBox && it.isScrolling(it)) it = NULL;
if (it && prev_tooltip != it.tooltip)
{
#!/bin/bash
set -eu
cd "$(dirname "$0")"
-cd ..
-declare -a NOWARN=(
- -Wno-field-redeclared
- -Wno-unused-variable
- -Wno-implicit-function-pointer
+WORKDIR=../.tmp
+
+CPP="cc -xc -E"
+QCC=../../../../gmqcc/gmqcc
+
+declare -a QCCDEFS=(
+ -DNDEBUG=1
)
-declare QCC=../../../gmqcc/gmqcc
+QCCDEFS="${QCCDEFS[@]}"
-declare -a QCC_FLAGS=(
+declare -a QCCFLAGS=(
-std=gmqcc
-Wall -Werror
-fftepp -fftepp-predefs -Wcpp
-frelaxed-switch
-Ooverlap-locals
)
+declare -a NOWARN=(
+ -Wno-field-redeclared
+ -Wno-unused-variable
+ -Wno-implicit-function-pointer
+ -Wno-missing-return-values
+)
+QCCFLAGS="${QCCFLAGS[@]} ${NOWARN[@]}"
+
+. qcc.sh
+cd ..
function check() {
declare -l base="${1}"
- declare -la predefs=("-D${2}" "lib/_all.inc" "${base}/_all.qh")
- find "$base" -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
- echo "$file"
- ${QCC} "${QCC_FLAGS[@]}" "${NOWARN[@]}" "${predefs[@]}" "$file" >/dev/null
+ MODE=${2}
+ find ${base} -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
+ qpp ${file} test.dat \
+ -include lib/_all.inc -include ${base}/_all.qh \
+ -I. ${QCCIDENT} ${QCCDEFS} -D${MODE} > ${WORKDIR}/${MODE}.qc
+ qcc ${QCCFLAGS} -o ../${WORKDIR}/test.dat ../${WORKDIR}/${MODE}.qc >/dev/null
done
}
#!/bin/sh
set -eu
-MODE=$1
-IN=$3
-OUT=$2
-
+WORKDIR=${WORKDIR}
+CPP=${CPP}
QCC=${QCC}
QCCIDENT="-DGMQCC"
+QCCDEFS=${QCCDEFS}
+QCCFLAGS=${QCCFLAGS}
+
+function qpp() {
+ IN=$1
+ OUT=$2
+ >&2 echo + ${CPP} ${@:3} ${IN}
+ # additional information
+ ${CPP} ${@:3} \
+ -dM 1>${WORKDIR}/${MODE}_macros.txt \
+ -H 2>${WORKDIR}/${MODE}_includes.txt \
+ ${IN}
+ # main step
+ ${CPP} ${@:3} -MMD -MP -MT ${OUT} -Wall -Wundef -Werror ${IN} -o ${WORKDIR}/${MODE}.txt
+ sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' ${WORKDIR}/${MODE}.txt
+}
+
+function qcc() {
+ >&2 echo + $(basename ${QCC}) $@
+ # FIXME: relative compiler path is too deep
+ (cd tools && ${QCC} $@)
+}
+
+$(return >/dev/null 2>&1) || {
+ MODE=$1
+ OUT=$2
+ IN=$3
-case ${MODE} in
- client) PROG=CSQC
- ;;
- menu) PROG=MENUQC
- ;;
- server) PROG=SVQC
- ;;
-esac
+ case ${MODE} in
+ client) PROG=CSQC
+ ;;
+ menu) PROG=MENUQC
+ ;;
+ server) PROG=SVQC
+ ;;
+ esac
-CPP="${CPP} -I. ${QCCIDENT} ${QCCDEFS} -D${PROG}"
-${CPP} -MMD -MP -MT ${OUT} -Wall -Wundef -Werror -o ../.tmp/${MODE}.txt ${IN}
-${CPP} -dM 1>../.tmp/${MODE}_macros.txt -H 2>../.tmp/${MODE}_includes.txt ${IN}
-sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' ../.tmp/${MODE}.txt > ../.tmp/${MODE}.qc
-cd ${MODE}
-echo $(basename ${QCC}) ${QCCFLAGS} -o ${OUT} ${MODE}.qc
-${QCC} ${QCCFLAGS} -o ${OUT} ../../.tmp/${MODE}.qc
+ qpp ${IN} ${OUT} -I. ${QCCIDENT} ${QCCDEFS} -D${PROG} > ${WORKDIR}/${MODE}.qc
+ qcc ${QCCFLAGS} -o ${OUT} ../${WORKDIR}/${MODE}.qc
+}