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.
32 lines
802 B
Bash
32 lines
802 B
Bash
#!/bin/bash
|
|
|
|
# This script copies required DLLs, and the application itself into a folder called 'release'. It only runs on MinGW.
|
|
|
|
set -o errexit # Stop executing when a command fails
|
|
BASE_DIR=$(dirname $0)
|
|
REL_DIR="$BASE_DIR/release/dist"
|
|
|
|
mkdir -p "$REL_DIR"
|
|
|
|
# Set up the build directory
|
|
meson setup build/
|
|
|
|
# Build the application
|
|
meson compile -C build/
|
|
|
|
# Parse the output of the 'ldd' command, and create a file with the required DLL paths.
|
|
ldd build/pong.exe | awk ' NF == 4 {print $3}' > "$BASE_DIR/tmp_file.txt"
|
|
|
|
# Copy the required DLLs.
|
|
cp $(cat "$BASE_DIR/tmp_file.txt") "$REL_DIR"
|
|
|
|
# Copy the executable itself
|
|
cp "$BASE_DIR/build/pong" "$REL_DIR"
|
|
|
|
# Remove the temporary file.
|
|
rm "$BASE_DIR/tmp_file.txt"
|
|
|
|
#Zip the $REL_DIR folder
|
|
zip -r "$BASE_DIR/release/netpong-win.zip" "$REL_DIR"
|
|
|