X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=misc%2Fcheck-proj.sh;h=60ea3c89df1e1f3da7401bb43d8f4b57aad15cc3;hb=207d391fcdefe0e1c6b61bba14458cc834f1e24e;hp=6573edabcf8b3d368234e3c646f13329760a9722;hpb=c52ad67a7cefc602a1a415eca0f92cd23beaf28f;p=xonotic%2Fgmqcc.git diff --git a/misc/check-proj.sh b/misc/check-proj.sh index 6573eda..60ea3c8 100755 --- a/misc/check-proj.sh +++ b/misc/check-proj.sh @@ -71,13 +71,27 @@ else fi # compile projects in those directories -which gmqcc >> /dev/null || (echo "error gmqcc not installed" && exit 1) +gmqcc_bin="gmqcc" +env -i type gmqcc 1>/dev/null 2>&1 || { + if [ -f ../gmqcc ]; then + echo "found previous build of gmqcc, using it" + gmqcc_bin="$(pwd)/../gmqcc" + elif [ -f ./gmqcc ]; then + echo "found previous build of gmqcc, using it" + gmqcc_bin="$(pwd)/gmqcc" + else + echo "gmqcc not installed, and previous build doesn't exist" + echo "please run make, or make install" + exit 1 + fi +} + pushd ~/.gmqcc/testsuite/projects >> /dev/null find . -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | while read -r line do echo -n "compiling $line... " pushd "$line" >> /dev/null - gmqcc -std=qcc > /dev/null 2>&1 + "$gmqcc_bin" -std=qcc > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "error" else