axmol/samples/TestJavascript/proj.linux/Makefile

79 lines
2.5 KiB
Makefile
Raw Normal View History

2012-08-02 13:02:59 +08:00
CC = gcc
CXX = g++
TARGET = testjs
CCFLAGS = -Wall -g -O2
CXXFLAGS = -Wall -g -O2
VISIBILITY =
2012-08-02 13:19:40 +08:00
COCOS2DX_PATH = ../../../cocos2dx
JSBINDING_PATH=../../../scripting/javascript/bindings
2012-08-02 13:02:59 +08:00
INCLUDES = -I../ \
-I../Classes \
2012-08-02 13:19:40 +08:00
-I$(JSBINDING_PATH) \
-I$(JSBINDING_PATH)/../spidermonkey-linux/js-1.8.5/js/src \
-I../../../CocosDenshion/include \
2012-08-02 13:02:59 +08:00
-I$(COCOS2DX_PATH) \
-I$(COCOS2DX_PATH)/cocoa \
-I$(COCOS2DX_PATH)/include \
2012-08-02 16:23:31 +08:00
-I$(COCOS2DX_PATH)/platform \
-I$(COCOS2DX_PATH)/platform/linux \
2012-08-02 13:02:59 +08:00
-I$(COCOS2DX_PATH)/platform/third_party/linux \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libfreetype2 \
-I$(COCOS2DX_PATH)/platform/third_party/linux/glew-1.7.0/glew-1.7.0/include/ \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg \
2012-08-02 16:23:31 +08:00
-I$(COCOS2DX_PATH)/kazmath/include \
2012-08-02 13:02:59 +08:00
DEFINES = -DLINUX
OBJECTS = ./main.o \
2012-08-02 16:23:31 +08:00
../Classes/AppDelegate.o \
$(JSBINDING_PATH)/ScriptingCore.o \
2012-08-02 13:02:59 +08:00
$(JSBINDING_PATH)/cocos2d_generated.o \
$(JSBINDING_PATH)/cocos2d_manual_bindings.o \
$(JSBINDING_PATH)/cocos_denshion_generated.o \
2012-08-02 13:19:40 +08:00
# ../Classes/simple_class.o \
# ../Classes/simple_native_generated.o
2012-08-02 13:02:59 +08:00
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)/libtiff.a \
2012-08-02 13:19:40 +08:00
$(JSBINDING_PATH)/../spidermonkey-linux/js-1.8.5/js/src/libjs_static.a \
2012-08-02 13:02:59 +08:00
ifeq ($(LBITS),64)
2012-08-02 13:19:40 +08:00
SHAREDLIBS_DIR = ../../../CocosDenshion/third_party/fmod/lib64/api/lib
2012-08-02 13:02:59 +08:00
SHAREDLIBS = -L$(SHAREDLIBS_DIR) -lfmodex64
else
2012-08-02 13:19:40 +08:00
SHAREDLIBS_DIR = ../../../CocosDenshion/third_party/fmod/api/lib
2012-08-02 13:02:59 +08:00
SHAREDLIBS = -L$(SHAREDLIBS_DIR) -lfmodex
endif
2012-08-02 13:19:40 +08:00
SHAREDLIBS += -L../../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../../lib/linux/Debug/
2012-08-02 13:02:59 +08:00
SHAREDLIBS += -lglfw
#SHAREDLIBS += -lGLEW
SHAREDLIBS += -Wl,-rpath,$(SHAREDLIBS_DIR)
2012-08-02 13:19:40 +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
2012-08-02 13:02:59 +08:00
#$(shell ../../build-linux.sh $<)
####### Build rules
$(TARGET): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -o $(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