forked from cocos2d/cocos2d-x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-all-linux-project.sh
executable file
·87 lines (73 loc) · 2.56 KB
/
make-all-linux-project.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
TXTCOLOR_DEFAULT="\033[0;m"
TXTCOLOR_RED="\033[0;31m"
TXTCOLOR_GREEN="\033[0;32m"
COCOS2DX20_TRUNK=`pwd`
OUTPUT_DEBUG=$COCOS2DX20_TRUNK/lib/linux/Debug/
check_make_result()
{
if [ 0 != $? ]; then
exit 1
fi
}
DIR_GLEW170=$COCOS2DX20_TRUNK/cocos2dx/platform/third_party/linux/glew-1.7.0/
if ! test -d $DIR_GLEW170/glew-1.7.0/; then
echo -e $TXTCOLOR_GREEN"it is the first time you run this linux project, some depends lib should be install"$TXTCOLOR_DEFAULT;
DEPENDS='libx11-dev'
DEPENDS+=' libxmu-dev'
DEPENDS+=' libglu1-mesa-dev'
DEPENDS+=' libgl2ps-dev'
DEPENDS+=' libxi-dev'
DEPENDS+=' libglfw-dev'
DEPENDS+=' g++'
DEPENDS+=' libzip-dev'
DEPENDS+=' libcurl4-gnutls-dev'
for i in $DEPENDS; do
echo -e $TXTCOLOR_GREEN"sudo apt-get install $i, please enter your password:"$TXTCOLOR_DEFAULT
sudo apt-get install $i
done
# DIR_GLEW170=$COCOS2DX20_TRUNK/cocos2dx/platform/third_party/linux/glew-1.7.0/
if ! test -d $DIR_GLEW170/glew-1.7.0/; then
cd $DIR_GLEW170
echo -e $TXTCOLOR_GREEN"building glew-1.7.0 ..."$TXTCOLOR_DEFAULT;
tar -zxf glew-1.7.0.tgz
make -C ./glew-1.7.0/
cd -
fi
DIR_SPIDERMONKEY_LINUX=$COCOS2DX20_TRUNK/scripting/javascript/spidermonkey-linux
if ! test -d $DIR_SPIDERMONKEY_LINUX/js-1.8.5; then
cd $DIR_SPIDERMONKEY_LINUX
echo -e $TXTCOLOR_GREEN"building spidermonkey ..."$TXTCOLOR_DEFAULT;
tar -zxf js185-1.0.0.tar.gz
cd ./js-1.8.5/js/src
./configure && make
fi
fi
OUTPUT_DEBUG=$COCOS2DX20_TRUNK/lib/linux/Debug/
if ! test -d $OUTPUT_DEBUG; then
mkdir $OUTPUT_DEBUG -p
fi
make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux
check_make_result
cp $COCOS2DX20_TRUNK/external/Box2D/proj.linux/libbox2d.a $OUTPUT_DEBUG
make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux
check_make_result
cp $COCOS2DX20_TRUNK/external/chipmunk/proj.linux/libchipmunk.a $OUTPUT_DEBUG
make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux
check_make_result
cp $COCOS2DX20_TRUNK/cocos2dx/proj.linux/libcocos2d.so $OUTPUT_DEBUG
make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux
check_make_result
cp $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so $OUTPUT_DEBUG
make -C $COCOS2DX20_TRUNK/samples/TestCpp/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/TestCpp/proj.linux
check_make_result
make -C $COCOS2DX20_TRUNK/samples/HelloCpp/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/HelloCpp/proj.linux
check_make_result
make -C $COCOS2DX20_TRUNK/samples/TestJavascript/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/TestJavascript/proj.linux
check_make_result
#cd $COCOS2DX20_TRUNK/tests/proj.linux
#./cocos2dx-test
#cd -