From 13afa85cb90a5835b9007f06b21502afb31258f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Thu, 1 Aug 2013 15:22:52 +0200 Subject: [PATCH] Refactored toplevel Makefile --- AUTHORS | 1 + Makefile | 85 +++++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 63 insertions(+), 23 deletions(-) diff --git a/AUTHORS b/AUTHORS index c28ceacf93..b740b5ed8a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -425,6 +425,7 @@ Developers: Added emscripten keyboard support Clang support for Linux Multiple emscripten template support. Emscripten multiple resolutions support. + Toplevel Makefile refactoring elmiro Correction of passed buffer size to readlink and verification of result return by readlink. diff --git a/Makefile b/Makefile index 7de904d739..fb820a5881 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,70 @@ PLATFORM ?= linux -define MAKE_TARGETS - +$(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/Cpp/SimpleGame/proj.$(PLATFORM) $@ -endef +all: + +chipmunk: + $(MAKE) -C external/chipmunk/proj.$(PLATFORM) +chipmunk-clean: + $(MAKE) -C external/chipmunk/proj.$(PLATFORM) clean + +box2d: + $(MAKE) -C external/Box2D/proj.$(PLATFORM) +box2d-clean: + $(MAKE) -C external/Box2D/proj.$(PLATFORM) clean + +libextensions: cocosdenshion chipmunk box2d + $(MAKE) -C extensions/proj.$(PLATFORM) +libextensions-clean: + $(MAKE) -C extensions/proj.$(PLATFORM) clean + +libcocos2dx: libextensions + $(MAKE) -C cocos2dx/proj.$(PLATFORM) +libcocos2dx-clean: + $(MAKE) -C cocos2dx/proj.$(PLATFORM) clean + +cocosdenshion: libcocos2dx + $(MAKE) -C CocosDenshion/proj.$(PLATFORM) +cocosdenshion-clean: + $(MAKE) -C CocosDenshion/proj.$(PLATFORM) clean + +lua: libextensions + $(MAKE) -C scripting/lua/proj.$(PLATFORM) +lua-clean: + $(MAKE) -C scripting/lua/proj.$(PLATFORM) clean + +hellocpp: libcocos2dx + $(MAKE) -C samples/Cpp/HelloCpp/proj.$(PLATFORM) +hellocpp-clean: + $(MAKE) -C samples/Cpp/HelloCpp/proj.$(PLATFORM) clean + +testcpp: libcocos2dx libextensions + $(MAKE) -C samples/Cpp/TestCpp/proj.$(PLATFORM) +testcpp-clean: + $(MAKE) -C samples/Cpp/TestCpp/proj.$(PLATFORM) clean + +simplegame: libcocos2dx + $(MAKE) -C samples/Cpp/SimpleGame/proj.$(PLATFORM) +simplegame-clean: + $(MAKE) -C samples/Cpp/SimpleGame/proj.$(PLATFORM) clean + +all: box2d cocosdenshion libextensions libcocos2dx lua hellocpp testcpp simplegame +clean: libcocos2dx-clean box2d-clean chipmunk-clean cocosdenshion-clean libextensions-clean lua-clean hellocpp-clean testcpp-clean simplegame-clean # Haven't yet got the lua projects working with emscripten ifneq ($(PLATFORM),emscripten) -define MAKE_LUA - +$(MAKE) -C samples/Lua/HelloLua/proj.$(PLATFORM) $@ - +$(MAKE) -C samples/Lua/TestLua/proj.$(PLATFORM) $@ -endef + +hellolua: libcocos2dx lua + $(MAKE) -C samples/Lua/HelloLua/proj.$(PLATFORM) +hellolua-clean: + $(MAKE) -C samples/Lua/HelloLua/proj.$(PLATFORM) clean + +testlua: libcocos2dx lua + $(MAKE) -C samples/Lua/TestLua/proj.$(PLATFORM) +testlua-clean: + $(MAKE) -C samples/Lua/TestLua/proj.$(PLATFORM) clean + +all: hellolua testlua +clean: hellolua-clean testlua-clean endif -all: - $(call MAKE_TARGETS,all) - $(call MAKE_LUA,all) - -clean: - $(call MAKE_TARGETS,clean) - $(call MAKE_LUA,clean) - .PHONY: all clean