Minor build script tweaks
This commit is contained in:
+12
-12
@@ -4,23 +4,23 @@ BUILD_SCRIPT="build.sh"
|
|||||||
function isExcluded() {
|
function isExcluded() {
|
||||||
CHECKED="${1}"
|
CHECKED="${1}"
|
||||||
for VALUE in $EXCLUDE; do
|
for VALUE in $EXCLUDE; do
|
||||||
if [ "x$CHECKED" == "x$VALUE" ]; then
|
if [ "x$CHECKED" == "x$VALUE" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
for SAMPLE_DIR in *; do
|
for SAMPLE_DIR in *; do
|
||||||
if [ -d "$SAMPLE_DIR" ] && [ -e "$SAMPLE_DIR/$BUILD_SCRIPT" ]; then
|
if [ -d "$SAMPLE_DIR" ] && [ -e "$SAMPLE_DIR/$BUILD_SCRIPT" ]; then
|
||||||
echo
|
echo
|
||||||
echo "======================================================"
|
echo "======================================================"
|
||||||
date
|
date
|
||||||
echo "Building a sample: $SAMPLE_DIR."
|
echo "Building a sample: $SAMPLE_DIR."
|
||||||
if ! isExcluded "$SAMPLE_DIR"; then
|
if ! isExcluded "$SAMPLE_DIR"; then
|
||||||
(cd "$SAMPLE_DIR" && . build.sh && cd $OLD_PWD) || (echo "Cannot build a sample: $SAMPLE_DIR. See log for details." && exit 1)
|
bash "$SAMPLE_DIR/$BUILD_SCRIPT" || (echo "Cannot build a sample: $SAMPLE_DIR. See log for details." && exit 1)
|
||||||
else
|
else
|
||||||
echo "The sample excluded."
|
echo "The sample excluded."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )
|
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
@@ -25,7 +24,7 @@ mkdir -p $DIR/build/bin
|
|||||||
$DIR/buildCpp.sh
|
$DIR/buildCpp.sh
|
||||||
|
|
||||||
cinterop -def $DIR/src/main/c_interop/MessageChannel.def -copt "-I$DIR/src/main/cpp" -target $TARGET \
|
cinterop -def $DIR/src/main/c_interop/MessageChannel.def -copt "-I$DIR/src/main/cpp" -target $TARGET \
|
||||||
-o $DIR/build/c_interop/MessageChannel || exit 1
|
-o $DIR/build/c_interop/MessageChannel || exit 1
|
||||||
|
|
||||||
konanc $DIR/src/main/kotlin/Concurrent.kt -library $DIR/build/c_interop/MessageChannel \
|
konanc $DIR/src/main/kotlin/Concurrent.kt -library $DIR/build/c_interop/MessageChannel \
|
||||||
-nativelibrary $DIR/build/clang/MessageChannel.bc -o $DIR/build/bin/Concurrent || exit 1
|
-nativelibrary $DIR/build/clang/MessageChannel.bc -o $DIR/build/bin/Concurrent || exit 1
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ cinterop -def $DIR/src/main/c_interop/stdio.def -compilerOpts "$CFLAGS" -target
|
|||||||
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/CsvParser.kt -library $DIR/build/c_interop/stdio \
|
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/CsvParser.kt -library $DIR/build/c_interop/stdio \
|
||||||
-o $DIR/build/bin/CsvParser || exit 1
|
-o $DIR/build/bin/CsvParser || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/CsvParser.kexe"
|
echo "Artifact path is $DIR/build/bin/CsvParser.kexe"
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ mkdir -p $DIR/build/c_interop/
|
|||||||
mkdir -p $DIR/build/bin/
|
mkdir -p $DIR/build/bin/
|
||||||
|
|
||||||
cinterop -compilerOpts $CFLAGS -def $DIR/src/main/c_interop/libgit2.def -target $TARGET \
|
cinterop -compilerOpts $CFLAGS -def $DIR/src/main/c_interop/libgit2.def -target $TARGET \
|
||||||
-o $DIR/build/c_interop/libgit2 || exit 1
|
-o $DIR/build/c_interop/libgit2 || exit 1
|
||||||
|
|
||||||
konanc -target $TARGET $DIR/src/main/kotlin -library $DIR/build/c_interop/libgit2 -linkerOpts "$LINKER_ARGS" \
|
konanc -target $TARGET $DIR/src/main/kotlin -library $DIR/build/c_interop/libgit2 -linkerOpts "$LINKER_ARGS" \
|
||||||
-o $DIR/build/bin/GitChurn || exit 1
|
-o $DIR/build/bin/GitChurn || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/GitChurn.kexe"
|
echo "Artifact path is $DIR/build/bin/GitChurn.kexe"
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ mkdir -p $DIR/build/bin/
|
|||||||
|
|
||||||
echo "Generating GTK stubs, may take few mins depending on the hardware..."
|
echo "Generating GTK stubs, may take few mins depending on the hardware..."
|
||||||
cinterop -J-Xmx8g -copt $IPREFIX/atk-1.0 -compilerOpts $IPREFIX/gdk-pixbuf-2.0 -copt $IPREFIX/cairo -copt $IPREFIX/pango-1.0 \
|
cinterop -J-Xmx8g -copt $IPREFIX/atk-1.0 -compilerOpts $IPREFIX/gdk-pixbuf-2.0 -copt $IPREFIX/cairo -copt $IPREFIX/pango-1.0 \
|
||||||
-copt -I/opt/local/lib/glib-2.0/include -copt -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -copt -I/usr/local/lib/glib-2.0/include \
|
-copt -I/opt/local/lib/glib-2.0/include -copt -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -copt -I/usr/local/lib/glib-2.0/include \
|
||||||
-copt $IPREFIX/gtk-3.0 -copt $IPREFIX/glib-2.0 -def $DIR/src/main/c_interop/gtk3.def \
|
-copt $IPREFIX/gtk-3.0 -copt $IPREFIX/glib-2.0 -def $DIR/src/main/c_interop/gtk3.def \
|
||||||
-target $TARGET -o $DIR/build/c_interop/gtk3 || exit 1
|
-target $TARGET -o $DIR/build/c_interop/gtk3 || exit 1
|
||||||
|
|
||||||
konanc -target $TARGET $DIR/src/main/kotlin -library $DIR/build/c_interop/gtk3.bc -linkerOpts "$LINKER_ARGS" \
|
konanc -target $TARGET $DIR/src/main/kotlin -library $DIR/build/c_interop/gtk3 -linkerOpts "$LINKER_ARGS" \
|
||||||
-o $DIR/build/bin/Gtk3Demo || exit 1
|
-o $DIR/build/bin/Gtk3Demo || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/Gtk3Demo.kexe"
|
echo "Artifact path is $DIR/build/bin/Gtk3Demo.kexe"
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ mkdir -p $DIR/build/c_interop/
|
|||||||
mkdir -p $DIR/build/bin/
|
mkdir -p $DIR/build/bin/
|
||||||
|
|
||||||
cinterop -compilerOpts "$CFLAGS" -compilerOpts -I$DIR -compilerOpts -I/usr/include -def $DIR/src/main/c_interop/libcurl.def -target $TARGET \
|
cinterop -compilerOpts "$CFLAGS" -compilerOpts -I$DIR -compilerOpts -I/usr/include -def $DIR/src/main/c_interop/libcurl.def -target $TARGET \
|
||||||
-o $DIR/build/c_interop/libcurl || exit 1
|
-o $DIR/build/c_interop/libcurl || exit 1
|
||||||
|
|
||||||
konanc -target $TARGET $DIR/src/main/kotlin -library $DIR/build/c_interop/libcurl -linkerOpts "$LINKER_ARGS" \
|
konanc -target $TARGET $DIR/src/main/kotlin -library $DIR/build/c_interop/libcurl -linkerOpts "$LINKER_ARGS" \
|
||||||
-o $DIR/build/bin/Curl || exit 1
|
-o $DIR/build/bin/Curl || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/Curl.kexe"
|
echo "Artifact path is $DIR/build/bin/Curl.kexe"
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ mkdir -p $DIR/build/c_interop/
|
|||||||
mkdir -p $DIR/build/bin/
|
mkdir -p $DIR/build/bin/
|
||||||
|
|
||||||
cinterop -def $DIR/src/main/c_interop/sockets.def -copt "$CFLAGS" -target $TARGET \
|
cinterop -def $DIR/src/main/c_interop/sockets.def -copt "$CFLAGS" -target $TARGET \
|
||||||
-o $DIR/build/c_interop/sockets || exit 1
|
-o $DIR/build/c_interop/sockets || exit 1
|
||||||
|
|
||||||
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/EchoServer.kt \
|
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/EchoServer.kt \
|
||||||
-library $DIR/build/c_interop/sockets -o $DIR/build/bin/EchoServer || exit 1
|
-library $DIR/build/c_interop/sockets -o $DIR/build/bin/EchoServer || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/EchoServer.kexe"
|
echo "Artifact path is $DIR/build/bin/EchoServer.kexe"
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ mkdir -p $DIR/build/c_interop/
|
|||||||
mkdir -p $DIR/build/bin/
|
mkdir -p $DIR/build/bin/
|
||||||
|
|
||||||
cinterop -def $DIR/src/main/c_interop/opengl.def -target $TARGET \
|
cinterop -def $DIR/src/main/c_interop/opengl.def -target $TARGET \
|
||||||
-o $DIR/build/c_interop/opengl || exit 1
|
-o $DIR/build/c_interop/opengl || exit 1
|
||||||
|
|
||||||
konanc -target $TARGET $DIR/src/main/kotlin/OpenGlTeapot.kt -library $DIR/build/c_interop/opengl \
|
konanc -target $TARGET $DIR/src/main/kotlin/OpenGlTeapot.kt -library $DIR/build/c_interop/opengl \
|
||||||
-linkerOpts "$LINKER_ARGS" -o $DIR/build/bin/OpenGlTeapot || exit 1
|
-linkerOpts "$LINKER_ARGS" -o $DIR/build/bin/OpenGlTeapot || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/OpenGlTeapot.kexe"
|
echo "Artifact path is $DIR/build/bin/OpenGlTeapot.kexe"
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ mkdir -p $DIR/build/c_interop/
|
|||||||
mkdir -p $DIR/build/bin/
|
mkdir -p $DIR/build/bin/
|
||||||
|
|
||||||
cinterop -def $DIR/src/main/c_interop/sockets.def -copt "$CFLAGS" -target $TARGET \
|
cinterop -def $DIR/src/main/c_interop/sockets.def -copt "$CFLAGS" -target $TARGET \
|
||||||
-o $DIR/build/c_interop/sockets || exit 1
|
-o $DIR/build/c_interop/sockets || exit 1
|
||||||
|
|
||||||
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/EchoServer.kt \
|
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/EchoServer.kt \
|
||||||
-library $DIR/build/c_interop/sockets \
|
-library $DIR/build/c_interop/sockets \
|
||||||
-o $DIR/build/bin/EchoServer || exit 1
|
-o $DIR/build/bin/EchoServer || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/EchoServer.kexe"
|
echo "Artifact path is $DIR/build/bin/EchoServer.kexe"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
./downloadTensorflow.sh
|
|
||||||
|
|
||||||
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )
|
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
|
$DIR/downloadTensorflow.sh
|
||||||
|
|
||||||
TF_TARGET_DIRECTORY="$HOME/.konan/third-party/tensorflow"
|
TF_TARGET_DIRECTORY="$HOME/.konan/third-party/tensorflow"
|
||||||
TF_TYPE="cpu" # Change to "gpu" for GPU support
|
TF_TYPE="cpu" # Change to "gpu" for GPU support
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ mkdir -p $DIR/build/c_interop/
|
|||||||
mkdir -p $DIR/build/bin/
|
mkdir -p $DIR/build/bin/
|
||||||
|
|
||||||
cinterop -def $DIR/src/main/c_interop/tensorflow.def -compilerOpts "$CFLAGS" -target $TARGET \
|
cinterop -def $DIR/src/main/c_interop/tensorflow.def -compilerOpts "$CFLAGS" -target $TARGET \
|
||||||
-o $DIR/build/c_interop/tensorflow || exit 1
|
-o $DIR/build/c_interop/tensorflow || exit 1
|
||||||
|
|
||||||
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/HelloTensorflow.kt \
|
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/HelloTensorflow.kt \
|
||||||
-library $DIR/build/c_interop/tensorflow \
|
-library $DIR/build/c_interop/tensorflow \
|
||||||
@@ -39,4 +39,4 @@ konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/HelloTensorflow.kt \
|
|||||||
|
|
||||||
echo "Note: You may need to specify LD_LIBRARY_PATH or DYLD_LIBRARY_PATH env variables to $TF_TARGET_DIRECTORY/lib if the TensorFlow dynamic library cannot be found."
|
echo "Note: You may need to specify LD_LIBRARY_PATH or DYLD_LIBRARY_PATH env variables to $TF_TARGET_DIRECTORY/lib if the TensorFlow dynamic library cannot be found."
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/HelloTensorflow.kexe"
|
echo "Artifact path is $DIR/build/bin/HelloTensorflow.kexe"
|
||||||
|
|||||||
@@ -53,4 +53,4 @@ konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/Tetris.kt \
|
|||||||
|
|
||||||
cp -R $DIR/src/main/resources/ $DIR/build/bin/
|
cp -R $DIR/src/main/resources/ $DIR/build/bin/
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/Tetris.kexe"
|
echo "Artifact path is $DIR/build/bin/Tetris.kexe"
|
||||||
|
|||||||
Reference in New Issue
Block a user