-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmac_build.sh
More file actions
executable file
·32 lines (27 loc) · 807 Bytes
/
mac_build.sh
File metadata and controls
executable file
·32 lines (27 loc) · 807 Bytes
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
#!/bin/sh
if [ ! -d "tmp/obj" ]; then mkdir -p tmp/obj; fi
if [ ! -d "bin/mac" ]; then mkdir -p bin/mac; fi
MAC_EXE_DIR=bin/mac
MAC_EXE=$MAC_EXE_DIR/crosscore_demo
MAC_LIBS="-framework Foundation -framework Cocoa -framework OpenGL -Xlinker -w"
MAC_OBJ=tmp/obj/mac_main.o
rm -f $MAC_OBJ
rm -f $MAC_EXE
echo "Compiling macOS adapter..."
clang -I src/mac -Wno-deprecated-declarations src/mac/mac_main.m -c -o $MAC_OBJ
if [ ! -f $MAC_OBJ ]; then
echo "Failed."
exit 1
fi
echo "OK"
echo "Compiling main code..."
clang++ -std=c++11 -I src/mac -DDEF_DEMO="\"roof\"" `ls src/*.cpp` $MAC_OBJ -o $MAC_EXE $MAC_LIBS $*
if [ ! -f $MAC_EXE ]; then
echo "Failed."
exit 1
fi
echo "OK"
cp -v src/cmd/roof.sh $MAC_EXE_DIR
cp -v src/cmd/roof_low.sh $MAC_EXE_DIR
cp -v src/cmd/lot_low.sh $MAC_EXE_DIR
ls -Go $MAC_EXE