make HelloWorld and tests runs ok on linux

This commit is contained in:
minggo 2011-09-27 22:56:06 -07:00
parent 4b02dc3e45
commit 446bd86fce
5 changed files with 35 additions and 13 deletions

View File

@ -1,7 +1,7 @@
CC = gcc
CXX = g++
AR = ar
TARGET = libBox2D.a
TARGET = libbox2d.a
CCFLAGS = -Wall -g -O2
CXXFLAGS = -Wall -g -O2
ARFLAGS = cr
@ -59,4 +59,4 @@ $(TARGET): $(OBJECTS)
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) core
rm -f $(OBJECTS) $(TARGET) core

View File

@ -1,6 +1,6 @@
CC = gcc
CXX = g++
TARGET = libCocosDenshion.so
TARGET = libcocosdenshion.so
CCFLAGS = -Wall -g -O2
CXXFLAGS = -Wall -g -O2
VISIBILITY =
@ -30,4 +30,4 @@ $(TARGET): $(OBJECTS)
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) core
rm -f $(OBJECTS) $(TARGET) core

View File

@ -21,7 +21,7 @@ OBJECTS = ./main.o \
STATICLIBS =
SHAREDLIBS = -L../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../lib/linux/Debug/
$(shell ../../build-linux.sh $<)
#$(shell ../../build-linux.sh $<)
####### Build rules
$(TARGET): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -o $(TARGET) $(SHAREDLIBS) $(STATICLIBS)

32
build-linux.sh Normal file → Executable file
View File

@ -2,9 +2,10 @@
#p=$(dirname $_)
#echo "$p"
path=$(dirname $0)
path=${path/\./$(pwd)}
echo $path
#path=$(dirname $0)
#path=${path/\./$(pwd)}
#echo $path
p=.
if [ ! -d "lib" ]; then
mkdir "lib"
@ -31,20 +32,41 @@ if [ $# -ne 0 ]; then
cd $p/CocosDenshion/proj.linux
make clean
cd ../..
cd $p/Box2D/proj.linux
make clean
cd ../..
cd $p/chipmunk/proj.linux
make clean
cd ../../
rm -r lib/linux/Debug/*.so
fi
else
cd $p/cocos2dx/proj.linux
echo "**********************building cocos2dx**************************"
make
cp -f libcocos2d.so ../../lib/linux/Debug
echo "**********************building cocosdenshion*********************"
cd ../../
cd $p/CocosDenshion/proj.linux
make
cp -f libcocosdenshion.so ../../lib/linux/Debug
cp -f libCocosDenshion.so ../../lib/linux/Debug
echo "**********************building Box2D******************************"
cd ../..
cd $p/Box2D/proj.linux
make
cp -f libbox2d.a ../../lib/linux/Debug
echo "**********************building chipmunk***************************"
cd ../..
cd $p/chipmunk/proj.linux
make
cp -f libchipmunk.a ../../lib/linux/Debug
cd ../../
fi

View File

@ -103,8 +103,8 @@ OBJECTS = ../tests/AccelerometerTest/AccelerometerTest.o \
./main.o
STATICLIBS_DIR = ../../cocos2dx/platform/third_party/linux/libraries
STATICLIBS = ../../Box2D/lib/linux/libBox2D.a \
../../chipmunk/lib/linux/libchipmunk.a \
STATICLIBS = ../../lib/linux/Debug/libbox2d.a \
../../lib/linux/Debug/libchipmunk.a \
$(STATICLIBS_DIR)/libcurl.a
SHAREDLIBS = -L../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../lib/linux/Debug/
@ -121,4 +121,4 @@ $(TARGET): $(OBJECTS)
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) core
rm -f $(OBJECTS) $(TARGET) core