Merge pull request #2093 from sbc100/linux_build_system

Linux build system
This commit is contained in:
minggo 2013-03-06 19:09:49 -08:00
commit 44857e5137
30 changed files with 855 additions and 1368 deletions

4
.gitignore vendored
View File

@ -1,5 +1,6 @@
# Ignore thumbnails created by windows
Thumbs.db
# Ignore files build by Visual Studio
*.obj
*.exe
@ -38,9 +39,6 @@ gen/
assets/
local.properties
# Ignore files build by linux
*.o
# Ignore files built by NaCl
samples/Cpp/HelloCpp/proj.nacl/Resources/
samples/Cpp/TestCpp/proj.nacl/Resources/

View File

@ -1,69 +1,27 @@
CC = gcc
CXX = g++
TARGET = libcocosdenshion.so
CCFLAGS = -Wall -fPIC
CXXFLAGS = -Wall -fPIC
VISIBILITY =
TARGET = libcocosdenshion.so
COCOS2DX_PATH = ../../cocos2dx
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
INCLUDES = -I.. \
-I../include \
-I../third_party/fmod/lib64/api/inc
else
INCLUDES = -I.. \
-I../include \
-I../third_party/fmod/api/inc
endif
INCLUDES += -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)/kazmath/include \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg
DEFINES = -DLINUX
OBJECTS = ../linux/FmodAudioPlayer.o \
../linux/SimpleAudioEngine.o \
STATICLIBS =
INCLUDES += -I.. -I../include
ifeq ($(LBITS),64)
SHAREDLIBS_DIR = ../third_party/fmod/lib64/api/lib
SHAREDLIBS = -L$(SHAREDLIBS_DIR) -lfmodex64
INCLUDES += -I../third_party/fmod/lib64/api/inc
else
SHAREDLIBS_DIR = ../third_party/fmod/api/lib
SHAREDLIBS = -L$(SHAREDLIBS_DIR) -lfmodex
INCLUDES += -I../third_party/fmod/api/inc
endif
debug: CCFLAGS += -g3 -O0
debug: CXXFLAGS += -g3 -O0
debug: DEFINES += -DDEBUG
debug: $(TARGET)
SOURCES = ../linux/FmodAudioPlayer.cpp \
../linux/SimpleAudioEngine.cpp \
release: CCFLAGS += -O3
release: CXXFLAGS += -O3
release: DEFINES += -DNDEBUG
release: $(TARGET)
COCOS_ROOT = ../..
include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk
####### Build rules
$(TARGET): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -shared -o $(TARGET) $(SHAREDLIBS) $(STATICLIBS)
TARGET := $(LIB_DIR)/$(TARGET)
####### Compile
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
all: $(TARGET)
%.o: %.c
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $(TARGET) $(SHAREDLIBS) $(STATICLIBS)
clean:
rm -f $(OBJECTS) $(TARGET) core
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@

View File

@ -8,23 +8,12 @@ include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk
TARGET = $(LIB_DIR)/libcocosdenshion.a
####### Build rules
$(TARGET): $(OBJECTS)
all: $(TARGET)
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
$(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
####### Compile
$(OBJ_DIR)/%.o: ../%.cpp
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.c
@mkdir -p $(@D)
$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) $(DEPS) core
-include $(DEPS)
.PHONY: clean all
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@

22
Makefile Normal file
View File

@ -0,0 +1,22 @@
PLATFORM = linux
define MAKE_TARGET
+$(MAKE) -C external/chipmunk/proj.$(PLATFORM) $@
+$(MAKE) -C external/Box2D/proj.$(PLATFORM) $@
+$(MAKE) -C CocosDenshion/proj.$(PLATFORM) $@
+$(MAKE) -C extensions/proj.$(PLATFORM) $@
+$(MAKE) -C cocos2dx/proj.$(PLATFORM) $@
+$(MAKE) -C scripting/lua/proj.$(PLATFORM) $@
+$(MAKE) -C samples/Cpp/HelloCpp/proj.$(PLATFORM) $@
+$(MAKE) -C samples/Cpp/TestCpp/proj.$(PLATFORM) $@
+$(MAKE) -C samples/Lua/HelloLua/proj.$(PLATFORM) $@
+$(MAKE) -C samples/Lua/TestLua/proj.$(PLATFORM) $@
endef
all:
$(call MAKE_TARGET,all)
clean:
$(call MAKE_TARGET,clean)
.PHONY: all clean

View File

@ -18,7 +18,6 @@ if [ -z "$NACL_SDK_ROOT" ]; then
exit 1
fi
MAKEFLAGS=-j10
SCRIPT_DIR=$(dirname ${BASH_SOURCE})
OUTPUT_DEBUG=lib/nacl/Debug/
OUTPUT_RELEASE=lib/nacl/Release/
@ -31,45 +30,13 @@ cd $SCRIPT_DIR
mkdir -p $OUTPUT_DEBUG
mkdir -p $OUTPUT_RELEASE
clean()
{
make $MAKEFLAGS -C cocos2dx/proj.nacl $1 clean
make $MAKEFLAGS -C CocosDenshion/proj.nacl $1 clean
make $MAKEFLAGS -C external/chipmunk/proj.nacl $1 clean
make $MAKEFLAGS -C external/Box2D/proj.nacl $1 clean
make $MAKEFLAGS -C scripting/lua/proj.nacl $1 clean
make $MAKEFLAGS -C samples/Cpp/HelloCpp/proj.nacl $1 clean
make $MAKEFLAGS -C samples/Lua/HelloLua/proj.nacl $1 clean
make $MAKEFLAGS -C samples/Cpp/TestCpp/proj.nacl $1 clean
make $MAKEFLAGS -C samples/Lua/TestLua/proj.nacl $1 clean
make $MAKEFLAGS -C samples/Cpp/SimpleGame/proj.nacl $1 clean
}
export MAKEFLAGS="-j10 PLATFORM=nacl"
if [ "$1" = "clean" ]; then
clean DEBUG=1
clean DEBUG=0
make DEBUG=1 clean
make DEBUG=0 clean
exit 0
fi
make $MAKEFLAGS -C cocos2dx/proj.nacl DEBUG=1
make $MAKEFLAGS -C CocosDenshion/proj.nacl DEBUG=1
make $MAKEFLAGS -C external/chipmunk/proj.nacl DEBUG=1
make $MAKEFLAGS -C external/Box2D/proj.nacl DEBUG=1
make $MAKEFLAGS -C scripting/lua/proj.nacl DEBUG=1
make $MAKEFLAGS -C samples/Cpp/HelloCpp/proj.nacl DEBUG=1
make $MAKEFLAGS -C samples/Lua/HelloLua/proj.nacl DEBUG=1
make $MAKEFLAGS -C samples/Cpp/TestCpp/proj.nacl DEBUG=1
make $MAKEFLAGS -C samples/Lua/TestLua/proj.nacl DEBUG=1
make $MAKEFLAGS -C samples/Cpp/SimpleGame/proj.nacl DEBUG=1
make $MAKEFLAGS -C cocos2dx/proj.nacl DEBUG=0
make $MAKEFLAGS -C CocosDenshion/proj.nacl DEBUG=0
make $MAKEFLAGS -C external/chipmunk/proj.nacl DEBUG=0
make $MAKEFLAGS -C external/Box2D/proj.nacl DEBUG=0
make $MAKEFLAGS -C scripting/lua/proj.nacl DEBUG=0
make $MAKEFLAGS -C samples/Cpp/HelloCpp/proj.nacl DEBUG=0
make $MAKEFLAGS -C samples/Lua/HelloLua/proj.nacl DEBUG=0
make $MAKEFLAGS -C samples/Cpp/TestCpp/proj.nacl DEBUG=0
make $MAKEFLAGS -C samples/Lua/TestLua/proj.nacl DEBUG=0
make $MAKEFLAGS -C samples/Cpp/SimpleGame/proj.nacl DEBUG=0
make DEBUG=1 all
make DEBUG=0 all

View File

@ -1,197 +1,158 @@
CC = gcc
CXX = g++
TARGET = libcocos2d.so
CCFLAGS = -Wall -fPIC
CXXFLAGS = -Wall -fPIC
VISIBILITY =
TARGET = libcocos2d.so
LIBS =
INCLUDES = -I.. \
INCLUDES += \
-I../platform/third_party/linux/libfreetype2 \
-I../cocoa \
-I../include \
-I../kazmath/include \
-I../../extensions \
-I../../extensions/CCBReader \
-I../../extensions/GUI/CCControlExtension \
-I../../extensions/GUI/CCControlExtension \
-I../../external/chipmunk/include/chipmunk \
-I../../external/chipmunk/include/chipmunk \
-I../../extensions/network \
-I../platform/linux \
-I../platform/third_party/linux/libpng \
-I../platform/third_party/linux/libjpeg \
-I../platform/third_party/linux/libtiff/include \
-I../platform/third_party/linux/libwebp
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
DEFINES += -D__CC_PLATFORM_FILEUTILS_CPP__
DEFINES += -D__CC_PLATFORM_IMAGE_CPP__
DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION
OBJECTS = ../actions/CCAction.o \
../actions/CCActionCamera.o \
../actions/CCActionEase.o \
../actions/CCActionGrid.o \
../actions/CCActionGrid3D.o \
../actions/CCActionInstant.o \
../actions/CCActionInterval.o \
../actions/CCActionManager.o \
../actions/CCActionPageTurn3D.o \
../actions/CCActionProgressTimer.o \
../actions/CCActionTiledGrid.o \
../actions/CCActionCatmullRom.o \
../actions/CCActionTween.o \
../base_nodes/CCAtlasNode.o \
../base_nodes/CCNode.o \
../cocoa/CCAffineTransform.o \
../cocoa/CCAutoreleasePool.o \
../cocoa/CCGeometry.o \
../cocoa/CCNS.o \
../cocoa/CCObject.o \
../cocoa/CCSet.o \
../cocoa/CCZone.o \
../cocoa/CCArray.o \
../cocoa/CCDictionary.o \
../cocoa/CCString.o \
../draw_nodes/CCDrawingPrimitives.o \
../draw_nodes/CCDrawNode.o \
../effects/CCGrabber.o \
../effects/CCGrid.o \
../keypad_dispatcher/CCKeypadDelegate.o \
../keypad_dispatcher/CCKeypadDispatcher.o \
../label_nodes/CCLabelAtlas.o \
../label_nodes/CCLabelBMFont.o \
../label_nodes/CCLabelTTF.o \
../layers_scenes_transitions_nodes/CCLayer.o \
../layers_scenes_transitions_nodes/CCScene.o \
../layers_scenes_transitions_nodes/CCTransition.o \
../layers_scenes_transitions_nodes/CCTransitionPageTurn.o \
../layers_scenes_transitions_nodes/CCTransitionProgress.o \
../menu_nodes/CCMenu.o \
../menu_nodes/CCMenuItem.o \
../misc_nodes/CCMotionStreak.o \
../misc_nodes/CCProgressTimer.o \
../misc_nodes/CCClippingNode.o \
../misc_nodes/CCRenderTexture.o \
../particle_nodes/CCParticleExamples.o \
../particle_nodes/CCParticleSystem.o \
../particle_nodes/CCParticleSystemQuad.o \
../particle_nodes/CCParticleBatchNode.o \
../platform/CCSAXParser.o \
../platform/CCThread.o \
../platform/platform.o \
../platform/CCImageCommonWebp.o \
../platform/CCEGLViewProtocol.o \
../platform/CCFileUtils.o \
../platform/linux/CCStdC.o \
../platform/linux/CCFileUtilsLinux.o \
../platform/linux/CCCommon.o \
../platform/linux/CCApplication.o \
../platform/linux/CCEGLView.o \
../platform/linux/CCImage.o \
../platform/linux/CCDevice.o \
../script_support/CCScriptSupport.o \
../sprite_nodes/CCAnimation.o \
../sprite_nodes/CCAnimationCache.o \
../sprite_nodes/CCSprite.o \
../sprite_nodes/CCSpriteBatchNode.o \
../sprite_nodes/CCSpriteFrame.o \
../sprite_nodes/CCSpriteFrameCache.o \
../support/ccUTF8.o \
../support/CCPointExtension.o \
../support/CCProfiling.o \
../support/CCUserDefault.o \
../support/TransformUtils.o \
../support/base64.o \
../support/ccUtils.o \
../support/CCVertex.o \
../support/CCNotificationCenter.o \
../support/image_support/TGAlib.o \
../support/tinyxml2/tinyxml2.o \
../support/zip_support/ZipUtils.o \
../support/zip_support/ioapi.o \
../support/zip_support/unzip.o \
../support/data_support/ccCArray.o \
../text_input_node/CCIMEDispatcher.o \
../text_input_node/CCTextFieldTTF.o \
../textures/CCTexture2D.o \
../textures/CCTextureAtlas.o \
../textures/CCTextureCache.o \
../textures/CCTexturePVR.o \
../tilemap_parallax_nodes/CCParallaxNode.o \
../tilemap_parallax_nodes/CCTMXLayer.o \
../tilemap_parallax_nodes/CCTMXObjectGroup.o \
../tilemap_parallax_nodes/CCTMXTiledMap.o \
../tilemap_parallax_nodes/CCTMXXMLParser.o \
../tilemap_parallax_nodes/CCTileMapAtlas.o \
../touch_dispatcher/CCTouchDispatcher.o \
../touch_dispatcher/CCTouchHandler.o \
../touch_dispatcher/CCTouch.o \
../shaders/CCGLProgram.o \
../shaders/ccGLStateCache.o \
../shaders/CCShaderCache.o \
../shaders/ccShaders.o \
../kazmath/src/aabb.o \
../kazmath/src/plane.o \
../kazmath/src/vec2.o \
../kazmath/src/mat3.o \
../kazmath/src/quaternion.o \
../kazmath/src/vec3.o \
../kazmath/src/mat4.o \
../kazmath/src/ray2.o \
../kazmath/src/vec4.o \
../kazmath/src/neon_matrix_impl.o \
../kazmath/src/utility.o \
../kazmath/src/GL/mat4stack.o \
../kazmath/src/GL/matrix.o \
../CCCamera.o \
../CCConfiguration.o \
../CCDirector.o \
../CCScheduler.o \
../cocos2d.o
SOURCES = ../actions/CCAction.cpp \
../actions/CCActionCamera.cpp \
../actions/CCActionEase.cpp \
../actions/CCActionGrid.cpp \
../actions/CCActionGrid3D.cpp \
../actions/CCActionInstant.cpp \
../actions/CCActionInterval.cpp \
../actions/CCActionManager.cpp \
../actions/CCActionPageTurn3D.cpp \
../actions/CCActionProgressTimer.cpp \
../actions/CCActionTiledGrid.cpp \
../actions/CCActionCatmullRom.cpp \
../actions/CCActionTween.cpp \
../base_nodes/CCAtlasNode.cpp \
../base_nodes/CCNode.cpp \
../cocoa/CCAffineTransform.cpp \
../cocoa/CCAutoreleasePool.cpp \
../cocoa/CCGeometry.cpp \
../cocoa/CCNS.cpp \
../cocoa/CCObject.cpp \
../cocoa/CCSet.cpp \
../cocoa/CCZone.cpp \
../cocoa/CCArray.cpp \
../cocoa/CCDictionary.cpp \
../cocoa/CCString.cpp \
../draw_nodes/CCDrawingPrimitives.cpp \
../draw_nodes/CCDrawNode.cpp \
../effects/CCGrabber.cpp \
../effects/CCGrid.cpp \
../keypad_dispatcher/CCKeypadDelegate.cpp \
../keypad_dispatcher/CCKeypadDispatcher.cpp \
../label_nodes/CCLabelAtlas.cpp \
../label_nodes/CCLabelBMFont.cpp \
../label_nodes/CCLabelTTF.cpp \
../layers_scenes_transitions_nodes/CCLayer.cpp \
../layers_scenes_transitions_nodes/CCScene.cpp \
../layers_scenes_transitions_nodes/CCTransition.cpp \
../layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp \
../layers_scenes_transitions_nodes/CCTransitionProgress.cpp \
../menu_nodes/CCMenu.cpp \
../menu_nodes/CCMenuItem.cpp \
../misc_nodes/CCMotionStreak.cpp \
../misc_nodes/CCProgressTimer.cpp \
../misc_nodes/CCClippingNode.cpp \
../misc_nodes/CCRenderTexture.cpp \
../particle_nodes/CCParticleExamples.cpp \
../particle_nodes/CCParticleSystem.cpp \
../particle_nodes/CCParticleSystemQuad.cpp \
../particle_nodes/CCParticleBatchNode.cpp \
../platform/CCSAXParser.cpp \
../platform/CCThread.cpp \
../platform/platform.cpp \
../platform/CCImageCommonWebp.cpp \
../platform/CCEGLViewProtocol.cpp \
../platform/CCFileUtils.cpp \
../platform/linux/CCStdC.cpp \
../platform/linux/CCFileUtilsLinux.cpp \
../platform/linux/CCCommon.cpp \
../platform/linux/CCApplication.cpp \
../platform/linux/CCEGLView.cpp \
../platform/linux/CCImage.cpp \
../platform/linux/CCDevice.cpp \
../script_support/CCScriptSupport.cpp \
../sprite_nodes/CCAnimation.cpp \
../sprite_nodes/CCAnimationCache.cpp \
../sprite_nodes/CCSprite.cpp \
../sprite_nodes/CCSpriteBatchNode.cpp \
../sprite_nodes/CCSpriteFrame.cpp \
../sprite_nodes/CCSpriteFrameCache.cpp \
../support/ccUTF8.cpp \
../support/CCPointExtension.cpp \
../support/CCProfiling.cpp \
../support/CCUserDefault.cpp \
../support/TransformUtils.cpp \
../support/base64.cpp \
../support/ccUtils.cpp \
../support/CCVertex.cpp \
../support/CCNotificationCenter.cpp \
../support/image_support/TGAlib.cpp \
../support/tinyxml2/tinyxml2.cpp \
../support/zip_support/ZipUtils.cpp \
../support/zip_support/ioapi.cpp \
../support/zip_support/unzip.cpp \
../support/data_support/ccCArray.cpp \
../text_input_node/CCIMEDispatcher.cpp \
../text_input_node/CCTextFieldTTF.cpp \
../textures/CCTexture2D.cpp \
../textures/CCTextureAtlas.cpp \
../textures/CCTextureCache.cpp \
../textures/CCTexturePVR.cpp \
../tilemap_parallax_nodes/CCParallaxNode.cpp \
../tilemap_parallax_nodes/CCTMXLayer.cpp \
../tilemap_parallax_nodes/CCTMXObjectGroup.cpp \
../tilemap_parallax_nodes/CCTMXTiledMap.cpp \
../tilemap_parallax_nodes/CCTMXXMLParser.cpp \
../tilemap_parallax_nodes/CCTileMapAtlas.cpp \
../touch_dispatcher/CCTouchDispatcher.cpp \
../touch_dispatcher/CCTouchHandler.cpp \
../touch_dispatcher/CCTouch.cpp \
../shaders/CCGLProgram.cpp \
../shaders/ccGLStateCache.cpp \
../shaders/CCShaderCache.cpp \
../shaders/ccShaders.cpp \
../kazmath/src/aabb.c \
../kazmath/src/plane.c \
../kazmath/src/vec2.c \
../kazmath/src/mat3.c \
../kazmath/src/quaternion.c \
../kazmath/src/vec3.c \
../kazmath/src/mat4.c \
../kazmath/src/ray2.c \
../kazmath/src/vec4.c \
../kazmath/src/neon_matrix_impl.c \
../kazmath/src/utility.c \
../kazmath/src/GL/mat4stack.c \
../kazmath/src/GL/matrix.c \
../CCCamera.cpp \
../CCConfiguration.cpp \
../CCDirector.cpp \
../CCScheduler.cpp \
../cocos2d.cpp
COCOS_ROOT = ../..
ifeq ($(LBITS),64)
STATICLIBS_DIR = ../platform/third_party/linux/libraries/lib64
else
STATICLIBS_DIR = ../platform/third_party/linux/libraries
endif
STATICLIBS =
STATICLIBS = $(STATICLIBS_DIR)/libfreetype.a \
$(STATICLIBS_DIR)/libpng.a \
$(STATICLIBS_DIR)/libjpeg.a \
$(STATICLIBS_DIR)/libtiff.a \
$(STATICLIBS_DIR)/libwebp.a
include cocos2dx.mk
SHAREDLIBS = -lglfw -lcurl -lfontconfig -lGLEW
CXXFLAGS += -Wno-sequence-point
CCFLAGS += -Wno-sequence-point
debug: CCFLAGS += -g3 -O0
debug: CXXFLAGS += -g3 -O0
debug: DEFINES += -DDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1
debug: $(TARGET)
TARGET := $(LIB_DIR)/$(TARGET)
release: CCFLAGS += -O3
release: CXXFLAGS += -O3
release: DEFINES += -DNDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
release: $(TARGET)
all: $(TARGET)
####### Build rules
$(TARGET): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -shared -o $(TARGET) $(SHAREDLIBS) $(STATICLIBS) $(LIBS)
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS)
####### Compile
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
%.o: %.c
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) core
$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CC)$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@

View File

@ -0,0 +1,101 @@
all:
CC = gcc
CXX = g++
CCFLAGS += -MMD -Wall -Werror -fPIC
CXXFLAGS += -MMD -Wall -Werror -fPIC
ARFLAGS = cr
DEFINES += -DLINUX
THIS_MAKEFILE := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
ifndef COCOS_ROOT
COCOS_ROOT ?= $(realpath $(dir $(THIS_MAKEFILE))/../..)
else
RPATH_REL = ../..
endif
COCOS_SRC = $(COCOS_ROOT)/cocos2dx
OBJ_DIR ?= obj
LIB_DIR = $(COCOS_SRC)/lib/linux
BIN_DIR = bin
INCLUDES += \
-I$(COCOS_SRC) \
-I$(COCOS_SRC)/cocoa \
-I$(COCOS_SRC)/include \
-I$(COCOS_SRC)/kazmath/include \
-I$(COCOS_SRC)/platform/linux \
-I$(COCOS_SRC)/platform/third_party/linux/libpng \
-I$(COCOS_SRC)/platform/third_party/linux/libjpeg \
-I$(COCOS_SRC)/platform/third_party/linux/libtiff/include \
-I$(COCOS_SRC)/platform/third_party/linux/libwebp
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
INCLUDES += -I$(COCOS_SRC)/platform/third_party/linux/include64
else
INCLUDES += -I$(COCOS_SRC)/platform/third_party/linux
endif
ifeq ($(DEBUG), 1)
CCFLAGS += -g3 -O0
CXXFLAGS += -g3 -O0
DEFINES += -DDEBUG -DCOCOS2D_DEBUG=1
OBJ_DIR := $(OBJ_DIR)/debug
LIB_DIR := $(LIB_DIR)/debug
BIN_DIR := $(BIN_DIR)/debug
else
CCFLAGS += -O3
CXXFLAGS += -O3
DEFINES += -DNDEBUG
OBJ_DIR := $(OBJ_DIR)/release
LIB_DIR := $(LIB_DIR)/release
BIN_DIR := $(BIN_DIR)/release
endif
ifndef V
LOG_CC = @echo " CC $@";
LOG_CXX = @echo " CXX $@";
LOG_AR = @echo " AR $@";
LOG_LINK = @echo " LINK $@";
endif
OBJECTS := $(SOURCES:.cpp=.o)
OBJECTS := $(OBJECTS:.c=.o)
OBJECTS := $(subst ../,,$(OBJECTS))
OBJECTS := $(subst $(COCOS_ROOT)/,,$(OBJECTS))
OBJECTS := $(addprefix $(OBJ_DIR)/, $(OBJECTS))
DEPS = $(OBJECTS:.o=.d)
CORE_MAKEFILE_LIST := $(MAKEFILE_LIST)
-include $(DEPS)
ifeq ($(LBITS),64)
STATICLIBS_DIR = $(COCOS_SRC)/platform/third_party/linux/libraries/lib64
else
STATICLIBS_DIR = $(COCOS_SRC)/platform/third_party/linux/libraries
endif
STATICLIBS = $(STATICLIBS_DIR)/libfreetype.a \
$(STATICLIBS_DIR)/libpng.a \
$(STATICLIBS_DIR)/libjpeg.a \
$(STATICLIBS_DIR)/libtiff.a \
$(STATICLIBS_DIR)/libwebp.a
ifeq ($(LBITS),64)
FMOD_LIBDIR = $(COCOS_ROOT)/CocosDenshion/third_party/fmod/lib64/api/lib
SHAREDLIBS += -lfmodex64
else
FMOD_LIBDIR = $(COCOS_ROOT)/CocosDenshion/third_party/fmod/api/lib
SHAREDLIBS += -lfmodex
endif
SHAREDLIBS += -lglfw -lGLEW -lfontconfig
SHAREDLIBS += -L$(FMOD_LIBDIR) -Wl,-rpath,$(RPATH_REL)/$(FMOD_LIBDIR)
SHAREDLIBS += -L$(LIB_DIR) -Wl,-rpath,$(RPATH_REL)/$(LIB_DIR)
LIBS = -lrt -lz
clean:
rm -rf $(OBJ_DIR)
rm -f $(TARGET) core
.PHONY: all clean

View File

@ -133,27 +133,22 @@ SOURCES = ../actions/CCAction.cpp \
include cocos2dx.mk
CXXFLAGS += -Wno-sequence-point
TARGET = $(LIB_DIR)/libcocos2d.a
DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION
all: $(TARGET)
####### Build rules
$(TARGET): $(OBJECTS)
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_AR) $(ARFLAGS) $@ $^
$(LOG_AR)$(NACL_AR) $(ARFLAGS) $@ $(OBJECTS)
####### Compile
$(OBJ_DIR)/%.o: ../%.cpp
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.c
$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) $(DEPS) core
-include $(DEPS)
$(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@

View File

@ -2,14 +2,16 @@
# when building for Native Client. It defines a set of variables that all
# cocos2dx projects have in common.
all:
NACL_LIBC = newlib
NACL_ARCH ?= x86_64
NACL_AR ?= $(NACL_ARCH)-nacl-ar
NACL_CC ?= $(NACL_ARCH)-nacl-gcc
NACL_CXX ?= $(NACL_ARCH)-nacl-g++
CCFLAGS ?= -Wall
CXXFLAGS ?= -Wall
ARFLAGS ?= cr
CCFLAGS += -Wall -Werror
CXXFLAGS += -Wall -Werror
ARFLAGS = cr
THIS_MAKEFILE := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
@ -27,7 +29,7 @@ endif
NACLPORTS_ROOT ?= $(NACL_SDK_ROOT)/ports
NACLPORTS_INCLUDE ?= $(NACLPORTS_ROOT)/include
OUT_DIR ?= out
OUT_DIR ?= obj
OBJ_DIR ?= $(OUT_DIR)/$(NACL_ARCH)
LIB_DIR ?= $(COCOS_ROOT)/lib/nacl/$(ARCH_DIR)
@ -38,8 +40,8 @@ INCLUDES += -I$(COCOS_SRC) \
-I$(COCOS_SRC)/platform \
-I$(COCOS_SRC)/platform/nacl \
-I$(NACL_SDK_ROOT)/include \
-I$(NACLPORTS_INCLUDE) \
-I$(NACLPORTS_INCLUDE)/libxml2
-isystem $(NACLPORTS_INCLUDE) \
-isystem $(NACLPORTS_INCLUDE)/libxml2
ifeq ($(DEBUG), 1)
BIN_DIR = bin/debug
@ -59,6 +61,13 @@ MULTILIB_SUFFIX := $(ARCH_DIR)/Release
DEFINES += -DNDEBUG
endif
ifndef V
LOG_CC = @echo " CC $@";
LOG_CXX = @echo " CXX $@";
LOG_AR = @echo " AR $@";
LOG_LINK = @echo " LINK $@";
endif
# The default library search path consists of the cocos2dx library path, the
# main nacl sdk library path and the naclports library path.
LDFLAGS += -L$(LIB_DIR)
@ -69,6 +78,12 @@ LDFLAGS += -L$(NACLPORTS_ROOT)/lib/$(MULTILIB_SUFFIX)
CCFLAGS += -Wno-unknown-pragmas
CXXFLAGS += -Wno-unknown-pragmas
ifeq ($(NACL_ARCH),arm)
# Don't warn about mangling of 'va_list' on arm builds
CCFLAGS += -Wno-psabi
CXXFLAGS += -Wno-psabi
endif
ifdef NACL_MOUNTS
DEFINES += -DOLD_NACL_MOUNTS
STATICLIBS += -lnacl-mounts
@ -87,3 +102,11 @@ OBJECTS := $(subst ../,,$(OBJECTS))
OBJECTS := $(subst $(COCOS_ROOT)/,,$(OBJECTS))
OBJECTS := $(addprefix $(OBJ_DIR)/, $(OBJECTS))
DEPS = $(OBJECTS:.o=.d)
CORE_MAKEFILE_LIST := $(MAKEFILE_LIST)
-include $(DEPS)
clean:
rm -rf $(OBJ_DIR)
rm -f $(TARGET) core
.PHONY: all clean

View File

@ -148,7 +148,7 @@ static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
{
ZPOS64_T ret;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL)
ret = NULL;
ret = 0;
#else
ret = ftello64((FILE *)stream);
#endif
@ -180,8 +180,10 @@ static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offs
static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL)
return -1;
#else
int fseek_origin=0;
long ret;
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
@ -195,15 +197,10 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T
break;
default: return -1;
}
ret = 0;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL)
ret = -1;
#else
if(fseeko64((FILE *)stream, offset, fseek_origin) != 0)
ret = -1;
return -1;
return 0;
#endif
return ret;
}

View File

@ -1,100 +1,77 @@
CC = gcc
CXX = g++
AR = ar
TARGET = libextension.a
CCFLAGS = -Wall
CXXFLAGS = -Wall
ARFLAGS = cr
TARGET = libextension.a
COCOS2DX_ROOT=../..
COCOS_ROOT=../..
INCLUDES = -I$(COCOS2DX_ROOT)/cocos2dx \
-I$(COCOS2DX_ROOT)/cocos2dx/platform/third_party/linux/libfreetype2 \
-I$(COCOS2DX_ROOT)/cocos2dx/include \
-I$(COCOS2DX_ROOT)/cocos2dx/kazmath/include \
-I$(COCOS2DX_ROOT)/cocos2dx/platform/linux \
-I$(COCOS2DX_ROOT)/cocos2dx/platform/third_party/linux/libpng \
-I$(COCOS2DX_ROOT)/cocos2dx/platform/third_party/linux/libjpeg \
-I$(COCOS2DX_ROOT)/cocos2dx/platform/third_party/linux/libtiff/include \
-I$(COCOS2DX_ROOT)/cocos2dx/platform/third_party/linux/libwebp \
-I$(COCOS2DX_ROOT)/external \
-I$(COCOS2DX_ROOT)/external/chipmunk/include/chipmunk \
-I.. \
-I../CCBReader \
-I../GUI/CCControlExtension \
-I../network
INCLUDES = -I$(COCOS_ROOT)/external \
-I$(COCOS_ROOT)/external/chipmunk/include/chipmunk \
-I.. \
-I../CCBReader \
-I../GUI/CCControlExtension \
-I../network
DEFINES = -DLINUX
DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
DEFINES += -D__CC_PLATFORM_IMAGE_CPP__
OBJECTS = ../CCBReader/CCBFileLoader.o \
../CCBReader/CCMenuItemImageLoader.o \
../CCBReader/CCBReader.o \
../CCBReader/CCMenuItemLoader.o \
../CCBReader/CCControlButtonLoader.o \
../CCBReader/CCNodeLoader.o \
../CCBReader/CCControlLoader.o \
../CCBReader/CCNodeLoaderLibrary.o \
../CCBReader/CCLabelBMFontLoader.o \
../CCBReader/CCParticleSystemQuadLoader.o \
../CCBReader/CCLabelTTFLoader.o \
../CCBReader/CCScale9SpriteLoader.o \
../CCBReader/CCLayerColorLoader.o \
../CCBReader/CCScrollViewLoader.o \
../CCBReader/CCLayerGradientLoader.o \
../CCBReader/CCSpriteLoader.o \
../CCBReader/CCLayerLoader.o \
../CCBReader/CCBAnimationManager.o \
../CCBReader/CCBKeyframe.o \
../CCBReader/CCBSequence.o \
../CCBReader/CCBSequenceProperty.o \
../CCBReader/CCBValue.o \
../CCBReader/CCData.o \
../CCBReader/CCNode+CCBRelativePositioning.o \
../GUI/CCScrollView/CCScrollView.o \
../GUI/CCScrollView/CCSorting.o \
../GUI/CCScrollView/CCTableView.o \
../GUI/CCScrollView/CCTableViewCell.o \
../GUI/CCControlExtension/CCControlButton.o \
../GUI/CCControlExtension/CCControlColourPicker.o \
../GUI/CCControlExtension/CCControl.o \
../GUI/CCControlExtension/CCControlHuePicker.o \
../GUI/CCControlExtension/CCControlSaturationBrightnessPicker.o \
../GUI/CCControlExtension/CCControlSlider.o \
../GUI/CCControlExtension/CCControlSwitch.o \
../GUI/CCControlExtension/CCControlUtils.o \
../GUI/CCControlExtension/CCInvocation.o \
../GUI/CCControlExtension/CCScale9Sprite.o \
../GUI/CCControlExtension/CCControlPotentiometer.o \
../GUI/CCControlExtension/CCControlStepper.o \
../network/HttpClient.o \
../physics_nodes/CCPhysicsDebugNode.o \
../physics_nodes/CCPhysicsSprite.o
SOURCES = ../CCBReader/CCBFileLoader.cpp \
../CCBReader/CCMenuItemImageLoader.cpp \
../CCBReader/CCBReader.cpp \
../CCBReader/CCMenuItemLoader.cpp \
../CCBReader/CCControlButtonLoader.cpp \
../CCBReader/CCNodeLoader.cpp \
../CCBReader/CCControlLoader.cpp \
../CCBReader/CCNodeLoaderLibrary.cpp \
../CCBReader/CCLabelBMFontLoader.cpp \
../CCBReader/CCParticleSystemQuadLoader.cpp \
../CCBReader/CCLabelTTFLoader.cpp \
../CCBReader/CCScale9SpriteLoader.cpp \
../CCBReader/CCLayerColorLoader.cpp \
../CCBReader/CCScrollViewLoader.cpp \
../CCBReader/CCLayerGradientLoader.cpp \
../CCBReader/CCSpriteLoader.cpp \
../CCBReader/CCLayerLoader.cpp \
../CCBReader/CCBAnimationManager.cpp \
../CCBReader/CCBKeyframe.cpp \
../CCBReader/CCBSequence.cpp \
../CCBReader/CCBSequenceProperty.cpp \
../CCBReader/CCBValue.cpp \
../CCBReader/CCData.cpp \
../CCBReader/CCNode+CCBRelativePositioning.cpp \
../GUI/CCScrollView/CCScrollView.cpp \
../GUI/CCScrollView/CCSorting.cpp \
../GUI/CCScrollView/CCTableView.cpp \
../GUI/CCScrollView/CCTableViewCell.cpp \
../GUI/CCControlExtension/CCControlButton.cpp \
../GUI/CCControlExtension/CCControlColourPicker.cpp \
../GUI/CCControlExtension/CCControl.cpp \
../GUI/CCControlExtension/CCControlHuePicker.cpp \
../GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \
../GUI/CCControlExtension/CCControlSlider.cpp \
../GUI/CCControlExtension/CCControlSwitch.cpp \
../GUI/CCControlExtension/CCControlUtils.cpp \
../GUI/CCControlExtension/CCInvocation.cpp \
../GUI/CCControlExtension/CCScale9Sprite.cpp \
../GUI/CCControlExtension/CCControlPotentiometer.cpp \
../GUI/CCControlExtension/CCControlStepper.cpp \
../network/HttpClient.cpp \
../physics_nodes/CCPhysicsDebugNode.cpp \
../physics_nodes/CCPhysicsSprite.cpp
include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk
debug: CCFLAGS += -g3 -O0
debug: CXXFLAGS += -g3 -O0
debug: DEFINES += -DDEBUG
debug: $(TARGET)
CXXFLAGS += -Wno-multichar
release: CCFLAGS += -O3
release: CXXFLAGS += -O3
release: DEFINES += -DNDEBUG
release: $(TARGET)
TARGET := $(LIB_DIR)/$(TARGET)
####### Build rules
$(TARGET): $(OBJECTS)
$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
all: $(TARGET)
####### Compile
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
%.o: %.c
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) core
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_AR)$(AR) $(ARFLAGS) $@ $(OBJECTS)
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CC)$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@

View File

@ -40,3 +40,7 @@ EXTENSIONS_SOURCES = ../CCBReader/CCBFileLoader.cpp \
../GUI/CCControlExtension/CCControlStepper.cpp \
../physics_nodes/CCPhysicsDebugNode.cpp \
../physics_nodes/CCPhysicsSprite.cpp
all:
clean:

View File

@ -1,81 +1,71 @@
CC = gcc
CXX = g++
AR = ar
TARGET = libbox2d.a
CCFLAGS = -Wall
CXXFLAGS = -Wall
ARFLAGS = cr
TARGET = libbox2d.a
INCLUDES = -I../../
SOURCES = ../Collision/Shapes/b2ChainShape.cpp \
../Collision/Shapes/b2CircleShape.cpp \
../Collision/Shapes/b2EdgeShape.cpp \
../Collision/Shapes/b2PolygonShape.cpp \
../Collision/b2BroadPhase.cpp \
../Collision/b2CollideCircle.cpp \
../Collision/b2CollideEdge.cpp \
../Collision/b2CollidePolygon.cpp \
../Collision/b2Collision.cpp \
../Collision/b2Distance.cpp \
../Collision/b2DynamicTree.cpp \
../Collision/b2TimeOfImpact.cpp \
../Common/b2BlockAllocator.cpp \
../Common/b2Draw.cpp \
../Common/b2Math.cpp \
../Common/b2Settings.cpp \
../Common/b2StackAllocator.cpp \
../Common/b2Timer.cpp \
../Dynamics/Contacts/b2ChainAndCircleContact.cpp \
../Dynamics/Contacts/b2ChainAndPolygonContact.cpp \
../Dynamics/Contacts/b2CircleContact.cpp \
../Dynamics/Contacts/b2Contact.cpp \
../Dynamics/Contacts/b2ContactSolver.cpp \
../Dynamics/Contacts/b2EdgeAndCircleContact.cpp \
../Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \
../Dynamics/Contacts/b2PolygonAndCircleContact.cpp \
../Dynamics/Contacts/b2PolygonContact.cpp \
../Dynamics/Joints/b2DistanceJoint.cpp \
../Dynamics/Joints/b2FrictionJoint.cpp \
../Dynamics/Joints/b2GearJoint.cpp \
../Dynamics/Joints/b2Joint.cpp \
../Dynamics/Joints/b2MouseJoint.cpp \
../Dynamics/Joints/b2PrismaticJoint.cpp \
../Dynamics/Joints/b2PulleyJoint.cpp \
../Dynamics/Joints/b2RevoluteJoint.cpp \
../Dynamics/Joints/b2RopeJoint.cpp \
../Dynamics/Joints/b2WeldJoint.cpp \
../Dynamics/Joints/b2WheelJoint.cpp \
../Dynamics/b2Body.cpp \
../Dynamics/b2ContactManager.cpp \
../Dynamics/b2Fixture.cpp \
../Dynamics/b2Island.cpp \
../Dynamics/b2World.cpp \
../Dynamics/b2WorldCallbacks.cpp \
../Rope/b2Rope.cpp
DEFINES = -DLINUX
include ../../../cocos2dx/proj.linux/cocos2dx.mk
OBJECTS = ../Collision/Shapes/b2ChainShape.o \
../Collision/Shapes/b2CircleShape.o \
../Collision/Shapes/b2EdgeShape.o \
../Collision/Shapes/b2PolygonShape.o \
../Collision/b2BroadPhase.o \
../Collision/b2CollideCircle.o \
../Collision/b2CollideEdge.o \
../Collision/b2CollidePolygon.o \
../Collision/b2Collision.o \
../Collision/b2Distance.o \
../Collision/b2DynamicTree.o \
../Collision/b2TimeOfImpact.o \
../Common/b2BlockAllocator.o \
../Common/b2Draw.o \
../Common/b2Math.o \
../Common/b2Settings.o \
../Common/b2StackAllocator.o \
../Common/b2Timer.o \
../Dynamics/Contacts/b2ChainAndCircleContact.o \
../Dynamics/Contacts/b2ChainAndPolygonContact.o \
../Dynamics/Contacts/b2CircleContact.o \
../Dynamics/Contacts/b2Contact.o \
../Dynamics/Contacts/b2ContactSolver.o \
../Dynamics/Contacts/b2EdgeAndCircleContact.o \
../Dynamics/Contacts/b2EdgeAndPolygonContact.o \
../Dynamics/Contacts/b2PolygonAndCircleContact.o \
../Dynamics/Contacts/b2PolygonContact.o \
../Dynamics/Joints/b2DistanceJoint.o \
../Dynamics/Joints/b2FrictionJoint.o \
../Dynamics/Joints/b2GearJoint.o \
../Dynamics/Joints/b2Joint.o \
../Dynamics/Joints/b2MouseJoint.o \
../Dynamics/Joints/b2PrismaticJoint.o \
../Dynamics/Joints/b2PulleyJoint.o \
../Dynamics/Joints/b2RevoluteJoint.o \
../Dynamics/Joints/b2RopeJoint.o \
../Dynamics/Joints/b2WeldJoint.o \
../Dynamics/Joints/b2WheelJoint.o \
../Dynamics/b2Body.o \
../Dynamics/b2ContactManager.o \
../Dynamics/b2Fixture.o \
../Dynamics/b2Island.o \
../Dynamics/b2World.o \
../Dynamics/b2WorldCallbacks.o \
../Rope/b2Rope.o
INCLUDES = -I../..
debug: CCFLAGS += -g3 -O0
debug: CXXFLAGS += -g3 -O0
debug: DEFINES += -DDEBUG
debug: $(TARGET)
# Unfortunetly Box2D doesn't compiler cleanly without these
CXXFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-uninitialized
release: CCFLAGS += -O3
release: CXXFLAGS += -O3
release: DEFINES += -DNDEBUG
release: $(TARGET)
ifeq ($(DEBUG), 1)
DEFINES = -DDEBUG
endif
####### Build rules
$(TARGET): $(OBJECTS)
$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
TARGET := $(LIB_DIR)/$(TARGET)
####### Compile
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
all: $(TARGET)
%.o: %.c
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_AR)$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
clean:
rm -f $(OBJECTS) $(TARGET) core
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@

View File

@ -1,13 +1,3 @@
NACL_ARCH ?= x86_64
NACL_LIBC = newlib
NACL_AR ?= $(NACL_ARCH)-nacl-ar
NACL_CC ?= $(NACL_ARCH)-nacl-gcc
NACL_CXX ?= $(NACL_ARCH)-nacl-g++
CCFLAGS = -Wall -std=gnu99
CXXFLAGS = -Wall
VISIBILITY =
ARFLAGS = cr
LIBS =
INCLUDES = -I../..
@ -62,24 +52,21 @@ COCOS_ROOT = ../../../
include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk
ifeq ($(NACL_ARCH),arm)
# The arm compiler in nacl is more recent and more fussy than the X86 ones.
CXXFLAGS += -Wno-unused-but-set-variable -Wno-maybe-uninitialized
else
CXXFLAGS += -Wno-uninitialized
endif
TARGET = $(LIB_DIR)/libbox2d.a
####### Build rules
$(TARGET): $(OBJECTS)
all: $(TARGET)
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
$(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
####### Compile
$(OBJ_DIR)/%.o: ../%.cpp
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.c
@mkdir -p $(@D)
$(NALC_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)
rm -f $(TARGET) core
-include $(DEPS)
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@

View File

@ -1,65 +1,47 @@
CC = gcc
CXX = g++
AR = ar
TARGET = libchipmunk.a
CCFLAGS = -Wall -std=gnu99
CXXFLAGS = -Wall
ARFLAGS = cr
SOURCES = ../src/chipmunk.c \
../src/cpBody.c \
../src/cpSpace.c \
../src/cpSpatialIndex.c \
../src/cpArbiter.c \
../src/cpCollision.c \
../src/cpSpaceComponent.c \
../src/cpSweep1D.c \
../src/cpArray.c \
../src/cpHashSet.c \
../src/cpSpaceHash.c \
../src/cpVect.c \
../src/cpBB.c \
../src/cpPolyShape.c \
../src/cpSpaceQuery.c \
../src/cpBBTree.c \
../src/cpShape.c \
../src/cpSpaceStep.c \
../src/constraints/cpConstraint.c \
../src/constraints/cpPivotJoint.c \
../src/constraints/cpDampedRotarySpring.c \
../src/constraints/cpRatchetJoint.c \
../src/constraints/cpDampedSpring.c \
../src/constraints/cpRotaryLimitJoint.c \
../src/constraints/cpGearJoint.c \
../src/constraints/cpSimpleMotor.c \
../src/constraints/cpGrooveJoint.c \
../src/constraints/cpSlideJoint.c \
../src/constraints/cpPinJoint.c \
include ../../../cocos2dx/proj.linux/cocos2dx.mk
TARGET = $(LIB_DIR)/libchipmunk.a
INCLUDES = -I../include/chipmunk
DEFINES = -DLINUX
CCFLAGS += -std=gnu99
OBJECTS := $(subst src/,,$(OBJECTS))
OBJECTS = ../src/chipmunk.o \
../src/cpBody.o \
../src/cpSpace.o \
../src/cpSpatialIndex.o \
../src/cpArbiter.o \
../src/cpCollision.o \
../src/cpSpaceComponent.o \
../src/cpSweep1D.o \
../src/cpArray.o \
../src/cpHashSet.o \
../src/cpSpaceHash.o \
../src/cpVect.o \
../src/cpBB.o \
../src/cpPolyShape.o \
../src/cpSpaceQuery.o \
../src/cpBBTree.o \
../src/cpShape.o \
../src/cpSpaceStep.o \
../src/constraints/cpConstraint.o \
../src/constraints/cpPivotJoint.o \
../src/constraints/cpDampedRotarySpring.o \
../src/constraints/cpRatchetJoint.o \
../src/constraints/cpDampedSpring.o \
../src/constraints/cpRotaryLimitJoint.o \
../src/constraints/cpGearJoint.o \
../src/constraints/cpSimpleMotor.o \
../src/constraints/cpGrooveJoint.o \
../src/constraints/cpSlideJoint.o \
../src/constraints/cpPinJoint.o \
all: $(TARGET)
debug: CCFLAGS += -g3 -O0
debug: CXXFLAGS += -g3 -O0
debug: DEFINES += -DDEBUG
debug: $(TARGET)
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_AR)$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
release: CCFLAGS += -O3
release: CXXFLAGS += -O3
release: DEFINES += -DNDEBIG
release: $(TARGET)
####### Build rules
$(TARGET): $(OBJECTS)
$(AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
####### Compile
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
%.o: %.c
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) core
$(OBJ_DIR)/%.o: ../src/%.c $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CC)$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@

View File

@ -11,35 +11,35 @@ LIBS =
INCLUDES = -I../include/chipmunk
SOURCES = ../src/chipmunk.cpp \
../src/cpBody.cpp \
../src/cpSpace.cpp \
../src/cpSpatialIndex.cpp \
../src/cpArbiter.cpp \
../src/cpCollision.cpp \
../src/cpSpaceComponent.cpp \
../src/cpSweep1D.cpp \
../src/cpArray.cpp \
../src/cpHashSet.cpp \
../src/cpSpaceHash.cpp \
../src/cpVect.cpp \
../src/cpBB.cpp \
../src/cpPolyShape.cpp \
../src/cpSpaceQuery.cpp \
../src/cpBBTree.cpp \
../src/cpShape.cpp \
../src/cpSpaceStep.cpp \
../src/constraints/cpConstraint.cpp \
../src/constraints/cpPivotJoint.cpp \
../src/constraints/cpDampedRotarySpring.cpp \
../src/constraints/cpRatchetJoint.cpp \
../src/constraints/cpDampedSpring.cpp \
../src/constraints/cpRotaryLimitJoint.cpp \
../src/constraints/cpGearJoint.cpp \
../src/constraints/cpSimpleMotor.cpp \
../src/constraints/cpGrooveJoint.cpp \
../src/constraints/cpSlideJoint.cpp \
../src/constraints/cpPinJoint.cpp
SOURCES = ../src/chipmunk.c \
../src/cpBody.c \
../src/cpSpace.c \
../src/cpSpatialIndex.c \
../src/cpArbiter.c \
../src/cpCollision.c \
../src/cpSpaceComponent.c \
../src/cpSweep1D.c \
../src/cpArray.c \
../src/cpHashSet.c \
../src/cpSpaceHash.c \
../src/cpVect.c \
../src/cpBB.c \
../src/cpPolyShape.c \
../src/cpSpaceQuery.c \
../src/cpBBTree.c \
../src/cpShape.c \
../src/cpSpaceStep.c \
../src/constraints/cpConstraint.c \
../src/constraints/cpPivotJoint.c \
../src/constraints/cpDampedRotarySpring.c \
../src/constraints/cpRatchetJoint.c \
../src/constraints/cpDampedSpring.c \
../src/constraints/cpRotaryLimitJoint.c \
../src/constraints/cpGearJoint.c \
../src/constraints/cpSimpleMotor.c \
../src/constraints/cpGrooveJoint.c \
../src/constraints/cpSlideJoint.c \
../src/constraints/cpPinJoint.c
COCOS_ROOT = ../../..
@ -49,22 +49,10 @@ TARGET = $(LIB_DIR)/libchipmunk.a
all: $(TARGET)
####### Build rules
$(TARGET): $(OBJECTS)
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
$(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
####### Compile
$(OBJ_DIR)/%.o: ../%.cpp
$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.c
@mkdir -p $(@D)
$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)
rm -f $(TARGET) core
-include $(DEPS)
$(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@

View File

@ -1,19 +1,12 @@
#!/bin/bash
# Exit of first error.
set -e
TXTCOLOR_DEFAULT="\033[0;m"
TXTCOLOR_RED="\033[0;31m"
TXTCOLOR_GREEN="\033[0;32m"
COCOS2DX20_TRUNK=`pwd`
OUTPUT_DEBUG=$COCOS2DX20_TRUNK/lib/linux/Debug/
OUTPUT_RELEASE=$COCOS2DX20_TRUNK/lib/linux/Release/
check_make_result()
{
if [ 0 != $? ]; then
exit 1
fi
}
COCOS2DX_ROOT=`pwd`
DEPENDS='libx11-dev'
DEPENDS+=' libxmu-dev'
@ -26,117 +19,23 @@ DEPENDS+=' libzip-dev'
DEPENDS+=' libcurl4-gnutls-dev'
DEPENDS+=' libfontconfig1-dev'
DEPENDS+=' libsqlite3-dev'
DEPENDS+=' libglew-dev'
DEPENDS+=' libglew*-dev'
for i in $DEPENDS; do
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed")
echo Checking for $i: $PKG_OK
if [ "" == "$PKG_OK" ]; then
echo -e $TXTCOLOR_GREEN"No $i. Setting up $i, please enter your password:"$TXTCOLOR_DEFAULT
sudo apt-get --force-yes --yes install $i
fi
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed")
echo Checking for $i: $PKG_OK
if [ "" == "$PKG_OK" ]; then
echo -e $TXTCOLOR_GREEN"No $i. Setting up $i, please enter your password:"$TXTCOLOR_DEFAULT
sudo apt-get --force-yes --yes install $i
fi
done
mkdir -p $OUTPUT_DEBUG
mkdir -p $OUTPUT_RELEASE
cd $COCOS2DX_ROOT
make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux clean
make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux debug
check_make_result
cp $COCOS2DX20_TRUNK/external/Box2D/proj.linux/libbox2d.a $OUTPUT_DEBUG
rm $COCOS2DX20_TRUNK/external/Box2D/proj.linux/libbox2d.a
export MAKEFLAGS=-j10
make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux clean
make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux release
check_make_result
cp $COCOS2DX20_TRUNK/external/Box2D/proj.linux/libbox2d.a $OUTPUT_RELEASE
rm $COCOS2DX20_TRUNK/external/Box2D/proj.linux/libbox2d.a
make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux clean
make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux debug
check_make_result
cp $COCOS2DX20_TRUNK/external/chipmunk/proj.linux/libchipmunk.a $OUTPUT_DEBUG
rm $COCOS2DX20_TRUNK/external/chipmunk/proj.linux/libchipmunk.a
make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux clean
make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux release
check_make_result
cp $COCOS2DX20_TRUNK/external/chipmunk/proj.linux/libchipmunk.a $OUTPUT_RELEASE
rm $COCOS2DX20_TRUNK/external/chipmunk/proj.linux/libchipmunk.a
make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux clean
make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux debug
check_make_result
cp $COCOS2DX20_TRUNK/cocos2dx/proj.linux/libcocos2d.so $OUTPUT_DEBUG
rm $COCOS2DX20_TRUNK/cocos2dx/proj.linux/libcocos2d.so
make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux clean
make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux release
check_make_result
cp $COCOS2DX20_TRUNK/cocos2dx/proj.linux/libcocos2d.so $OUTPUT_RELEASE
rm $COCOS2DX20_TRUNK/cocos2dx/proj.linux/libcocos2d.so
make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux clean
make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux debug
check_make_result
cp $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so $OUTPUT_DEBUG
rm $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so
make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux clean
make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux release
check_make_result
cp $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so $OUTPUT_RELEASE
rm $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so
make -C $COCOS2DX20_TRUNK/extensions/proj.linux clean
make -C $COCOS2DX20_TRUNK/extensions/proj.linux debug
check_make_result
cp $COCOS2DX20_TRUNK/extensions/proj.linux/libextension.a $OUTPUT_DEBUG
rm $COCOS2DX20_TRUNK/extensions/proj.linux/libextension.a
make -C $COCOS2DX20_TRUNK/extensions/proj.linux clean
make -C $COCOS2DX20_TRUNK/extensions/proj.linux release
check_make_result
cp $COCOS2DX20_TRUNK/extensions/proj.linux/libextension.a $OUTPUT_RELEASE
rm $COCOS2DX20_TRUNK/extensions/proj.linux/libextension.a
make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux clean
make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux debug
check_make_result
cp $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so $OUTPUT_DEBUG
rm $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so
make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux clean
make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux release
check_make_result
cp $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so $OUTPUT_RELEASE
rm $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so
make -C $COCOS2DX20_TRUNK/samples/Cpp/TestCpp/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/Cpp/TestCpp/proj.linux debug
check_make_result
make -C $COCOS2DX20_TRUNK/samples/Cpp/TestCpp/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/Cpp/TestCpp/proj.linux release
check_make_result
make -C $COCOS2DX20_TRUNK/samples/Cpp/HelloCpp/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/Cpp/HelloCpp/proj.linux debug
check_make_result
make -C $COCOS2DX20_TRUNK/samples/Cpp/HelloCpp/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/Cpp/HelloCpp/proj.linux release
check_make_result
make -C $COCOS2DX20_TRUNK/samples/Lua/TestLua/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/Lua/TestLua/proj.linux debug
check_make_result
make -C $COCOS2DX20_TRUNK/samples/Lua/TestLua/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/Lua/TestLua/proj.linux release
check_make_result
make -C $COCOS2DX20_TRUNK/samples/Lua/HelloLua/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/Lua/HelloLua/proj.linux debug
check_make_result
make -C $COCOS2DX20_TRUNK/samples/Lua/HelloLua/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/Lua/HelloLua/proj.linux release
check_make_result
make PROJECT=linux DEBUG=1 clean
make PROJECT=linux DEBUG=0 clean
make PROJECT=linux DEBUG=1 all
make PROJECT=linux DEBUG=0 all

View File

@ -1,93 +1,29 @@
CC = gcc
CXX = g++
TARGET = HelloCpp
CCFLAGS = -Wall
CXXFLAGS = -Wall
VISIBILITY =
TARGET = HelloCpp
COCOS2DX_PATH = ../../../../cocos2dx
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)/kazmath/include \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg
INCLUDES = -I.. -I../Classes
SOURCES = main.cpp \
../Classes/AppDelegate.cpp \
../Classes/HelloWorldScene.cpp
DEFINES = -DLINUX
COCOS_ROOT = ../../../..
include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk
OBJECTS = ./main.o \
../Classes/AppDelegate.o \
../Classes/HelloWorldScene.o
SHAREDLIBS += -lcocos2d
COCOS_LIBS = $(LIB_DIR)/libcocos2d.so
LBITS := $(shell getconf LONG_BIT)
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)/libxml2.a \
$(STATICLIBS_DIR)/libpng.a \
$(STATICLIBS_DIR)/libjpeg.a \
$(STATICLIBS_DIR)/libtiff.a \
# $(STATICLIBS_DIR)/libGLEW.a \
TARGET := $(BIN_DIR)/$(TARGET)
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
all: $(TARGET)
SHAREDLIBS += -lglfw
#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
SHAREDLIBS += -L../../../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/lib -lGLEW
SHAREDLIBS += -Wl,-rpath,../../../../../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/lib
$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
#$(shell ../../build-linux.sh $<)
$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
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/
debug: DEFINES += -DDEBUG -DCOCOS2D_DEBUG=1
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)
####### 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
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@

View File

@ -14,28 +14,17 @@ NMF = $(BIN_DIR)/$(APP_NAME).nmf
all: $(NMF)
####### Build rules
$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a
$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
$(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
####### Compile
$(OBJ_DIR)/%.o: ../%.cpp
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: %.cpp
$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.c
@mkdir -p $(@D)
$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)
rm -f $(TARGET) core
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(NMF): $(TARGET)
$(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe --objdump=i686-nacl-objdump -L$(NACL_SDK_ROOT)/toolchain/linux_x86_newlib/x86_64-nacl/lib/ -s $(BIN_DIR)
@ -44,6 +33,4 @@ run: all
/bin/cp -ar ../Resources/ .
$(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check
-include $(DEPS)
.PHONY: run clean all
.PHONY: run

View File

@ -20,28 +20,17 @@ NMF = $(BIN_DIR)/$(APP_NAME).nmf
all: $(NMF)
####### Build rules
$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a
@mkdir -p $(@D)
$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
$(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
####### Compile
$(OBJ_DIR)/%.o: ../%.cpp
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: %.cpp
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.c
@mkdir -p $(@D)
$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)
rm -f $(TARGET) core
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(NMF): $(TARGET)
$(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe --objdump=i686-nacl-objdump -L$(NACL_SDK_ROOT)/toolchain/linux_x86_newlib/x86_64-nacl/lib/ -s $(BIN_DIR)
@ -50,6 +39,4 @@ run: all
/bin/cp -ar ../Resources/ .
$(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check
-include $(DEPS)
.PHONY: run clean all
.PHONY: run

View File

@ -1,196 +1,133 @@
CC = gcc
CXX = g++
TARGET = TestCpp
CCFLAGS = -Wall
CXXFLAGS = -Wall
VISIBILITY =
LIBS =
TARGET = TestCpp
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
SOURCES = ../Classes/AccelerometerTest/AccelerometerTest.cpp \
../Classes/ActionManagerTest/ActionManagerTest.cpp \
../Classes/ActionsEaseTest/ActionsEaseTest.cpp \
../Classes/ActionsProgressTest/ActionsProgressTest.cpp \
../Classes/ActionsTest/ActionsTest.cpp \
../Classes/Box2DTest/Box2dTest.cpp \
../Classes/Box2DTestBed/Box2dView.cpp \
../Classes/Box2DTestBed/GLES-Render.cpp \
../Classes/Box2DTestBed/Test.cpp \
../Classes/Box2DTestBed/TestEntries.cpp \
../Classes/BugsTest/Bug-1159.cpp \
../Classes/BugsTest/Bug-1174.cpp \
../Classes/BugsTest/Bug-350.cpp \
../Classes/BugsTest/Bug-422.cpp \
../Classes/BugsTest/Bug-458/Bug-458.cpp \
../Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \
../Classes/BugsTest/Bug-624.cpp \
../Classes/BugsTest/Bug-886.cpp \
../Classes/BugsTest/Bug-899.cpp \
../Classes/BugsTest/Bug-914.cpp \
../Classes/BugsTest/BugsTest.cpp \
../Classes/ChipmunkTest/ChipmunkTest.cpp \
../Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \
../Classes/ClippingNodeTest/ClippingNodeTest.cpp \
../Classes/CocosDenshionTest/CocosDenshionTest.cpp \
../Classes/CurlTest/CurlTest.cpp \
../Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \
../Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \
../Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \
../Classes/EffectsTest/EffectsTest.cpp \
../Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \
../Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \
../Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \
../Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \
../Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \
../Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \
../Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \
../Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \
../Classes/ExtensionsTest/ExtensionsTest.cpp \
../Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \
../Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \
../Classes/FontTest/FontTest.cpp \
../Classes/IntervalTest/IntervalTest.cpp \
../Classes/KeypadTest/KeypadTest.cpp \
../Classes/LabelTest/LabelTest.cpp \
../Classes/LayerTest/LayerTest.cpp \
../Classes/MenuTest/MenuTest.cpp \
../Classes/MotionStreakTest/MotionStreakTest.cpp \
../Classes/MutiTouchTest/MutiTouchTest.cpp \
../Classes/NodeTest/NodeTest.cpp \
../Classes/ParallaxTest/ParallaxTest.cpp \
../Classes/ParticleTest/ParticleTest.cpp \
../Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \
../Classes/PerformanceTest/PerformanceParticleTest.cpp \
../Classes/PerformanceTest/PerformanceSpriteTest.cpp \
../Classes/PerformanceTest/PerformanceTest.cpp \
../Classes/PerformanceTest/PerformanceTextureTest.cpp \
../Classes/PerformanceTest/PerformanceTouchesTest.cpp \
../Classes/RenderTextureTest/RenderTextureTest.cpp \
../Classes/RotateWorldTest/RotateWorldTest.cpp \
../Classes/SceneTest/SceneTest.cpp \
../Classes/SchedulerTest/SchedulerTest.cpp \
../Classes/ShaderTest/ShaderTest.cpp \
../Classes/SpriteTest/SpriteTest.cpp \
../Classes/TextInputTest/TextInputTest.cpp \
../Classes/Texture2dTest/Texture2dTest.cpp \
../Classes/TextureCacheTest/TextureCacheTest.cpp \
../Classes/TileMapTest/TileMapTest.cpp \
../Classes/TouchesTest/Ball.cpp \
../Classes/TouchesTest/Paddle.cpp \
../Classes/TouchesTest/TouchesTest.cpp \
../Classes/TransitionsTest/TransitionsTest.cpp \
../Classes/UserDefaultTest/UserDefaultTest.cpp \
../Classes/ZwoptexTest/ZwoptexTest.cpp \
../Classes/FileUtilsTest/FileUtilsTest.cpp \
../Classes/controller.cpp \
../Classes/testBasic.cpp \
../Classes/AppDelegate.cpp \
../Classes/VisibleRect.cpp \
main.cpp
SHAREDLIBS = -lcocos2d -lcocosdenshion
COCOS_LIBS = $(LIB_DIR)/libcocos2d.so $(LIB_DIR)/libcocosdenshion.so
include ../../../../cocos2dx/proj.linux/cocos2dx.mk
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
INCLUDES += -I../ \
-I../../ \
-I../Classes \
-I$(COCOS_ROOT)/CocosDenshion/include \
-I$(COCOS_ROOT)/extensions/ \
-I$(COCOS_ROOT)/external/ \
-I$(COCOS_ROOT)/external/chipmunk/include/chipmunk
STATICLIBS += \
$(STATICLIBS_DIR)/libcurl.a \
$(LIB_DIR)/libextension.a \
$(LIB_DIR)/libbox2d.a \
$(LIB_DIR)/libchipmunk.a
#CCFLAGS += -fno-tree-scev-cprop
#CXXFLAGS = -fno-tree-scev-cprop
DEFINES += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
DEFINES = -DLINUX
#DEFINES += -D__LP64__
OBJECTS = ../Classes/AccelerometerTest/AccelerometerTest.o \
../Classes/ActionManagerTest/ActionManagerTest.o \
../Classes/ActionsEaseTest/ActionsEaseTest.o \
../Classes/ActionsProgressTest/ActionsProgressTest.o \
../Classes/ActionsTest/ActionsTest.o \
../Classes/Box2DTest/Box2dTest.o \
../Classes/Box2DTestBed/Box2dView.o \
../Classes/Box2DTestBed/GLES-Render.o \
../Classes/Box2DTestBed/Test.o \
../Classes/Box2DTestBed/TestEntries.o \
../Classes/BugsTest/Bug-1159.o \
../Classes/BugsTest/Bug-1174.o \
../Classes/BugsTest/Bug-350.o \
../Classes/BugsTest/Bug-422.o \
../Classes/BugsTest/Bug-458/Bug-458.o \
../Classes/BugsTest/Bug-458/QuestionContainerSprite.o \
../Classes/BugsTest/Bug-624.o \
../Classes/BugsTest/Bug-886.o \
../Classes/BugsTest/Bug-899.o \
../Classes/BugsTest/Bug-914.o \
../Classes/BugsTest/BugsTest.o \
../Classes/ChipmunkTest/ChipmunkTest.o \
../Classes/ClickAndMoveTest/ClickAndMoveTest.o \
../Classes/ClippingNodeTest/ClippingNodeTest.o \
../Classes/CocosDenshionTest/CocosDenshionTest.o \
../Classes/CurlTest/CurlTest.o \
../Classes/CurrentLanguageTest/CurrentLanguageTest.o \
../Classes/DrawPrimitivesTest/DrawPrimitivesTest.o \
../Classes/EffectsAdvancedTest/EffectsAdvancedTest.o \
../Classes/EffectsTest/EffectsTest.o \
../Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.o \
../Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.o \
../Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.o \
../Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.o \
../Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.o \
../Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.o \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.o \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.o \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.o \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.o \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.o \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.o \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.o \
../Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.o \
../Classes/ExtensionsTest/TableViewTest/TableViewTestScene.o \
../Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.o \
../Classes/ExtensionsTest/ExtensionsTest.o \
../Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.o \
../Classes/ExtensionsTest/NetworkTest/HttpClientTest.o \
../Classes/FontTest/FontTest.o \
../Classes/IntervalTest/IntervalTest.o \
../Classes/KeypadTest/KeypadTest.o \
../Classes/LabelTest/LabelTest.o \
../Classes/LayerTest/LayerTest.o \
../Classes/MenuTest/MenuTest.o \
../Classes/MotionStreakTest/MotionStreakTest.o \
../Classes/MutiTouchTest/MutiTouchTest.o \
../Classes/NodeTest/NodeTest.o \
../Classes/ParallaxTest/ParallaxTest.o \
../Classes/ParticleTest/ParticleTest.o \
../Classes/PerformanceTest/PerformanceNodeChildrenTest.o \
../Classes/PerformanceTest/PerformanceParticleTest.o \
../Classes/PerformanceTest/PerformanceSpriteTest.o \
../Classes/PerformanceTest/PerformanceTest.o \
../Classes/PerformanceTest/PerformanceTextureTest.o \
../Classes/PerformanceTest/PerformanceTouchesTest.o \
../Classes/RenderTextureTest/RenderTextureTest.o \
../Classes/RotateWorldTest/RotateWorldTest.o \
../Classes/SceneTest/SceneTest.o \
../Classes/SchedulerTest/SchedulerTest.o \
../Classes/ShaderTest/ShaderTest.o \
../Classes/SpriteTest/SpriteTest.o \
../Classes/TextInputTest/TextInputTest.o \
../Classes/Texture2dTest/Texture2dTest.o \
../Classes/TextureCacheTest/TextureCacheTest.o \
../Classes/TileMapTest/TileMapTest.o \
../Classes/TouchesTest/Ball.o \
../Classes/TouchesTest/Paddle.o \
../Classes/TouchesTest/TouchesTest.o \
../Classes/TransitionsTest/TransitionsTest.o \
../Classes/UserDefaultTest/UserDefaultTest.o \
../Classes/ZwoptexTest/ZwoptexTest.o \
../Classes/FileUtilsTest/FileUtilsTest.o \
../Classes/controller.o \
../Classes/testBasic.o \
../Classes/AppDelegate.o \
../Classes/VisibleRect.o \
./main.o
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 \
../../../../lib/linux/Debug/libextension.a \
../../../../lib/linux/Debug/libbox2d.a \
../../../../lib/linux/Debug/libchipmunk.a
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 -lGLEW
SHAREDLIBS += -Wl,-rpath,../../$(SHAREDLIBS_DIR)
SHAREDLIBS += -Wl,-rpath,../$(STATICLIBS_DIR)
SHAREDLIBS += -lcurl
BIN_DIR_ROOT=bin
BIN_DIR = BIN_DIR_ROOT
debug: SHAREDLIBS += -L../../../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../../../../../lib/linux/Debug
debug: CCFLAGS += -g3 -O0
debug: CXXFLAGS += -g3 -O0
debug: DEFINES += -DDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1
debug: BIN_DIR = $(BIN_DIR_ROOT)/debug
debug: $(TARGET)
release: SHAREDLIBS += -L../../../../lib/linux/Release -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../../../../../lib/linux/Release
release: CCFLAGS += -O3
release: CXXFLAGS += -O3
release: DEFINES += -DNDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
release: BIN_DIR = $(BIN_DIR_ROOT)/release
release: $(TARGET)
TARGET := $(BIN_DIR)/$(TARGET)
all: $(TARGET)
####### Build rules
$(TARGET): $(OBJECTS)
mkdir -p $(BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -o $(BIN_DIR)/$(TARGET) $(SHAREDLIBS) $(STATICLIBS) $(LIBS)
$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS)
####### Compile
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
%.o: %.c
$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) core
$(OBJ_DIR)/%.o: %.c $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CC)$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@

View File

@ -101,6 +101,8 @@ SOURCES += $(addprefix $(COCOS_ROOT)/extensions/, $(EXTENSIONS_SOURCES))
include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk
CXXFLAGS += -Wno-multichar
SHAREDLIBS += -lchipmunk -lbox2d
APP_NAME = TestCpp
@ -109,32 +111,25 @@ NMF = $(BIN_DIR)/$(APP_NAME).nmf
all: $(NMF)
####### Build rules
$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a $(LIB_DIR)/libcocosdenshion.a
$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a $(LIB_DIR)/libcocosdenshion.a $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
$(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
####### Compile
$(OBJ_DIR)/%.o: ../%.cpp
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: ../../../../%.cpp
$(OBJ_DIR)/%.o: ../../../../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: %.cpp
$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.c
$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -rf $(OUT_DIR)
rm -f $(TARGET) core
$(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(NMF): $(TARGET)
$(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe --objdump=i686-nacl-objdump -L$(NACL_SDK_ROOT)/toolchain/linux_x86_newlib/x86_64-nacl/lib/ -s $(BIN_DIR)
@ -156,6 +151,4 @@ run: all
/bin/cp -ar ../Resources/ .
$(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check
-include $(DEPS)
.PHONY: run clean zipfile package
.PHONY: run zipfile package

View File

@ -62,11 +62,13 @@ void* cocos_main(void* arg)
const char* dirnames[] = { "Images", "extensions", "fonts", "ccb",
"zwoptex", "Particles", "Shaders", "TileMaps" };
for (int i = 0; i < sizeof(dirnames)/sizeof(char*); i++)
for (size_t i = 0; i < sizeof(dirnames)/sizeof(char*); i++)
mkdir(dirnames[i], S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
const char* filenames[] = { "Images/grossini.png",
"Images/close.png",
"Images/ball.png",
"Images/paddle.png",
"Images/grossinis_sister1.png",
"Images/grossinis_sister2.png",
"Images/grossini_dance_01.png",

View File

@ -1,88 +1,31 @@
CC = gcc
CXX = g++
TARGET = HelloLua
CCFLAGS = -Wall
CXXFLAGS = -Wall
VISIBILITY =
TARGET = HelloLua
COCOS2DX_PATH = ../../../../cocos2dx
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)/kazmath/include \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg \
-I../../../../CocosDenshion/include \
-I../../../../scripting/lua/lua \
-I../../../../scripting/lua/tolua \
-I../../../../scripting/lua/cocos2dx_support
COCOS_ROOT = ../../../..
INCLUDES = -I../ -I../Classes -I$(COCOS_ROOT)/CocosDenshion/include \
-I$(COCOS_ROOT)/scripting/lua/lua \
-I$(COCOS_ROOT)/scripting/lua/tolua \
-I$(COCOS_ROOT)/scripting/lua/cocos2dx_support
DEFINES = -DLINUX
SOURCES = main.cpp ../Classes/AppDelegate.cpp
OBJECTS = ./main.o \
../Classes/AppDelegate.o
SHAREDLIBS += -lcocos2d -lcocosdenshion -llua
COCOS_LIBS = $(LIB_DIR)/libcocos2d.so $(LIB_DIR)/libcocosdenshion.so $(LIB_DIR)/liblua.so
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
STATICLIBS_DIR = ../../../../cocos2dx/platform/third_party/linux/libraries/lib64
else
STATICLIBS_DIR = ../../../../cocos2dx/platform/third_party/linux/libraries
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 \
include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk
SHAREDLIBS += -lglfw -lcurl -llua -lGLEW
SHAREDLIBS += -Wl,-rpath,../../../../../../lib/linux/Debug
TARGET := $(BIN_DIR)/$(TARGET)
ifeq ($(LBITS),64)
SHAREDLIBS += -L../../../../CocosDenshion/third_party/fmod/lib64/api/lib -lfmodex64 -Wl,-rpath,../../../../../../CocosDenshion/third_party/fmod/lib64/api/lib
else
SHAREDLIBS += -L../../../../CocosDenshion/third_party/fmod/api/lib -lfmodex -Wl,-rpath,../../../../../../CocosDenshion/third_party/fmod/api/lib
endif
all: $(TARGET)
#$(shell ../../build-linux.sh $<)
$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS)
BIN_DIR_ROOT=bin
BIN_DIR = $(BIN_DIR_ROOT)
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
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/
debug: DEFINES += -DDEBUG
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)
####### 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
$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@

View File

@ -26,30 +26,25 @@ NMF = $(BIN_DIR)/$(APP_NAME).nmf
all: $(NMF)
####### Build rules
$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a
@mkdir -p $(@D)
$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
$(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
####### Compile
$(OBJ_DIR)/%.o: ../%.cpp
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: %.cpp
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: $(COCOS_ROOT)/%.cpp
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: $(COCOS_ROOT)/%.c
@mkdir -p $(@D)
$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) $(DEPS) core
$(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(NMF): $(TARGET)
$(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe --objdump=i686-nacl-objdump -L$(NACL_SDK_ROOT)/toolchain/linux_x86_newlib/x86_64-nacl/lib/ -s $(BIN_DIR)
@ -57,7 +52,3 @@ $(NMF): $(TARGET)
run: all
/bin/cp -ar ../Resources/ .
$(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check
-include $(DEPS)
.PHONY: run clean run

View File

@ -1,93 +1,31 @@
CC = gcc
CXX = g++
TARGET = TestLua
CCFLAGS = -Wall
CXXFLAGS = -Wall
VISIBILITY =
TARGET = TestLua
COCOS2DX_PATH = ../../../../cocos2dx
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)/kazmath/include \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg \
-I../../../../CocosDenshion/include \
-I../../../../scripting/lua/lua \
-I../../../../scripting/lua/tolua \
-I../../../../scripting/lua/cocos2dx_support
COCOS_ROOT = ../../../..
INCLUDES = -I../ -I../Classes -I$(COCOS_ROOT)/CocosDenshion/include \
-I$(COCOS_ROOT)/scripting/lua/lua \
-I$(COCOS_ROOT)/scripting/lua/tolua \
-I$(COCOS_ROOT)/scripting/lua/cocos2dx_support
SOURCES = main.cpp ../Classes/AppDelegate.cpp
DEFINES = -DLINUX
SHAREDLIBS += -lcocos2d -lcocosdenshion -llua
COCOS_LIBS = $(LIB_DIR)/libcocos2d.so $(LIB_DIR)/libcocosdenshion.so $(LIB_DIR)/liblua.so
OBJECTS = ./main.o \
../Classes/AppDelegate.o
include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
STATICLIBS_DIR = ../../../../cocos2dx/platform/third_party/linux/libraries/lib64
else
STATICLIBS_DIR = ../../../../cocos2dx/platform/third_party/linux/libraries
endif
TARGET := $(BIN_DIR)/$(TARGET)
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 \
../../../../lib/linux/Debug/libextension.a \
../../../../lib/linux/Debug/libbox2d.a \
../../../../lib/linux/Debug/libchipmunk.a
all: $(TARGET)
SHAREDLIBS += -lglfw -lcurl -llua -lGLEW
SHAREDLIBS += -Wl,-rpath,../../../../../../lib/linux/Debug
$(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
cp -R -n ../../../../samples/Cpp/TestCpp/Resources ../../../../samples/Lua/TestLua
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS)
ifeq ($(LBITS),64)
SHAREDLIBS += -L../../../../CocosDenshion/third_party/fmod/lib64/api/lib -lfmodex64 -Wl,-rpath,../../../../../../CocosDenshion/third_party/fmod/lib64/api/lib
else
SHAREDLIBS += -L../../../../CocosDenshion/third_party/fmod/api/lib -lfmodex -Wl,-rpath,../../../../../../CocosDenshion/third_party/fmod/api/lib
endif
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
#$(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
debug: SHAREDLIBS += -L../../../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion
debug: SHAREDLIBS += -Wl,-rpath,../../../../../../lib/linux/Debug/
debug: DEFINES += -DDEBUG
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)
####### Build rules
$(TARGET): $(OBJECTS)
mkdir -p $(BIN_DIR)
cp -R -n ../../../../samples/Cpp/TestCpp/Resources ../../../../samples/Lua/TestLua
$(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
$(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@

View File

@ -28,31 +28,25 @@ NMF = $(BIN_DIR)/$(APP_NAME).nmf
all: $(NMF)
####### Build rules
$(TARGET): $(OBJECTS) $(LIB_DIR)/libcocos2d.a
@mkdir -p $(@D)
$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
$(LOG_LINK)$(NACL_CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS)
####### Compile
$(OBJ_DIR)/%.o: %.cpp
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: ../%.cpp
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: $(COCOS_ROOT)/%.cpp
@mkdir -p $(@D)
$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(OBJ_DIR)/%.o: $(COCOS_ROOT)/%.c
@mkdir -p $(@D)
$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) $(DEPS) core
$(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
$(NMF): $(TARGET)
$(NACL_SDK_ROOT)/tools/create_nmf.py -o $@ $(BIN_DIR)/*.nexe --objdump=i686-nacl-objdump -L$(NACL_SDK_ROOT)/toolchain/linux_x86_newlib/x86_64-nacl/lib/ -s $(BIN_DIR)
@ -60,7 +54,3 @@ $(NMF): $(TARGET)
run: all
/bin/cp -ar ../Resources/ .
$(NACL_SDK_ROOT)/tools/httpd.py --no_dir_check
-include $(DEPS)
.PHONY: run clean run

View File

@ -63,7 +63,7 @@ void* cocos_main(void* arg)
"zwoptex", "Particles", "Shaders", "luaScript",
"luaScript/ActionsTest" };
for (int i = 0; i < sizeof(dirnames)/sizeof(char*); i++)
for (size_t i = 0; i < sizeof(dirnames)/sizeof(char*); i++)
mkdir(dirnames[i], S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
const char* filenames[] = { "Images/grossini.png",

View File

@ -1,97 +1,65 @@
CC = gcc
CXX = g++
TARGET = liblua.so
CCFLAGS = -Wall -fPIC
CXXFLAGS = -Wall -fPIC
VISIBILITY =
TARGET = liblua.so
LBITS := $(shell getconf LONG_BIT)
INCLUDES = -I../lua \
-I../tolua \
INCLUDES += -I.. -I../lua -I../tolua \
-I../Classes -I../../../CocosDenshion/include
COCOS2DX_PATH = ../../../cocos2dx
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/linux \
-I$(COCOS2DX_PATH)/kazmath/include \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg \
-I../../../CocosDenshion/include
SOURCES = ../lua/lapi.o \
../lua/lauxlib.c \
../lua/lbaselib.c \
../lua/lcode.c \
../lua/ldblib.c \
../lua/ldebug.c \
../lua/ldo.c \
../lua/ldump.c \
../lua/lfunc.c \
../lua/lgc.c \
../lua/linit.c \
../lua/liolib.c \
../lua/llex.c \
../lua/lmathlib.c \
../lua/lmem.c \
../lua/loadlib.c \
../lua/lobject.c \
../lua/lopcodes.c \
../lua/loslib.c \
../lua/lparser.c \
../lua/lstate.c \
../lua/lstring.c \
../lua/lstrlib.c \
../lua/ltable.c \
../lua/ltablib.c \
../lua/ltm.c \
../lua/lundump.c \
../lua/lvm.c \
../lua/lzio.c \
../lua/print.c \
../tolua/tolua_event.c \
../tolua/tolua_is.c \
../tolua/tolua_map.c \
../tolua/tolua_push.c \
../tolua/tolua_to.c \
../cocos2dx_support/tolua_fix.c \
../cocos2dx_support/CCLuaBridge.cpp \
../cocos2dx_support/CCLuaEngine.cpp \
../cocos2dx_support/CCLuaStack.cpp \
../cocos2dx_support/CCLuaValue.cpp \
../cocos2dx_support/Cocos2dxLuaLoader.cpp \
../cocos2dx_support/LuaCocos2d.cpp
include ../../../cocos2dx/proj.linux/cocos2dx.mk
DEFINES = -DLINUX
TARGET := $(LIB_DIR)/$(TARGET)
OBJECTS = ../lua/lapi.o \
../lua/lauxlib.o \
../lua/lbaselib.o \
../lua/lcode.o \
../lua/ldblib.o \
../lua/ldebug.o \
../lua/ldo.o \
../lua/ldump.o \
../lua/lfunc.o \
../lua/lgc.o \
../lua/linit.o \
../lua/liolib.o \
../lua/llex.o \
../lua/lmathlib.o \
../lua/lmem.o \
../lua/loadlib.o \
../lua/lobject.o \
../lua/lopcodes.o \
../lua/loslib.o \
../lua/lparser.o \
../lua/lstate.o \
../lua/lstring.o \
../lua/lstrlib.o \
../lua/ltable.o \
../lua/ltablib.o \
../lua/ltm.o \
../lua/lua.o \
../lua/lundump.o \
../lua/lvm.o \
../lua/lzio.o \
../lua/print.o \
../tolua/tolua_event.o \
../tolua/tolua_is.o \
../tolua/tolua_map.o \
../tolua/tolua_push.o \
../tolua/tolua_to.o \
../cocos2dx_support/tolua_fix.o \
../cocos2dx_support/CCLuaBridge.o \
../cocos2dx_support/CCLuaEngine.o \
../cocos2dx_support/CCLuaStack.o \
../cocos2dx_support/CCLuaValue.o \
../cocos2dx_support/Cocos2dxLuaLoader.o \
../cocos2dx_support/LuaCocos2d.o
all: $(TARGET)
STATICLIBS =
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $@ $(SHAREDLIBS) $(STATICLIBS)
debug: CCFLAGS += -g3 -O0
debug: CXXFLAGS += -g3 -O0
debug: DEFINES += -DDEBUG
debug: $(TARGET)
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
release: CCFLAGS += -O3
release: CXXFLAGS += -O3
release: DEFINES += -DNDEBUG
release: $(TARGET)
####### Build rules
$(TARGET): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -shared -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
$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(LOG_CC)$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@

View File

@ -1,22 +1,5 @@
NACL_ARCH ?= x86_64
NACL_LIBC = newlib
NACL_AR ?= $(NACL_ARCH)-nacl-ar
NACL_CC ?= $(NACL_ARCH)-nacl-gcc
NACL_CXX ?= $(NACL_ARCH)-nacl-g++
CCFLAGS = -Wall
CXXFLAGS = -Wall
VISIBILITY =
ARFLAGS = cr
LIBS =
INCLUDES = -I.. -I../lua
NACLPORTS_INCLUDE ?= $(NACL_SDK_ROOT)/toolchain/linux_x86_$(NACL_LIBC)/$(NACL_ARCH)-nacl/usr/include
INCLUDES += -I$(NACL_SDK_ROOT)/include
INCLUDES += -I$(NACLPORTS_INCLUDE)
SOURCES = ../lua/lapi.c \
../lua/lauxlib.c \
../lua/lbaselib.c \
@ -43,7 +26,6 @@ SOURCES = ../lua/lapi.c \
../lua/ltable.c \
../lua/ltablib.c \
../lua/ltm.c \
../lua/lua.c \
../lua/lundump.c \
../lua/lvm.c \
../lua/lzio.c \
@ -58,19 +40,14 @@ COCOS_ROOT = ../../..
include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk
TARGET = $(LIB_DIR)/liblua.a
CCFLAGS = -Wno-uninitialized
####### Build rules
$(TARGET): $(OBJECTS)
$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
TARGET = $(LIB_DIR)/liblua.a
all: $(TARGET)
####### Compile
$(OBJ_DIR)/%.o: ../%.c
$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
$(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS)
$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST)
@mkdir -p $(@D)
$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)
rm -f $(TARGET) core
-include $(DEPS)
$(LOG_CC)$(NACL_CC) -MMD $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@