Refactor resource gen script
This commit is contained in:
parent
351fe85e2f
commit
7a8087e8a1
@ -1,39 +1,37 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# I hate this.
|
|
||||||
|
|
||||||
linker="x86_64-w64-mingw32-ld"
|
linker="x86_64-w64-mingw32-ld"
|
||||||
|
|
||||||
# Output config (terrible)
|
# Select output types
|
||||||
if [ "x$1" = "x--header" ]; then
|
for i in {0..1}
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
--header)
|
||||||
gen_header=1
|
gen_header=1
|
||||||
shift
|
shift
|
||||||
fi
|
;;
|
||||||
|
--object)
|
||||||
if [ "x$1" = "x--object" ]; then
|
|
||||||
gen_object=1
|
gen_object=1
|
||||||
shift
|
shift
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# Read project directory
|
# Read project directory
|
||||||
proj_dir=`realpath "$1"`
|
proj_dir=`realpath "$1"`
|
||||||
shift
|
shift
|
||||||
|
|
||||||
# Read output file destinations
|
# Read output file destinations and make sure they don't exist
|
||||||
if [ "x${gen_object}" = "x1" ]; then
|
if [ "x${gen_object}" = "x1" ]; then
|
||||||
resources_o=`realpath "$1"`
|
resources_o=`realpath "$1"`
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
rm -f "${resources_h}"
|
||||||
fi
|
fi
|
||||||
if [ "x${gen_header}" = "x1" ]; then
|
if [ "x${gen_header}" = "x1" ]; then
|
||||||
resources_h=`realpath "$1"`
|
resources_h=`realpath "$1"`
|
||||||
shift
|
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}"
|
rm -f "${resources_o}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user