diff --git a/HelloWorld/Linux/Makefile b/HelloWorld/Linux/Makefile index 60afe2f568..d0c050ce80 100644 --- a/HelloWorld/Linux/Makefile +++ b/HelloWorld/Linux/Makefile @@ -17,14 +17,11 @@ DEFINES = -DLINUX OBJECTS = ./main.o \ ../Classes/AppDelegate.o \ ../Classes/HelloWorldScene.o - -STATICLIBS_DIR = ../../cocos2dx/platform/third_party/linux/libraries -STATICLIBS = ../../Box2D/lib/linux/libBox2D.a \ - ../../chipmunk/lib/linux/libchipmunk.a \ - $(STATICLIBS_DIR)/libcurl.a - + +STATICLIBS = SHAREDLIBS = -L../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../lib/linux/Debug/ +$(shell ../../build-linux.sh $<) ####### Build rules $(TARGET): $(OBJECTS) $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -o $(TARGET) $(SHAREDLIBS) $(STATICLIBS) @@ -37,4 +34,4 @@ $(TARGET): $(OBJECTS) $(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ clean: - rm -f $(OBJECTS) $(TARGET) core \ No newline at end of file + rm -f $(OBJECTS) $(TARGET) core diff --git a/build-linux.sh b/build-linux.sh index 0adf53891f..cfdc4f75f1 100644 --- a/build-linux.sh +++ b/build-linux.sh @@ -1,4 +1,10 @@ #!/bin/sh +#p=$(dirname $_) +#echo "$p" + +path=$(dirname $0) +path=${path/\./$(pwd)} +echo $path if [ ! -d "lib" ]; then mkdir "lib" @@ -8,10 +14,6 @@ if [ ! -d "lib/linux" ]; then mkdir "lib/linux" fi -if [ ! -d "lib/android" ]; then -mkdir "lib/android" -fi - if [ ! -d "lib/linux/Debug" ]; then mkdir "lib/linux/Debug" fi @@ -20,54 +22,29 @@ if [ ! -d "lib/linux/Release" ]; then mkdir "lib/linux/Release" fi -if [ ! -d "lib/android/Debug" ]; then -mkdir "lib/android/Debug" -fi - -if [ ! -d "lib/android/Release" ]; then -mkdir "lib/android/Release" -fi - - - if [ $# -ne 0 ]; then if [ $1 = "clean" ]; then - cd ./cocos2dx/proj.linux + cd $p/cocos2dx/proj.linux make clean cd ../../ - cd ./CocosDenshion/proj.linux + cd $p/CocosDenshion/proj.linux make clean cd ../../ - cd ./HelloWorld/Linux - make clean - - cd ../../ - cd ./tests/test.linux - make clean - - cd ../../ - rm -r lib + rm -r lib/linux/Debug/*.so fi else - cd ./cocos2dx/proj.linux + cd $p/cocos2dx/proj.linux make cp -f libcocos2d.so ../../lib/linux/Debug cd ../../ - cd ./CocosDenshion/proj.linux + cd $p/CocosDenshion/proj.linux make cp -f libCocosDenshion.so ../../lib/linux/Debug - cd ../../ - cd ./HelloWorld/Linux - make - - cd ../../ - cd ./tests/test.linux - make cd ../../ fi