-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·53 lines (42 loc) · 2.35 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env sh
MAKE_EMBED_PATH="./tools/make_embed_linux.run"
CONDENSE_NUT_PATH="./tools/condense_nut_linux.run"
REPLACEMENT_FILES_DIR="replacement_files"
REPLACEMENT_COMPRESSED_DIR="compressed_nuts/replacement_files"
REPLACEMENT_DESTINATION_DIR="src/Netcode/replacement_files"
NEW_FILES_DIR="new_files"
NEW_COMPRESSED_DIR="compressed_nuts/new_files"
NEW_DESTINATION_DIR="src/Netcode/new_files"
mkdir -p "$REPLACEMENT_COMPRESSED_DIR"
mkdir -p "$REPLACEMENT_DESTINATION_DIR"
mkdir -p "$NEW_COMPRESSED_DIR"
mkdir -p "$NEW_DESTINATION_DIR"
for FILE in "$REPLACEMENT_FILES_DIR"/*; do
FILENAME=$(basename "$FILE")
DEST_FILE="$REPLACEMENT_COMPRESSED_DIR/$FILENAME"
$CONDENSE_NUT_PATH "$FILE" "$DEST_FILE"
done
for FILE in "$REPLACEMENT_COMPRESSED_DIR"/*; do
FILENAME=$(basename "$FILE")
DEST_FILE="$REPLACEMENT_DESTINATION_DIR/$FILENAME.h"
$MAKE_EMBED_PATH "$FILE" "$DEST_FILE"
done
for FILE in "$NEW_FILES_DIR"/*; do
FILENAME=$(basename "$FILE")
DEST_FILE="$NEW_COMPRESSED_DIR/$FILENAME"
$CONDENSE_NUT_PATH "$FILE" "$DEST_FILE"
done
for FILE in "$NEW_COMPRESSED_DIR"/*; do
FILENAME=$(basename "$FILE")
DEST_FILE="$NEW_DESTINATION_DIR/$FILENAME.h"
$MAKE_EMBED_PATH "$FILE" "$DEST_FILE"
done
llvm-rc-18 src/th155r/th155r.rc
PREFIX="$HOME/.xwin-cache/splat"
INCLUDES="/imsvc$PREFIX/crt/include /imsvc$PREFIX/sdk/include/shared /imsvc$PREFIX/sdk/include/ucrt /imsvc$PREFIX/sdk/include/um"
LIBPATHS="/LIBPATH:$PREFIX/crt/lib/x86 /LIBPATH:$PREFIX/sdk/lib/ucrt/x86 /LIBPATH:$PREFIX/sdk/lib/um/x86"
DEFINES="-D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX -D_WINSOCKAPI_ -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_DECLARE_NONSTDC_NAMES"
WARNINGS="-Wno-cpp -Wno-narrowing -Wno-c99-designator"
FLAGS="/Gs- /GS- /clang:-fwrapv /Zc:threadSafeInit- -mfpmath=sse -msse2 -msse -mstack-probe-size=1024 -flto=full -mstack-alignment=4 -mno-stackrealign /clang:-fomit-frame-pointer"
clang-cl-18 -m32 -fuse-ld=lld /EHsc $WARNINGS $DEFINES $INCLUDES $FLAGS /Isrc/shared src/th155r/main.cpp src/th155r/th155r.res -O2 /link $LIBPATHS /OUT:th155r.exe
clang-cl-18 -m32 -fuse-ld=lld /EHsc $WARNINGS $DEFINES $INCLUDES $FLAGS /Isrc/shared /Isrc/Netcode/include src/Netcode/*.cpp /std:c++20 -static -O2 /link /DLL $LIBPATHS user32.lib WS2_32.lib dbghelp.lib winmm.lib -exclude-all-symbols -kill-at /DEF:Netcode.def /OUT:Netcode.dll