diff --git a/create_static_linux.sh b/create_static_linux.sh new file mode 100755 index 0000000..067b90e --- /dev/null +++ b/create_static_linux.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# This script creates and packages a statically-linked build of the game, for Linux. +# It must be placed in the root of the source code. + +set -o errexit # Stop executing when a command fails +BASE_DIR=$(dirname 0) +REL_DIR="$BASE_DIR/release/static/pong" + +mkdir -p "$REL_DIR" + +# Set the default build target to static +meson configure -Ddefault_library=static "$BASE_DIR/build/" + +# Build the application +meson compile -C "$BASE_DIR/build/" + +# Package the application: +# 1. Copy the executable to REL_DIR +# 2. Create a tarball + +cp "$BASE_DIR/build/pong" "$REL_DIR" +tar -czf "$BASE_DIR/release/pong.tar.gz" "$REL_DIR" + +# Reset default build target to shared +meson configure -Ddefault_library=shared "$BASE_DIR/build/"