Commit 96f6e106 authored by Jimmy Lu's avatar Jimmy Lu
Browse files

Add a build script

parent 51155dc3
#!/bin/bash
# The path where you have installed LLVM/CLANG.
# This is where make install put the executables.
export LLVM_BUILD_DIR=/home/jimmy/clang34
# The path where you are building systemc-clang
export SYSTEMC_CLANG_BUILD_DIR=/home/jimmy/Documents/SE499/systemc-clang-build
LLVMCOMPONENT=cppbackend
RTTIFLAG=-fno-rtti
LLVMCONFIG=$LLVM_BUILD_DIR/bin/llvm-config
export LLVM_CXX_FLAGS=`$LLVMCONFIG --cxxflags`
export LLVM_CXX_FLAGS="$LLVM_CXX_FLAGS -fvisibility-inlines-hidden"
export LLVM_LIBS=`$LLVMCONFIG --libs`
export LLVM_LD_FLAGS=`$LLVMCONFIG --ldflags`
export LLVM_LD_FLAGS=`echo $LLVM_LD_FLAGS | sed 's/ *$//g'`
OLD_DIR=`pwd`
cd $SYSTEMC_CLANG_BUILD_DIR
if [ "$1" == "full-rebuild" ]; then
cmake ../systemc-clang
make clean
fi
make
cd $OLD_DIR
......@@ -6,6 +6,9 @@ SYSTEMC_HOME=/usr/local/systemc231
# Replace with your path to `include` for clang
CLANG_INCLUDE=/home/jimmy/clang34/lib/clang/3.4/include
# Replace with your path to the systemc-clang executable
SYSTEMC_CLANG=/home/jimmy/Documents/SE499/systemc-clang-build/systemc-clang
if [ "$#" -ne 1 ]; then
echo "usage: runTest <filename.cpp>"
exit
......@@ -14,5 +17,5 @@ fi
if [ -z $SYSTEMC_HOME ]; then
echo -e "environment variable \$SYSTEMC_HOME not defined, set the variable to SystemC directory\n(e.g. export SYSTEMC_HOME=\"/usr/local/systemc-2.3.1\")";
else
systemc-clang $1 -- -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/usr/include -I/$SYSTEMC_HOME/include -I$CLANG_INCLUDE -x c++ -w -c;
$SYSTEMC_CLANG $1 -- -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/usr/include -I/$SYSTEMC_HOME/include -I$CLANG_INCLUDE -x c++ -w -c;
fi;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment