From 30c5569f9a0e4163c84c63394638326a313be3d8 Mon Sep 17 00:00:00 2001 From: insofaras Date: Sat, 9 Jul 2016 06:21:08 +0100 Subject: [PATCH] make buildsuper.sh work as intended (i think) changed SCRIPT to SCRIPT_FILE and made it default to the 4coder_default_bindings in the same dir as itself if no argument is given. --- buildsuper.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/buildsuper.sh b/buildsuper.sh index 91df38b6..55932836 100755 --- a/buildsuper.sh +++ b/buildsuper.sh @@ -1,17 +1,17 @@ #!/bin/bash -#!/bin/sh - -SOURCE="$1" -if [ -z "$SOURCE" ] -then - SOURCE="4coder_default_bindings.cpp" -fi # NOTE(allen): This code here is pulled from stack exchange, it could totally be wrong # but I just don't know. The goal is to get the path to the buildsuper.sh script so that -# path can be used as an include path which allows a file in any folder to be built in plcace. +# path can be used as an include path which allows a file in any folder to be built in place. SCRIPT_FILE=$(readlink -f "$0") -CODE_HOME=$(dirname "$SCRIPT") +CODE_HOME=$(dirname "$SCRIPT_FILE") -g++ -I"$CODE_HOME" -Wno-write-strings -std=gnu++0x $SOURCE -shared -o 4coder_custom.so -fPIC +SOURCE="$1" +if [ -z "$SOURCE" ]; then + SOURCE="$CODE_HOME/4coder_default_bindings.cpp" +fi + +echo "Building 4coder_custom.so from $SOURCE ..." + +g++ -I"$CODE_HOME" -Wno-write-strings -std=gnu++0x "$SOURCE" -shared -o 4coder_custom.so -fPIC