summaryrefslogtreecommitdiff
path: root/devtools/bin/vpc
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /devtools/bin/vpc
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'devtools/bin/vpc')
-rw-r--r--devtools/bin/vpc46
1 files changed, 46 insertions, 0 deletions
diff --git a/devtools/bin/vpc b/devtools/bin/vpc
new file mode 100644
index 0000000..de694fd
--- /dev/null
+++ b/devtools/bin/vpc
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+OS=`uname`
+SCRIPTPATH=`dirname $0`
+FORCEARG=""
+
+case $OS in
+"Darwin")
+ BINNAME=vpc_osx
+ ;;
+"Linux")
+ BINNAME=vpc_linux
+ ;;
+*)
+ echo "Couldn't find appropriate VPC binary, fix the script."
+ exit -1
+ ;;
+esac
+
+CWD=`pwd`
+cd $SCRIPTPATH/../../external/vpc/utils/vpc
+# ask make if we need to do any work, returns 0 if we don't,
+# non zero if we do.
+make -q
+RC=$?
+if [ $RC -eq 1 ]; then
+ FORCEARG="/f"
+elif [ $RC -eq 2 ]; then
+ FORCEARG="/f"
+ make clean
+fi
+make -j4
+if [ $? -ne 0 ]; then
+ exit -1
+fi
+
+cd $CWD
+
+if [ $OS == "Darwin" ]; then
+ $SCRIPTPATH/$BINNAME $FORCEARG $@
+elif [ $OS == "Linux" ]; then
+ $SCRIPTPATH/$BINNAME $FORCEARG $@
+else
+ echo "Couldn't find appropriate VPC binary, fix the script."
+ exit -1
+fi