Skip to content

Commit e7bb6e9

Browse files
committed
add support for linux to copy.sh
1 parent f98b280 commit e7bb6e9

File tree

2 files changed

+44
-23
lines changed

2 files changed

+44
-23
lines changed

game_clean/copy.sh

100644100755
Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,44 @@ rm -rf ${CLEAN_DEBUG_DIR}
1313
mkdir -p ${CLEAN_DIR}/{bin/$PLAT_DIR,tc2/bin/$PLAT_DIR,tc2/materials,tc2/cfg,tc2/scripts}
1414
mkdir -p ${CLEAN_DEBUG_DIR}/{bin/$PLAT_DIR,tc2/bin/$PLAT_DIR}
1515

16-
declare -a EXES=(
17-
tc2_win64
18-
bin/$PLAT_DIR/captioncompiler
19-
bin/$PLAT_DIR/glview
20-
bin/$PLAT_DIR/height2normal
21-
bin/$PLAT_DIR/motionmapper
22-
bin/$PLAT_DIR/qc_eyes
23-
bin/$PLAT_DIR/tgadiff
24-
bin/$PLAT_DIR/vbsp
25-
bin/$PLAT_DIR/vice
26-
bin/$PLAT_DIR/vrad
27-
bin/$PLAT_DIR/vtf2tga
28-
bin/$PLAT_DIR/vtfdiff
29-
bin/$PLAT_DIR/vvis
30-
)
31-
3216
declare -a DLLS=(
33-
bin/$PLAT_DIR/vrad_dll
34-
bin/$PLAT_DIR/vvis_dll
3517
tc2/bin/$PLAT_DIR/{client,server}
3618
)
3719

38-
declare -a DLLS_LIB=(
39-
bin/$PLAT_DIR/steam_api64
40-
)
20+
if [ $PLATFORM = "win" ]; then
21+
declare -a EXES=(
22+
tc2_win64
23+
bin/$PLAT_DIR/captioncompiler
24+
bin/$PLAT_DIR/glview
25+
bin/$PLAT_DIR/height2normal
26+
bin/$PLAT_DIR/motionmapper
27+
bin/$PLAT_DIR/qc_eyes
28+
bin/$PLAT_DIR/tgadiff
29+
bin/$PLAT_DIR/vbsp
30+
bin/$PLAT_DIR/vice
31+
bin/$PLAT_DIR/vrad
32+
bin/$PLAT_DIR/vtf2tga
33+
bin/$PLAT_DIR/vtfdiff
34+
bin/$PLAT_DIR/vvis
35+
)
36+
37+
DLLS+=(
38+
bin/$PLAT_DIR/vrad_dll
39+
bin/$PLAT_DIR/vvis_dll
40+
)
41+
42+
declare -a DLLS_LIB=(
43+
bin/$PLAT_DIR/steam_api64
44+
)
45+
elif [ $PLATFORM = "linux" ]; then
46+
declare -a EXES=(
47+
tc2_linux64
48+
)
49+
50+
declare -a DLLS_LIB=(
51+
bin/$PLAT_DIR/libsteam_api
52+
)
53+
fi
4154

4255
declare -a FILES_REP=(
4356
tc2/cfg/valve.rc
@@ -67,7 +80,15 @@ done
6780
for F in "${DLLS[@]}"; do
6881
DLL=${F}${DLL_EXT}
6982
cp -f ${DEV_DIR}/${DLL} ${CLEAN_DIR}/${DLL}
70-
cp -f ${DEV_DIR}/${F,,}.pdb ${CLEAN_DEBUG_DIR}/${F,,}.pdb
83+
if [ $PLATFORM = "win" ]; then
84+
cp -f ${DEV_DIR}/${F,,}.pdb ${CLEAN_DEBUG_DIR}/${F,,}.pdb
85+
elif [ $PLATFORM = "linux" ]; then
86+
# Linux binaries aren't stripped by the build scripts, so separate the
87+
# debug info and strip them here.
88+
cp -f ${CLEAN_DIR}/${DLL} ${CLEAN_DEBUG_DIR}/${DLL}.dbg
89+
objcopy --add-gnu-debuglink=${CLEAN_DEBUG_DIR}/${DLL}.dbg ${CLEAN_DIR}/${DLL}
90+
strip ${CLEAN_DIR}/${DLL}
91+
fi
7192
done
7293

7394
for F in "${DLLS_LIB[@]}"; do

src/buildallprojects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -euo pipefail
44

0 commit comments

Comments
 (0)