2012-08-02 13:02:59 +08:00
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
2012-08-02 16:23:31 +08:00
|
|
|
TARGET = HelloCpp
|
2012-09-21 14:35:41 +08:00
|
|
|
CCFLAGS = -Wall
|
|
|
|
CXXFLAGS = -Wall
|
2012-08-02 13:02:59 +08:00
|
|
|
VISIBILITY =
|
|
|
|
|
2012-08-02 13:19:40 +08:00
|
|
|
COCOS2DX_PATH = ../../../cocos2dx
|
2012-08-02 13:02:59 +08:00
|
|
|
INCLUDES = -I../ \
|
|
|
|
-I../Classes \
|
|
|
|
-I$(COCOS2DX_PATH) \
|
|
|
|
-I$(COCOS2DX_PATH)/platform/third_party/linux \
|
|
|
|
-I$(COCOS2DX_PATH)/platform/third_party/linux/libfreetype2 \
|
|
|
|
-I$(COCOS2DX_PATH)/cocoa \
|
|
|
|
-I$(COCOS2DX_PATH)/include \
|
|
|
|
-I$(COCOS2DX_PATH)/platform \
|
2012-08-02 16:23:31 +08:00
|
|
|
-I$(COCOS2DX_PATH)/platform/linux \
|
2012-08-02 13:02:59 +08:00
|
|
|
-I$(COCOS2DX_PATH)/platform/third_party/linux/glew-1.7.0/glew-1.7.0/include/ \
|
|
|
|
-I$(COCOS2DX_PATH)/kazmath/include \
|
|
|
|
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
|
|
|
|
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg \
|
|
|
|
|
|
|
|
|
|
|
|
DEFINES = -DLINUX
|
|
|
|
|
|
|
|
OBJECTS = ./main.o \
|
|
|
|
../Classes/AppDelegate.o \
|
|
|
|
../Classes/HelloWorldScene.o
|
|
|
|
|
|
|
|
LBITS := $(shell getconf LONG_BIT)
|
|
|
|
ifeq ($(LBITS),64)
|
2012-08-02 13:19:40 +08:00
|
|
|
STATICLIBS_DIR = ../../../cocos2dx/platform/third_party/linux/libraries/lib64
|
2012-08-02 13:02:59 +08:00
|
|
|
else
|
2012-08-02 13:19:40 +08:00
|
|
|
STATICLIBS_DIR = ../../../cocos2dx/platform/third_party/linux/libraries
|
2012-08-02 13:02:59 +08:00
|
|
|
endif
|
|
|
|
STATICLIBS =
|
|
|
|
STATICLIBS = $(STATICLIBS_DIR)/libfreetype.a \
|
|
|
|
$(STATICLIBS_DIR)/libxml2.a \
|
|
|
|
$(STATICLIBS_DIR)/libpng.a \
|
|
|
|
$(STATICLIBS_DIR)/libjpeg.a \
|
|
|
|
$(STATICLIBS_DIR)/libtiff.a \
|
|
|
|
# $(STATICLIBS_DIR)/libGLEW.a \
|
|
|
|
|
2012-10-29 14:39:44 +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 += -lglfw -lGL
|
|
|
|
#SHAREDLIBS += -L../../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../../../lib/linux/Debug/
|
|
|
|
SHAREDLIBS += -Wl,-rpath,../../$(SHAREDLIBS_DIR)
|
|
|
|
#SHAREDLIBS += -Wl,-rpath,../../../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/lib
|
2012-08-02 13:19:40 +08:00
|
|
|
SHAREDLIBS += -L../../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/lib -lGLEW
|
2012-10-29 14:39:44 +08:00
|
|
|
SHAREDLIBS += -Wl,-rpath,../../../../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/lib
|
2012-08-02 13:02:59 +08:00
|
|
|
|
|
|
|
#$(shell ../../build-linux.sh $<)
|
2012-08-27 16:43:02 +08:00
|
|
|
|
2012-09-21 14:35:41 +08:00
|
|
|
BIN_DIR_ROOT=bin
|
|
|
|
BIN_DIR = $(BIN_DIR_ROOT)
|
|
|
|
|
|
|
|
debug: BIN_DIR = $(BIN_DIR_ROOT)/debug
|
|
|
|
debug: CCFLAGS += -g3 -O0
|
|
|
|
debug: CXXFLAGS += -g3 -O0
|
|
|
|
debug: SHAREDLIBS += -L../../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion
|
|
|
|
debug: SHAREDLIBS += -Wl,-rpath,../../../../../lib/linux/Debug/
|
2012-12-04 16:43:47 +08:00
|
|
|
debug: DEFINES += -DDEBUG -DCOCOS2D_DEBUG=1
|
2012-09-21 14:35:41 +08:00
|
|
|
debug: $(TARGET)
|
|
|
|
|
|
|
|
release: BIN_DIR = $(BIN_DIR_ROOT)/release
|
|
|
|
release: CCFLAGS += -O3
|
|
|
|
release: CXXFLAGS += -O3
|
|
|
|
release: SHAREDLIBS += -L../../../lib/linux/Release -lcocos2d -lrt -lz -lcocosdenshion
|
|
|
|
release: SHAREDLIBS += -Wl,-rpath,../../../../../lib/linux/Release/
|
|
|
|
release: DEFINES += -DNDEBUG
|
|
|
|
release: $(TARGET)
|
2012-08-27 16:43:02 +08:00
|
|
|
|
2012-08-02 13:02:59 +08:00
|
|
|
####### Build rules
|
|
|
|
$(TARGET): $(OBJECTS)
|
2012-09-21 14:35:41 +08:00
|
|
|
mkdir -p $(BIN_DIR)
|
2012-08-27 16:43:02 +08:00
|
|
|
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -o $(BIN_DIR)/$(TARGET) $(SHAREDLIBS) $(STATICLIBS)
|
2012-09-21 14:35:41 +08:00
|
|
|
|
2012-08-02 13:02:59 +08:00
|
|
|
####### Compile
|
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
|
2012-09-21 14:35:41 +08:00
|
|
|
|
2012-08-02 13:02:59 +08:00
|
|
|
clean:
|
|
|
|
rm -f $(OBJECTS) $(TARGET) core
|