Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 6 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | 2 | ||
3 | MY_PATH="$(dirname "$0")" |
3 | MY_PATH="$(dirname "$0")" |
- | 4 | ||
4 | APP_NAME="Carmageddon" |
5 | APP_NAME="Carmageddon" |
5 | APP_VERSION="1.0" |
6 | APP_VERSION="1.0" |
6 | APP_COPYRIGHT="© 2023 Pierre-Marie Baty |
7 | APP_COPYRIGHT="© 2023 Pierre-Marie Baty |
7 | © 2023 Dethrace Labs |
8 | © 2023 Dethrace Labs |
8 | © 1997 Stainless Games" |
9 | © 1997 Stainless Games" |
9 | BUNDLE_ID="com.pmbaty.carmageddon" |
10 | BUNDLE_ID="com.pmbaty.carmageddon" |
10 | ICON_FILE="icon.png" |
11 | ICON_FILE="icon.png" |
11 | 12 | ||
12 | cd "${MY_PATH}" || exit 1 |
13 | cd "${MY_PATH}" || exit 1 |
13 | 14 | ||
14 | # cleanup |
15 | # cleanup |
15 | rm -rf .build |
16 | rm -rf .build |
16 | rm -rf "${APP_NAME}.app" |
17 | rm -rf "${APP_NAME}.app" |
17 | 18 | ||
18 | # compiler and linker flags to use |
19 | # compiler and linker flags to use |
19 | CPPFLAGS="-DDETHRACE_FIX_BUGS=1 -Isrc/harness/include -Isrc/harness -Isrc/smackw32/include -Isrc/BRSRC13/include -Isrc/BRSRC13 -Isrc/S3/include -Isrc/S3 -Isrc/DETHRACE/common -Isrc/DETHRACE/pd -Isrc/DETHRACE -Ilib/glad/include -Ilib/libsmacker -Ilib/miniaudio/include -Ilib/miniaudio/include/miniaudio -Ilib/SDL2 -Ilib" |
20 | CPPFLAGS="-DDETHRACE_FIX_BUGS=1 -Isrc/harness/include -Isrc/harness -Isrc/smackw32/include -Isrc/BRSRC13/include -Isrc/BRSRC13 -Isrc/S3/include -Isrc/S3 -Isrc/DETHRACE/common -Isrc/DETHRACE/pd -Isrc/DETHRACE -Ilib/glad/include -Ilib/libsmacker -Ilib/miniaudio/include -Ilib/miniaudio/include/miniaudio -Ilib/SDL2 -Ilib" |
20 | 21 | ||
21 | # read the source files list from the Visual Studio project file |
22 | # read the source files list from the Visual Studio project file |
22 | SRCLIST="$(grep "<ClCompile " Carmageddon.vcxproj|awk -F\" '{print $2}'|tr '\\' '/')" |
23 | SRCLIST="$(grep "<ClCompile " Carmageddon.vcxproj|awk -F\" '{print $2}'|tr '\\' '/')" |
- | 24 | ||
- | 25 | # generate the shader programs |
|
- | 26 | echo "Compacting GLSL shaders..." |
|
- | 27 | cd src/harness || exit 1 |
|
- | 28 | for SHADER in resources/*.glsl; do |
|
- | 29 | echo "${SHADER}" |
|
- | 30 | SYMBOL_NAME="$(echo "${SHADER}"|tr '[:lower:]' '[:upper:]'|sed 's/[\.\/]/_/g')" |
|
- | 31 | ( |
|
- | 32 | echo "// Auto generated file." |
|
- | 33 | echo "static const char ${SYMBOL_NAME}[] =" |
|
- | 34 | echo "{" |
|
- | 35 | cat "${SHADER}"|xxd -p -u -c 16|sed 's/[0-9a-fA-F][0-9a-fA-F]/0x&, /g'|tr '[:upper:]' '[:lower:]' || exit 1 |
|
- | 36 | echo "};" |
|
- | 37 | ) > "${SHADER}.h" |
|
- | 38 | done |
|
- | 39 | cd ../.. |
|
23 | 40 | ||
24 | # target x86_64 and ARM64 |
41 | # target x86_64 and ARM64 |
25 | for ARCH in x86_64 arm64; do |
42 | for ARCH in x86_64 arm64; do |
26 | echo "Compiling for ${ARCH}..." |
43 | echo "Compiling for ${ARCH}..." |
27 | rm -rf ".build/${ARCH}" |
44 | rm -rf ".build/${ARCH}" |