1- #! /bin/bash
1+ #! /usr/ bin/env bash
22#
33# Run script within the directory
44BIN_DIR=$( dirname " $( readlink -fn " $0 " ) " )
@@ -10,36 +10,36 @@ source ./shared.sh
1010
1111rm -rf ${CLEAN_DIR}
1212rm -rf ${CLEAN_DEBUG_DIR}
13- mkdir -p ${CLEAN_DIR} /{bin/x64 ,tc2/bin/x64 ,tc2/materials,tc2/cfg}
14- mkdir -p ${CLEAN_DEBUG_DIR} /{bin/x64 ,tc2/bin/x64,tc2/materials,tc2/cfg }
13+ mkdir -p ${CLEAN_DIR} /{bin/$PLAT_DIR ,tc2/bin/$PLAT_DIR ,tc2/materials,tc2/cfg,tc2/scripts }
14+ mkdir -p ${CLEAN_DEBUG_DIR} /{bin/$PLAT_DIR ,tc2/bin/$PLAT_DIR }
1515
1616declare -a EXES=(
1717 tc2_win64
18- bin/x64 /captioncompiler
19- bin/x64 /glview
20- bin/x64 /height2normal
21- bin/x64 /motionmapper
22- bin/x64 /qc_eyes
23- bin/x64 /tgadiff
24- bin/x64 /vbsp
25- bin/x64 /vice
26- bin/x64 /vrad
27- bin/x64 /vtf2tga
28- bin/x64 /vtfdiff
29- bin/x64 /vvis
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
3030)
3131
3232declare -a DLLS=(
33- bin/x64 /vrad_dll
34- bin/x64 /vvis_dll
35- tc2/bin/x64 /{client,server}
33+ bin/$PLAT_DIR /vrad_dll
34+ bin/$PLAT_DIR /vvis_dll
35+ tc2/$PLAT_DIR /{client,server}
3636)
3737
3838declare -a DLLS_LIB=(
39- bin/x64 /steam_api64
39+ bin/$PLAT_DIR /steam_api64
4040)
4141
42- declare -a REP_FILES =(
42+ declare -a FILES_REP =(
4343 tc2/cfg/valve.rc
4444 tc2/cfg/default.cfg
4545 tc2/cfg/user_default.scr
@@ -59,19 +59,20 @@ declare -a FILES=(
5959)
6060
6161for F in " ${EXES[@]} " ; do
62- cp -f ${DEV_DIR} /${F} .exe ${CLEAN_DIR} /${F} .exe
62+ cp -f ${DEV_DIR} /${F}${EXE_EXT} ${CLEAN_DIR} /${F}${EXE_EXT}
6363done
6464
6565for F in " ${DLLS[@]} " ; do
66- cp -f ${DEV_DIR} /${F} .dll ${CLEAN_DIR} /${F} .dll
66+ DLL=${F}${DLL_EXT}
67+ cp -f ${DEV_DIR} /${DLL} ${CLEAN_DIR} /${DLL}
6768 cp -f ${DEV_DIR} /${F,,} .pdb ${CLEAN_DEBUG_DIR} /${F,,} .pdb
6869done
6970
7071for F in " ${DLLS_LIB[@]} " ; do
71- cp -f ${DEV_DIR} /${F} .dll ${CLEAN_DIR} /${F} .dll
72+ cp -f ${DEV_DIR} /${F}${DLL_EXT} ${CLEAN_DIR} /${F}${DLL_EXT}
7273done
7374
74- for F in " ${REP_FILES [@]} " ; do
75+ for F in " ${FILES_REP [@]} " ; do
7576 cp -rf ${DEV_DIR} /${F} ${CLEAN_DIR} /${F}
7677done
7778
0 commit comments