diff --git a/publish.sh b/publish.sh index e55d830..070a947 100755 --- a/publish.sh +++ b/publish.sh @@ -1,10 +1,16 @@ #!/bin/bash +# you may set env var EXAMPLESROOT (helianthus-examples repo) + set -e ROOT="$(cd `dirname "$0"`; pwd)" cd "$ROOT" +if [ -z "$EXAMPLESROOT" ]; then + EXAMPLESROOT="$ROOT/../helianthus-examples" +fi + VER="$(git describe --tags)" PUBDIR="$ROOT/build-publish" mkdir -p "$PUBDIR" @@ -42,6 +48,14 @@ cp -r "$SRCDIR" "$BINDIR/src/" echo "Binary files licensed under GPL. Look license notes in src directory and subdirectories" >> "$BINDIR/readme" +# prepare examples +echo " -- prepare examples -- " +HELIROOT="$ROOT" "$EXAMPLESROOT/publish.sh" +cp -r "$EXAMPLESROOT/build-publish/"* "$BINDIR/" +cp -r "$EXAMPLESROOT/build-publish/"* "$SRCDIR/" +rm -rf "$SRCDIR/examples"*/bin + + # prepare archives cd "$PUBDIR" echo " -- prepare archives -- " diff --git a/win/build-program-win.sh b/win/build-program-win.sh index dc553f0..610222d 100755 --- a/win/build-program-win.sh +++ b/win/build-program-win.sh @@ -2,7 +2,10 @@ set -e -TARGETPATH="$(pwd)" +if [ -z "$TARGETPATH" ]; then + TARGETPATH="$(pwd)" +fi + PROGNAME="$1" ARGS=() for file in ${@:2}; do @@ -14,6 +17,7 @@ done if [ -z "$PROGNAME" ] || [ -z "$ARGS" ]; then echo "Usage: $0 program_name file1.c file2.c ..." + echo "You may set environment variable TARGETPATH - the full path to target directory" exit 1 fi