2016-03-07 19:37:48 +00:00
|
|
|
#!/bin/bash
|
2016-05-07 17:25:45 +00:00
|
|
|
|
2017-06-30 00:02:36 +00:00
|
|
|
# Store the real CWD
|
|
|
|
REAL_PWD="$PWD"
|
|
|
|
|
2017-06-27 02:47:00 +00:00
|
|
|
# Find the code home folder
|
|
|
|
TARGET_FILE="$0"
|
|
|
|
cd `dirname $TARGET_FILE`
|
|
|
|
TARGET_FILE=`basename $TARGET_FILE`
|
|
|
|
while [ -L "$TARGET_FILE" ]
|
|
|
|
do
|
|
|
|
TARGET_FILE=`readlink $TARGET_FILE`
|
|
|
|
cd `dirname $TARGET_FILE`
|
|
|
|
TARGET_FILE=`basename $TARGET_FILE`
|
|
|
|
done
|
|
|
|
PHYS_DIR=`pwd -P`
|
|
|
|
SCRIPT_FILE=$PHYS_DIR/$TARGET_FILE
|
2018-03-10 00:34:35 +00:00
|
|
|
code_home=$(dirname "$SCRIPT_FILE")
|
2016-07-09 05:21:08 +00:00
|
|
|
|
2017-06-27 02:47:00 +00:00
|
|
|
# Find the most reasonable candidate build file
|
2016-07-09 05:21:08 +00:00
|
|
|
SOURCE="$1"
|
|
|
|
if [ -z "$SOURCE" ]; then
|
2018-03-10 00:34:35 +00:00
|
|
|
SOURCE="$code_home/4coder_default_bindings.cpp"
|
2016-07-09 05:21:08 +00:00
|
|
|
fi
|
|
|
|
|
2017-06-27 02:47:00 +00:00
|
|
|
TARGET_FILE="$SOURCE"
|
|
|
|
cd `dirname $TARGET_FILE`
|
|
|
|
TARGET_FILE=`basename $TARGET_FILE`
|
|
|
|
while [ -L "$TARGET_FILE" ]
|
|
|
|
do
|
|
|
|
TARGET_FILE=`readlink $TARGET_FILE`
|
|
|
|
cd `dirname $TARGET_FILE`
|
|
|
|
TARGET_FILE=`basename $TARGET_FILE`
|
|
|
|
done
|
|
|
|
PHYS_DIR=`pwd -P`
|
|
|
|
SOURCE=$PHYS_DIR/$TARGET_FILE
|
2017-02-20 21:05:42 +00:00
|
|
|
|
2017-06-29 23:46:37 +00:00
|
|
|
FLAGS="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-writable-strings"
|
2017-12-05 15:44:01 +00:00
|
|
|
ARCH=-m64
|
2017-11-09 00:12:14 +00:00
|
|
|
DEBUG=-g
|
|
|
|
|
2017-06-30 00:02:36 +00:00
|
|
|
cd "$REAL_PWD"
|
2018-03-10 00:34:35 +00:00
|
|
|
g++ -I"$code_home" $FLAGS $DEBUG -std=gnu++0x "$code_home/4coder_metadata_generator.cpp" -o metadata_generator
|
|
|
|
./metadata_generator -R "$code_home" "$code_home/*"
|
2017-11-22 20:05:58 +00:00
|
|
|
|
2018-03-10 00:34:35 +00:00
|
|
|
g++ -I"$code_home" $ARCH $FLAGS $DEBUG -std=gnu++0x "$SOURCE" -shared -o custom_4coder.so -fPIC
|
2016-03-07 19:37:48 +00:00
|
|
|
|
2017-11-22 20:21:53 +00:00
|
|
|
rm metadata_generator
|