From 8677dad3c6f5f3e369f051771fd960bcb54af97b Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Sat, 2 Mar 2013 18:30:39 -0800 Subject: [PATCH 1/3] Improved build system from linux. This change makes several fundamental improvements to the linux build system: - Remove duplication: a lot of the common make logic is now in a central shared makefile: cocos2dx/proj.linux/cocos2dx.mk - Quiet by default: unless you specify V=1 on the commandline the output is now very clean and quiet. - Dependencies: gcc's automatic dependancy generation is now used (-MMD). This means that if you change a header file then all the object that depend on it now get rebuilt. - Don't store objects in the source tree: previously object files were stored alongside the sources, which meant that debug and release object clobbered each other which leads to confusion and lots of unnecessary rebuilding.Q - Library dependencies: each binary now depends on the libraries it links aginst. This means that if the cocos2dx library changes then all examples will get re-linked. - Top level Makefile: there is now a top level Makefile that can be shared/used by any platform the uses make as the build system (for example NaCl). Everything can be built by simply running 'make' at the top level. e.g: make DEBUG=1 make DEBUG=1 clean --- .gitignore | 4 +- CocosDenshion/proj.linux/Makefile | 74 ++---- Makefile | 22 ++ cocos2dx/proj.linux/Makefile | 318 ++++++++++------------- cocos2dx/proj.linux/cocos2dx.mk | 101 +++++++ extensions/proj.linux/Makefile | 151 +++++------ external/Box2D/proj.linux/Makefile | 134 +++++----- external/chipmunk/proj.linux/Makefile | 100 +++---- make-all-linux-project.sh | 135 ++-------- samples/Cpp/HelloCpp/proj.linux/Makefile | 104 ++------ samples/Cpp/TestCpp/proj.linux/Makefile | 305 +++++++++------------- samples/Lua/HelloLua/proj.linux/Makefile | 99 ++----- samples/Lua/TestLua/proj.linux/Makefile | 106 ++------ scripting/lua/proj.linux/Makefile | 146 ++++------- 14 files changed, 705 insertions(+), 1094 deletions(-) create mode 100644 Makefile create mode 100644 cocos2dx/proj.linux/cocos2dx.mk diff --git a/.gitignore b/.gitignore index d5ed79de08..46a5fc9052 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/CocosDenshion/proj.linux/Makefile b/CocosDenshion/proj.linux/Makefile index 928987a89e..080a86b670 100644 --- a/CocosDenshion/proj.linux/Makefile +++ b/CocosDenshion/proj.linux/Makefile @@ -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 $@ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..0e826214f9 --- /dev/null +++ b/Makefile @@ -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 diff --git a/cocos2dx/proj.linux/Makefile b/cocos2dx/proj.linux/Makefile index d741870c18..d8929ba28b 100644 --- a/cocos2dx/proj.linux/Makefile +++ b/cocos2dx/proj.linux/Makefile @@ -1,197 +1,159 @@ -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 $@ +$(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST) + @mkdir -p $(@D) + $(LOG_CC)$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ -clean: - rm -f $(OBJECTS) $(TARGET) core diff --git a/cocos2dx/proj.linux/cocos2dx.mk b/cocos2dx/proj.linux/cocos2dx.mk new file mode 100644 index 0000000000..455a9877d3 --- /dev/null +++ b/cocos2dx/proj.linux/cocos2dx.mk @@ -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 diff --git a/extensions/proj.linux/Makefile b/extensions/proj.linux/Makefile index 41a5618d61..40688cb67f 100644 --- a/extensions/proj.linux/Makefile +++ b/extensions/proj.linux/Makefile @@ -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 $@ diff --git a/external/Box2D/proj.linux/Makefile b/external/Box2D/proj.linux/Makefile index 536450aab9..1265d90303 100644 --- a/external/Box2D/proj.linux/Makefile +++ b/external/Box2D/proj.linux/Makefile @@ -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 $@ diff --git a/external/chipmunk/proj.linux/Makefile b/external/chipmunk/proj.linux/Makefile index 437e66cbc2..b0e5d1f572 100644 --- a/external/chipmunk/proj.linux/Makefile +++ b/external/chipmunk/proj.linux/Makefile @@ -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 $@ diff --git a/make-all-linux-project.sh b/make-all-linux-project.sh index c3056f4d46..f0e38be253 100755 --- a/make-all-linux-project.sh +++ b/make-all-linux-project.sh @@ -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 diff --git a/samples/Cpp/HelloCpp/proj.linux/Makefile b/samples/Cpp/HelloCpp/proj.linux/Makefile index 4d7abb855c..498439a7e0 100644 --- a/samples/Cpp/HelloCpp/proj.linux/Makefile +++ b/samples/Cpp/HelloCpp/proj.linux/Makefile @@ -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 $@ diff --git a/samples/Cpp/TestCpp/proj.linux/Makefile b/samples/Cpp/TestCpp/proj.linux/Makefile index 861ba46910..d7678cc539 100644 --- a/samples/Cpp/TestCpp/proj.linux/Makefile +++ b/samples/Cpp/TestCpp/proj.linux/Makefile @@ -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 $@ diff --git a/samples/Lua/HelloLua/proj.linux/Makefile b/samples/Lua/HelloLua/proj.linux/Makefile index f8d32f46b5..6e7a168d72 100644 --- a/samples/Lua/HelloLua/proj.linux/Makefile +++ b/samples/Lua/HelloLua/proj.linux/Makefile @@ -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 $@ diff --git a/samples/Lua/TestLua/proj.linux/Makefile b/samples/Lua/TestLua/proj.linux/Makefile index d0d10d7a2a..de4aaf7654 100644 --- a/samples/Lua/TestLua/proj.linux/Makefile +++ b/samples/Lua/TestLua/proj.linux/Makefile @@ -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 $@ diff --git a/scripting/lua/proj.linux/Makefile b/scripting/lua/proj.linux/Makefile index fef0df8872..4e06ca583e 100644 --- a/scripting/lua/proj.linux/Makefile +++ b/scripting/lua/proj.linux/Makefile @@ -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 $@ From 7ad171d8ee79ef9951d27d584f47f129660a457e Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 4 Mar 2013 10:19:50 -0800 Subject: [PATCH 2/3] Use same top level Makefile for nacl and linux builds. Also, re-use some of the concepts from the linux build system (such as quite by default) in the nacl build. Fix remaining warnings in NaCl builds. --- CocosDenshion/proj.nacl/Makefile | 23 ++----- build-nacl.sh | 43 ++----------- cocos2dx/proj.linux/Makefile | 1 - cocos2dx/proj.nacl/Makefile | 21 +++--- cocos2dx/proj.nacl/cocos2dx.mk | 27 ++++++-- extensions/proj.nacl/Makefile | 4 ++ external/Box2D/proj.nacl/Makefile | 18 ++---- external/chipmunk/proj.nacl/Makefile | 78 ++++++++++------------- samples/Cpp/HelloCpp/proj.nacl/Makefile | 27 ++------ samples/Cpp/SimpleGame/proj.nacl/Makefile | 21 ++---- samples/Cpp/TestCpp/proj.nacl/Makefile | 33 ++++------ samples/Cpp/TestCpp/proj.nacl/main.cpp | 4 +- samples/Lua/HelloLua/proj.nacl/Makefile | 19 ++---- samples/Lua/TestLua/proj.nacl/Makefile | 20 ++---- samples/Lua/TestLua/proj.nacl/main.cpp | 2 +- scripting/lua/proj.nacl/Makefile | 39 +++--------- 16 files changed, 128 insertions(+), 252 deletions(-) diff --git a/CocosDenshion/proj.nacl/Makefile b/CocosDenshion/proj.nacl/Makefile index edc7e4a62e..7988e4b5d2 100644 --- a/CocosDenshion/proj.nacl/Makefile +++ b/CocosDenshion/proj.nacl/Makefile @@ -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 $@ diff --git a/build-nacl.sh b/build-nacl.sh index f7dae2650a..c5fdeb2250 100755 --- a/build-nacl.sh +++ b/build-nacl.sh @@ -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 diff --git a/cocos2dx/proj.linux/Makefile b/cocos2dx/proj.linux/Makefile index d8929ba28b..c7b2352140 100644 --- a/cocos2dx/proj.linux/Makefile +++ b/cocos2dx/proj.linux/Makefile @@ -156,4 +156,3 @@ $(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) $(OBJ_DIR)/%.o: ../%.c $(CORE_MAKEFILE_LIST) @mkdir -p $(@D) $(LOG_CC)$(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@ - diff --git a/cocos2dx/proj.nacl/Makefile b/cocos2dx/proj.nacl/Makefile index 04cb968aed..a59a264802 100644 --- a/cocos2dx/proj.nacl/Makefile +++ b/cocos2dx/proj.nacl/Makefile @@ -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 $@ diff --git a/cocos2dx/proj.nacl/cocos2dx.mk b/cocos2dx/proj.nacl/cocos2dx.mk index a9f6881af7..bcdba69908 100644 --- a/cocos2dx/proj.nacl/cocos2dx.mk +++ b/cocos2dx/proj.nacl/cocos2dx.mk @@ -2,13 +2,15 @@ # 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 +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) @@ -87,3 +96,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 diff --git a/extensions/proj.nacl/Makefile b/extensions/proj.nacl/Makefile index d044f3ac4b..b0b56e6276 100644 --- a/extensions/proj.nacl/Makefile +++ b/extensions/proj.nacl/Makefile @@ -40,3 +40,7 @@ EXTENSIONS_SOURCES = ../CCBReader/CCBFileLoader.cpp \ ../GUI/CCControlExtension/CCControlStepper.cpp \ ../physics_nodes/CCPhysicsDebugNode.cpp \ ../physics_nodes/CCPhysicsSprite.cpp + +all: + +clean: diff --git a/external/Box2D/proj.nacl/Makefile b/external/Box2D/proj.nacl/Makefile index f9b20cb4e9..5e1502f9e9 100644 --- a/external/Box2D/proj.nacl/Makefile +++ b/external/Box2D/proj.nacl/Makefile @@ -64,22 +64,12 @@ include $(COCOS_ROOT)/cocos2dx/proj.nacl/cocos2dx.mk TARGET = $(LIB_DIR)/libbox2d.a -####### Build rules +all: $(TARGET) + $(TARGET): $(OBJECTS) @mkdir -p $(@D) - $(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS) + $(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS) -####### Compile $(OBJ_DIR)/%.o: ../%.cpp @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 $@ diff --git a/external/chipmunk/proj.nacl/Makefile b/external/chipmunk/proj.nacl/Makefile index 3ef390af96..22c4a93d07 100644 --- a/external/chipmunk/proj.nacl/Makefile +++ b/external/chipmunk/proj.nacl/Makefile @@ -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 $@ diff --git a/samples/Cpp/HelloCpp/proj.nacl/Makefile b/samples/Cpp/HelloCpp/proj.nacl/Makefile index 407d5d2b39..1f11c53653 100644 --- a/samples/Cpp/HelloCpp/proj.nacl/Makefile +++ b/samples/Cpp/HelloCpp/proj.nacl/Makefile @@ -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 diff --git a/samples/Cpp/SimpleGame/proj.nacl/Makefile b/samples/Cpp/SimpleGame/proj.nacl/Makefile index a94774229a..aa61e6bd57 100644 --- a/samples/Cpp/SimpleGame/proj.nacl/Makefile +++ b/samples/Cpp/SimpleGame/proj.nacl/Makefile @@ -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 diff --git a/samples/Cpp/TestCpp/proj.nacl/Makefile b/samples/Cpp/TestCpp/proj.nacl/Makefile index 25e8784f08..c06d5c65d9 100644 --- a/samples/Cpp/TestCpp/proj.nacl/Makefile +++ b/samples/Cpp/TestCpp/proj.nacl/Makefile @@ -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 diff --git a/samples/Cpp/TestCpp/proj.nacl/main.cpp b/samples/Cpp/TestCpp/proj.nacl/main.cpp index 771d0d356a..8c71805226 100644 --- a/samples/Cpp/TestCpp/proj.nacl/main.cpp +++ b/samples/Cpp/TestCpp/proj.nacl/main.cpp @@ -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", diff --git a/samples/Lua/HelloLua/proj.nacl/Makefile b/samples/Lua/HelloLua/proj.nacl/Makefile index f4eacf6ff2..ac67d2af41 100644 --- a/samples/Lua/HelloLua/proj.nacl/Makefile +++ b/samples/Lua/HelloLua/proj.nacl/Makefile @@ -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 diff --git a/samples/Lua/TestLua/proj.nacl/Makefile b/samples/Lua/TestLua/proj.nacl/Makefile index 9fe74fcf21..68ac972584 100644 --- a/samples/Lua/TestLua/proj.nacl/Makefile +++ b/samples/Lua/TestLua/proj.nacl/Makefile @@ -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 diff --git a/samples/Lua/TestLua/proj.nacl/main.cpp b/samples/Lua/TestLua/proj.nacl/main.cpp index 0daec1d666..da3cad3e64 100644 --- a/samples/Lua/TestLua/proj.nacl/main.cpp +++ b/samples/Lua/TestLua/proj.nacl/main.cpp @@ -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", diff --git a/scripting/lua/proj.nacl/Makefile b/scripting/lua/proj.nacl/Makefile index 8375bb1b5e..0245dba158 100644 --- a/scripting/lua/proj.nacl/Makefile +++ b/scripting/lua/proj.nacl/Makefile @@ -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 $@ From ce247a6304424da5c54b38b06deccf1580e18b7b Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 4 Mar 2013 14:37:20 -0800 Subject: [PATCH 3/3] [NaCl] Fix warnings in ARM build --- cocos2dx/proj.nacl/cocos2dx.mk | 12 +++++++++--- cocos2dx/support/zip_support/ioapi.cpp | 15 ++++++--------- external/Box2D/proj.nacl/Makefile | 21 +++++++++------------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cocos2dx/proj.nacl/cocos2dx.mk b/cocos2dx/proj.nacl/cocos2dx.mk index bcdba69908..4e827bd67a 100644 --- a/cocos2dx/proj.nacl/cocos2dx.mk +++ b/cocos2dx/proj.nacl/cocos2dx.mk @@ -9,9 +9,9 @@ NACL_ARCH ?= x86_64 NACL_AR ?= $(NACL_ARCH)-nacl-ar NACL_CC ?= $(NACL_ARCH)-nacl-gcc NACL_CXX ?= $(NACL_ARCH)-nacl-g++ -CCFLAGS ?= -Wall -Werror -CXXFLAGS ?= -Wall -Werror -ARFLAGS ?= cr +CCFLAGS += -Wall -Werror +CXXFLAGS += -Wall -Werror +ARFLAGS = cr THIS_MAKEFILE := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) @@ -78,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 diff --git a/cocos2dx/support/zip_support/ioapi.cpp b/cocos2dx/support/zip_support/ioapi.cpp index cea10d9b46..8992ab0878 100644 --- a/cocos2dx/support/zip_support/ioapi.cpp +++ b/cocos2dx/support/zip_support/ioapi.cpp @@ -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; } diff --git a/external/Box2D/proj.nacl/Makefile b/external/Box2D/proj.nacl/Makefile index 5e1502f9e9..d7365f4cad 100644 --- a/external/Box2D/proj.nacl/Makefile +++ b/external/Box2D/proj.nacl/Makefile @@ -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,14 +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 all: $(TARGET) -$(TARGET): $(OBJECTS) +$(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST) @mkdir -p $(@D) $(LOG_AR)$(NACL_AR) $(ARFLAGS) $(TARGET) $(OBJECTS) -$(OBJ_DIR)/%.o: ../%.cpp +$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) @mkdir -p $(@D) $(LOG_CXX)$(NACL_CXX) -MMD $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@