diff --git a/.gitignore b/.gitignore index c552b92..e4ac8d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ # Ignore executables /bin/* -/win/bin/m4kc.exe /o/* /win/o/* /win/bin/* +# Ignore packaged release +/release/* + # Just in case screenshot.bmp \ No newline at end of file diff --git a/build.sh b/build.sh index 9594fa7..ffde0b2 100755 --- a/build.sh +++ b/build.sh @@ -3,14 +3,18 @@ # m4kc build system # please keep this posix compliant! +VERSION="0.7" +PLATFORM="linux64" CC="clang" OBJ_PATH="o" OUT_PATH="bin" SRC_PATH="src" +RELEASE_PATH="release" SMALL_PATH="$OUT_PATH/m4kc" DEBUG_PATH="$OUT_PATH/m4kc-debug" GZEXE_CMD="gzexe $SMALL_PATH" +ZIP_FILES="$SMALL_PATH" FLAGS_SMALL="-Os -g0 -fno-stack-protector -fno-unwind-tables \ -fno-asynchronous-unwind-tables -Dsmall" @@ -21,6 +25,8 @@ FLAGS_LIBS="-L/usr/local/lib -lSDL2 -lm" # do specific things if we are on windows if [ ! -z "$MSYSTEM" ]; then + PLATFORM="win64" + FLAGS_INCLUDE="-mwindows -Iwin\SDL2\include" FLAGS_LIBS="-mwindows -Lwin\SDL2\lib -lmingw32 -lSDL2main -lSDL2" CC="gcc" @@ -30,8 +36,12 @@ if [ ! -z "$MSYSTEM" ]; then SMALL_PATH="$OUT_PATH/m4kc.exe" DEBUG_PATH="$OUT_PATH/m4kc-debug.exe" + GZEXE_CMD=":" + ZIP_FILES="$SMALL_PATH $OUT_PATH/SDL2.dll" fi +ZIP_PATH="$RELEASE_PATH/M4KC-$VERSION-$PLATFORM.zip" + # build a single module from src buildModule () { @@ -161,5 +171,13 @@ case $1 in rm "/usr/share/icons/m4kc.png" ;; + release) + buildAll small + echo "... packaging release" + mkdir -p "$RELEASE_PATH" + zip $ZIP_PATH $ZIP_FILES + echo ".// packaged" + ;; + *) buildModule $1 $2 ;; esac