2017-11-22 18:52:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2018-06-16 22:07:34 +00:00
|
|
|
# Store the real CWD
|
|
|
|
REAL_PWD="$PWD"
|
|
|
|
|
|
|
|
# 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
|
|
|
|
code_home=$(dirname "$SCRIPT_FILE")
|
|
|
|
|
|
|
|
# Find the most reasonable candidate build file
|
|
|
|
SOURCE="$1"
|
|
|
|
if [ -z "$SOURCE" ]; then
|
|
|
|
SOURCE="$code_home/4coder_default_bindings.cpp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-06-16 20:33:29 +00:00
|
|
|
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-writable-strings -g"
|
2017-11-22 19:04:14 +00:00
|
|
|
|
|
|
|
cd ../build > /dev/null
|
2018-06-16 20:33:29 +00:00
|
|
|
preproc_file=4coder_command_metadata.i
|
2018-06-22 20:59:21 +00:00
|
|
|
meta_macros="-DMETA_PASS"
|
2018-06-16 20:33:29 +00:00
|
|
|
g++ -I"$code_home" $meta_macros $opts -std=gnu++0x "$SOURCE" -E -o $preproc_file
|
2018-10-06 19:04:45 +00:00
|
|
|
g++ -I"$code_home" $opts -std=gnu++0x ../code/4coder_metadata_generator.cpp -o metadata_generator
|
2018-06-16 22:07:34 +00:00
|
|
|
./metadata_generator -R "$code_home" "$PWD/$preproc_file"
|
2018-06-16 20:33:29 +00:00
|
|
|
cd $code_home > /dev/null
|
2017-11-22 19:04:14 +00:00
|
|
|
|