Refactored toplevel Makefile

This commit is contained in:
Éloi Rivard 2013-08-01 15:22:52 +02:00
parent 40332299d1
commit 13afa85cb9
2 changed files with 63 additions and 23 deletions

View File

@ -425,6 +425,7 @@ Developers:
Added emscripten keyboard support Added emscripten keyboard support
Clang support for Linux Clang support for Linux
Multiple emscripten template support. Emscripten multiple resolutions support. Multiple emscripten template support. Emscripten multiple resolutions support.
Toplevel Makefile refactoring
elmiro elmiro
Correction of passed buffer size to readlink and verification of result return by readlink. Correction of passed buffer size to readlink and verification of result return by readlink.

View File

@ -1,31 +1,70 @@
PLATFORM ?= linux PLATFORM ?= linux
define MAKE_TARGETS all:
+$(MAKE) -C external/chipmunk/proj.$(PLATFORM) $@
+$(MAKE) -C external/Box2D/proj.$(PLATFORM) $@ chipmunk:
+$(MAKE) -C CocosDenshion/proj.$(PLATFORM) $@ $(MAKE) -C external/chipmunk/proj.$(PLATFORM)
+$(MAKE) -C extensions/proj.$(PLATFORM) $@ chipmunk-clean:
+$(MAKE) -C cocos2dx/proj.$(PLATFORM) $@ $(MAKE) -C external/chipmunk/proj.$(PLATFORM) clean
+$(MAKE) -C scripting/lua/proj.$(PLATFORM) $@
+$(MAKE) -C samples/Cpp/HelloCpp/proj.$(PLATFORM) $@ box2d:
+$(MAKE) -C samples/Cpp/TestCpp/proj.$(PLATFORM) $@ $(MAKE) -C external/Box2D/proj.$(PLATFORM)
+$(MAKE) -C samples/Cpp/SimpleGame/proj.$(PLATFORM) $@ box2d-clean:
endef $(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 # Haven't yet got the lua projects working with emscripten
ifneq ($(PLATFORM),emscripten) ifneq ($(PLATFORM),emscripten)
define MAKE_LUA
+$(MAKE) -C samples/Lua/HelloLua/proj.$(PLATFORM) $@ hellolua: libcocos2dx lua
+$(MAKE) -C samples/Lua/TestLua/proj.$(PLATFORM) $@ $(MAKE) -C samples/Lua/HelloLua/proj.$(PLATFORM)
endef 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 endif
all:
$(call MAKE_TARGETS,all)
$(call MAKE_LUA,all)
clean:
$(call MAKE_TARGETS,clean)
$(call MAKE_LUA,clean)
.PHONY: all clean .PHONY: all clean