You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
netpong/create_static_linux.sh

27 lines
726 B
Bash

#!/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/"