summaryrefslogtreecommitdiff
path: root/src/compil.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/compil.sh')
-rwxr-xr-xsrc/compil.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/compil.sh b/src/compil.sh
new file mode 100755
index 0000000..4afcc2e
--- /dev/null
+++ b/src/compil.sh
@@ -0,0 +1,43 @@
+#!/bin/bash -e
+
+clear
+
+set -x
+CXX="g++ -Wall -g"
+BUILD_PATH="../build"
+
+AMDAPP_PATH="/opt/AMDAPP"
+
+INCLUDES=""
+LIBS=""
+
+# OpenCL
+INCLUDES="$INCLUDES -I $AMDAPP_PATH/include"
+LIBS="$LIBS -lOpenCL"
+
+# GTKGLEXT
+INCLUDES="$INCLUDES $(pkg-config --cflags gtkglextmm-1.2)"
+LIBS="$LIBS $(pkg-config --libs gtkglextmm-1.2)"
+
+set +x
+
+function build_cxx() {
+ echo "$PS4$CXX \$INCLUDES -o $BUILD_PATH/$1 -c $2"
+ $CXX $INCLUDES -o $BUILD_PATH/$1 -c $2
+}
+
+function link_cxx() {
+ out=$1
+ shift 1
+ echo "$PS4$CXX -o $BUILD_PATH/$out $* \$LIBS"
+ $CXX $* -o $BUILD_PATH/$out $LIBS
+}
+
+rm $BUILD_PATH/* || true
+
+build_cxx gpudataviz.o gpudataviz.cc
+build_cxx boring_parts.o boring_parts.cc
+build_cxx gtk_win_main.o gtk_win_main.cc
+
+link_cxx gpudataviz $BUILD_PATH/*.o
+