2013-02-19 15:38:30 +08:00
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
|
|
|
TARGET = HelloCpp
|
|
|
|
CCFLAGS = -Wall
|
|
|
|
CXXFLAGS = -Wall
|
|
|
|
VISIBILITY =
|
|
|
|
LIBS =
|
|
|
|
|
|
|
|
COCOS2DX_PATH = ../../../cocos2dx
|
|
|
|
INCLUDES = -I../ \
|
|
|
|
-I../../ \
|
|
|
|
-I../Classes \
|
|
|
|
-I$(COCOS2DX_PATH) \
|
|
|
|
-I$(COCOS2DX_PATH)/platform/third_party/linux/libfreetype2 \
|
|
|
|
-I$(COCOS2DX_PATH)/cocoa \
|
|
|
|
-I$(COCOS2DX_PATH)/include \
|
|
|
|
-I$(COCOS2DX_PATH)/kazmath/include \
|
|
|
|
-I$(COCOS2DX_PATH)/platform \
|
|
|
|
-I$(COCOS2DX_PATH)/platform/linux \
|
|
|
|
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
|
|
|
|
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg \
|
|
|
|
-I../../../CocosDenshion/include \
|
|
|
|
-I../../../extensions/ \
|
|
|
|
-I../../../external/ \
|
|
|
|
-I../../../external/chipmunk/include/chipmunk \
|
|
|
|
|
|
|
|
|
|
|
|
LBITS := $(shell getconf LONG_BIT)
|
|
|
|
ifeq ($(LBITS),64)
|
|
|
|
INCLUDES += -I$(COCOS2DX_PATH)/platform/third_party/linux/include64
|
|
|
|
else
|
|
|
|
INCLUDES += -I$(COCOS2DX_PATH)/platform/third_party/linux
|
|
|
|
endif
|
|
|
|
|
|
|
|
DEFINES = -DLINUX
|
2013-02-19 17:28:49 +08:00
|
|
|
|
|
|
|
OBJECTS = ../Classes/AppDelegate.o \
|
|
|
|
../Classes/HelloWorldScene.o \
|
|
|
|
./main.o
|
2013-02-19 15:38:30 +08:00
|
|
|
|
|
|
|
ifeq ($(LBITS),64)
|
|
|
|
STATICLIBS_DIR = ../../../cocos2dx/platform/third_party/linux/libraries/lib64
|
|
|
|
else
|
|
|
|
STATICLIBS_DIR = ../../../cocos2dx/platform/third_party/linux/libraries
|
|
|
|
endif
|
|
|
|
STATICLIBS =
|
|
|
|
STATICLIBS = $(STATICLIBS_DIR)/libfreetype.a \
|
|
|
|
$(STATICLIBS_DIR)/libcurl.a \
|
|
|
|
$(STATICLIBS_DIR)/libxml2.a \
|
|
|
|
$(STATICLIBS_DIR)/libpng.a \
|
|
|
|
$(STATICLIBS_DIR)/libjpeg.a \
|
|
|
|
$(STATICLIBS_DIR)/libtiff.a \
|
2013-02-19 18:06:30 +08:00
|
|
|
../../../lib/linux/Debug/libextension.a \
|
2013-02-19 15:38:30 +08:00
|
|
|
../../../lib/linux/Debug/libbox2d.a \
|
2013-02-19 18:06:30 +08:00
|
|
|
../../../lib/linux/Debug/libchipmunk.a
|
2013-02-19 15:38:30 +08:00
|
|
|
|
|
|
|
SHAREDLIBS =
|
|
|
|
ifeq ($(LBITS),64)
|
|
|
|
SHAREDLIBS_DIR = ../../../CocosDenshion/third_party/fmod/lib64/api/lib
|
|
|
|
SHAREDLIBS = -L$(SHAREDLIBS_DIR) -lfmodex64
|
|
|
|
else
|
|
|
|
SHAREDLIBS_DIR = ../../../CocosDenshion/third_party/fmod/api/lib
|
|
|
|
SHAREDLIBS = -L$(SHAREDLIBS_DIR) -lfmodex
|
|
|
|
endif
|
|
|
|
|
|
|
|
SHAREDLIBS += -Wl,-rpath,../../$(SHAREDLIBS_DIR)
|
2013-02-19 17:28:49 +08:00
|
|
|
SHAREDLIBS += -lglfw -lGLEW -lcurl
|
2013-02-19 15:38:30 +08:00
|
|
|
|
|
|
|
BIN_DIR_ROOT=bin
|
|
|
|
BIN_DIR = BIN_DIR_ROOT
|
|
|
|
|
2013-02-19 17:28:49 +08:00
|
|
|
debug: SHAREDLIBS += -L../../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../../../../lib/linux/Debug
|
2013-02-19 15:38:30 +08:00
|
|
|
debug: CCFLAGS += -g3 -O0
|
|
|
|
debug: CXXFLAGS += -g3 -O0
|
2013-02-19 18:06:30 +08:00
|
|
|
debug: DEFINES += -DDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1
|
2013-02-19 15:38:30 +08:00
|
|
|
debug: BIN_DIR = $(BIN_DIR_ROOT)/debug
|
|
|
|
debug: $(TARGET)
|
|
|
|
|
2013-02-19 17:28:49 +08:00
|
|
|
release: SHAREDLIBS += -L../../../lib/linux/Release -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../../../../lib/linux/Release
|
2013-02-19 15:38:30 +08:00
|
|
|
release: CCFLAGS += -O3
|
|
|
|
release: CXXFLAGS += -O3
|
2013-02-19 18:06:30 +08:00
|
|
|
release: DEFINES += -DNDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
|
2013-02-19 15:38:30 +08:00
|
|
|
release: BIN_DIR = $(BIN_DIR_ROOT)/release
|
|
|
|
release: $(TARGET)
|
|
|
|
|
|
|
|
####### Build rules
|
|
|
|
$(TARGET): $(OBJECTS)
|
|
|
|
mkdir -p $(BIN_DIR)
|
|
|
|
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -o $(BIN_DIR)/$(TARGET) $(SHAREDLIBS) $(STATICLIBS) $(LIBS)
|
|
|
|
|
|
|
|
|
|
|
|
####### Compile
|
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
|
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJECTS) $(TARGET) core
|