aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xbuild.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/build.sh b/build.sh
index 3d8bfdb..b51e796 100755
--- a/build.sh
+++ b/build.sh
@@ -6,6 +6,10 @@ BUEXPSRC="regex.cpp"
6BUEXPHDR="regex.h" 6BUEXPHDR="regex.h"
7BUCOMPAT="config.h compat/linux.h compat/win32.h compat/osx.h" 7BUCOMPAT="config.h compat/linux.h compat/win32.h compat/osx.h"
8 8
9if [ -z "${CXX}" ]; then
10 CXX="g++"
11fi
12
9function bld() 13function bld()
10{ 14{
11 OUTFILE="$1" 15 OUTFILE="$1"
@@ -30,7 +34,7 @@ function cmd()
30 34
31function gpp() 35function gpp()
32{ 36{
33 bld "$1" "$2" || cmd CXX "$1" g++ -ggdb -fPIC -W -Wall -Iminibu -c -o "$1" "$2" 37 bld "$1" "$2" || cmd CXX "$1" ${CXX} -ggdb -fPIC -W -Wall -Iminibu -c -o "$1" "$2"
34} 38}
35 39
36function presetup() 40function presetup()
@@ -74,9 +78,16 @@ if [ ! -z "$1" ]; then
74 presetup 78 presetup
75 exit 79 exit
76 else 80 else
77 echo "The only option supported is \"clean\", otherwise run $0" 81 echo "Without parameters build.sh will download extra components and"
78 echo "with no parameters to compile build." 82 echo "compile build."
79 echo 83 echo
84 echo "Parameters:"
85 echo " clean | -c Delete all opbject code and downloaded source."
86 echo " setup | -s Download and perform initial setup, but do not"
87 echo " compile."
88 echo
89 echo "Using ${CXX} to complie code."
90 echo
80 exit 91 exit
81 fi 92 fi
82fi 93fi
@@ -92,5 +103,5 @@ for F in src/*.c src/*.cpp; do
92 OUTPUT=${F%.*}.o 103 OUTPUT=${F%.*}.o
93 gpp "$OUTPUT" "$F" 104 gpp "$OUTPUT" "$F"
94done 105done
95bld build src/*.o minibu/src/*.o || cmd LINK build g++ -fPIC -rdynamic -Wl,-export-dynamic -o build src/*.o minibu/src/*.o -ldl 106bld build src/*.o minibu/src/*.o || cmd LINK build ${CXX} -fPIC -rdynamic -Wl,-export-dynamic -o build src/*.o minibu/src/*.o -ldl
96bld build~ build || cmd CP build~ cp build build~ 107bld build~ build || cmd CP build~ cp build build~