cd ..
function check1() {
- declare -l base="${1}"
- MODE=${2}
- declare -l file="${3}"
+ declare -l prog="${1}"
+ declare -l file="${2}"
+ MODE=${prog}
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
+ -include lib/_all.inc -include ${prog}/_all.qh \
+ -I. ${QCCIDENT} ${QCCDEFS} > ${WORKDIR}/${prog}.qc
+ qcc ${QCCFLAGS} -o ../${WORKDIR}/test.dat ../${WORKDIR}/${prog}.qc >/dev/null
}
function check() {
- declare -l base="${1}"
- MODE=${2}
- find ${base} -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
- check1 ${base} ${MODE} ${file}
+ declare -l prog="${1}"
+ find ${prog} -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
+ check1 ${prog} ${file}
done
}
-check client CSQC
-check server SVQC
-check menu MENUQC
+check client
+check server
+check menu
function qpp() {
IN=$1
OUT=$2
- >&2 echo + ${CPP} ${@:3} ${IN}
+ case ${MODE} in
+ client) DEFS="-DGAMEQC -DCSQC"
+ ;;
+ menu) DEFS="-DMENUQC"
+ ;;
+ server) DEFS="-DGAMEQC -DSVQC"
+ ;;
+ esac
+ >&2 echo + ${CPP} ${@:3} ${DEFS} ${IN}
set +e
# additional information
${CPP} ${@:3} \
-H 2>${WORKDIR}/${MODE}_includes.txt \
${IN}
# main step
- ${CPP} ${@:3} -MMD -MP -MT ${OUT} -Wall -Wundef -Werror ${IN} -o ${WORKDIR}/${MODE}.txt
+ ${CPP} ${@:3} ${DEFS} -MMD -MP -MT ${OUT} -Wall -Wundef -Werror ${IN} -o ${WORKDIR}/${MODE}.txt
err=$?
set -e
if [ ${err} -ne 0 ]; then return ${err}; fi
MODE=$1
OUT=$2
IN=$3
-
- case ${MODE} in
- client) DEFS="-DGAMEQC -DCSQC"
- ;;
- menu) DEFS="-DMENUQC"
- ;;
- server) DEFS="-DGAMEQC -DSVQC"
- ;;
- esac
-
- qpp ${IN} ${OUT} -I. ${QCCIDENT} ${QCCDEFS} ${DEFS} > ${WORKDIR}/${MODE}.qc
+ qpp ${IN} ${OUT} -I. ${QCCIDENT} ${QCCDEFS} > ${WORKDIR}/${MODE}.qc
qcc ${QCCFLAGS} -o ${OUT} ../${WORKDIR}/${MODE}.qc
}