Refactor resource gen script

This commit is contained in:
mkrsym1 2023-07-07 13:59:28 +03:00
parent 351fe85e2f
commit 7a8087e8a1

View File

@ -1,39 +1,37 @@
#!/usr/bin/env bash
# I hate this.
linker="x86_64-w64-mingw32-ld"
# Output config (terrible)
if [ "x$1" = "x--header" ]; then
# Select output types
for i in {0..1}
do
case "$1" in
--header)
gen_header=1
shift
fi
if [ "x$1" = "x--object" ]; then
;;
--object)
gen_object=1
shift
fi
;;
esac
done
# Read project directory
proj_dir=`realpath "$1"`
shift
# Read output file destinations
# Read output file destinations and make sure they don't exist
if [ "x${gen_object}" = "x1" ]; then
resources_o=`realpath "$1"`
shift
rm -f "${resources_h}"
fi
if [ "x${gen_header}" = "x1" ]; then
resources_h=`realpath "$1"`
shift
fi
# Make sure that output files do not exist
if [ "x${gen_header}" = "x1" ]; then
rm -f "${resources_h}"
fi
if [ "x${gen_object}" = "x1" ]; then
rm -f "${resources_o}"
fi