2012-09-26 20:51:41 +08:00
|
|
|
CC = gcc
|
|
|
|
CXX = g++
|
|
|
|
TARGET = HelloLua
|
|
|
|
CCFLAGS = -Wall
|
|
|
|
CXXFLAGS = -Wall
|
|
|
|
VISIBILITY =
|
|
|
|
|
2012-12-20 17:47:30 +08:00
|
|
|
COCOS2DX_PATH = ../../../../cocos2dx
|
2012-09-26 20:51:41 +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 \
|
|
|
|
-I$(COCOS2DX_PATH)/platform/linux \
|
|
|
|
-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 \
|
2012-12-20 17:47:30 +08:00
|
|
|
-I../../../../CocosDenshion/include \
|
|
|
|
-I../../../../scripting/lua/lua \
|
|
|
|
-I../../../../scripting/lua/tolua \
|
|
|
|
-I../../../../scripting/lua/cocos2dx_support
|
2012-09-26 20:51:41 +08:00
|
|
|
|
|
|
|
DEFINES = -DLINUX
|
|
|
|
|
|
|
|
OBJECTS = ./main.o \
|
|
|
|
../Classes/AppDelegate.o \
|
2012-12-20 17:47:30 +08:00
|
|
|
../../../../scripting/lua/cocos2dx_support/CCLuaEngine.o \
|
|
|
|
../../../../scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.o \
|
|
|
|
../../../../scripting/lua/cocos2dx_support/LuaCocos2d.o \
|
|
|
|
../../../../scripting/lua/cocos2dx_support/tolua_fix.o
|
2012-09-26 20:51:41 +08:00
|
|
|
|
|
|
|
LBITS := $(shell getconf LONG_BIT)
|
|
|
|
ifeq ($(LBITS),64)
|
2012-12-20 17:47:30 +08:00
|
|
|
STATICLIBS_DIR = ../../../../cocos2dx/platform/third_party/linux/libraries/lib64
|
2012-09-26 20:51:41 +08:00
|
|
|
else
|
2012-12-20 17:47:30 +08:00
|
|
|
STATICLIBS_DIR = ../../../../cocos2dx/platform/third_party/linux/libraries
|
2012-09-26 20:51:41 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
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 \
|
|
|
|
|
|
|
|
SHAREDLIBS += -lglfw -lcurl -llua
|
2012-12-20 17:47:30 +08:00
|
|
|
SHAREDLIBS += -Wl,-rpath,../../../../../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/lib
|
|
|
|
SHAREDLIBS += -L../../../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/lib -lGLEW
|
|
|
|
SHAREDLIBS += -Wl,-rpath,../../../../../../lib/linux/Debug
|
2012-09-26 20:51:41 +08:00
|
|
|
|
|
|
|
ifeq ($(LBITS),64)
|
2012-12-20 17:47:30 +08:00
|
|
|
SHAREDLIBS += -L../../../../CocosDenshion/third_party/fmod/lib64/api/lib -lfmodex64 -Wl,-rpath,../../../../../../CocosDenshion/third_party/fmod/lib64/api/lib
|
2012-09-26 20:51:41 +08:00
|
|
|
else
|
2012-12-20 17:47:30 +08:00
|
|
|
SHAREDLIBS += -L../../../../CocosDenshion/third_party/fmod/api/lib -lfmodex -Wl,-rpath,../../../../../../CocosDenshion/third_party/fmod/api/lib
|
2012-09-26 20:51:41 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
#$(shell ../../build-linux.sh $<)
|
|
|
|
|
|
|
|
BIN_DIR_ROOT=bin
|
|
|
|
BIN_DIR = $(BIN_DIR_ROOT)
|
|
|
|
|
|
|
|
debug: BIN_DIR = $(BIN_DIR_ROOT)/debug
|
|
|
|
debug: CCFLAGS += -g3 -O0
|
|
|
|
debug: CXXFLAGS += -g3 -O0
|
2012-12-20 17:47:30 +08:00
|
|
|
debug: SHAREDLIBS += -L../../../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion
|
|
|
|
debug: SHAREDLIBS += -Wl,-rpath,../../../../../../lib/linux/Debug/
|
2012-09-26 20:51:41 +08:00
|
|
|
debug: DEFINES += -DDEBUG
|
|
|
|
debug: $(TARGET)
|
|
|
|
|
|
|
|
release: BIN_DIR = $(BIN_DIR_ROOT)/release
|
|
|
|
release: CCFLAGS += -O3
|
|
|
|
release: CXXFLAGS += -O3
|
2012-12-20 17:47:30 +08:00
|
|
|
release: SHAREDLIBS += -L../../../../lib/linux/Release -lcocos2d -lrt -lz -lcocosdenshion
|
|
|
|
release: SHAREDLIBS += -Wl,-rpath,../../../../../../lib/linux/Release/
|
2012-09-26 20:51:41 +08:00
|
|
|
release: DEFINES += -DNDEBUG
|
|
|
|
release: $(TARGET)
|
|
|
|
|
|
|
|
####### Build rules
|
|
|
|
$(TARGET): $(OBJECTS)
|
|
|
|
mkdir -p $(BIN_DIR)
|
|
|
|
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -o $(BIN_DIR)/$(TARGET) $(SHAREDLIBS) $(STATICLIBS)
|
|
|
|
|
|
|
|
####### 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
|