From 825dda9d93448ba783e18f7947eef0b4eb07942e Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 10 Jan 2016 16:58:28 +0800 Subject: [PATCH] fix makefile deps for core --- core/src/makefile | 5 +++-- core/src/xmake/makefile | 4 ---- core/suffix.mak | 35 ++++++++++++++++++++++++++++++++--- install | 1 - 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/core/src/makefile b/core/src/makefile index f712f7abcd6..8b34827e8fe 100755 --- a/core/src/makefile +++ b/core/src/makefile @@ -1,8 +1,9 @@ # prefix include $(PRO_DIR)/prefix.mak -# xmake -SUB_PROS += xmake +# projects +SUB_PROS += demo +DEP_PROS += xmake # suffix include $(PRO_DIR)/suffix.mak diff --git a/core/src/xmake/makefile b/core/src/xmake/makefile index 276a1b64b4d..105bc2eff4f 100755 --- a/core/src/xmake/makefile +++ b/core/src/xmake/makefile @@ -53,10 +53,6 @@ xmake_INC_FILES = \ prefix/config.h \ prefix/version.h - -# demo -SUB_PROS-$(DEMO) += ../demo - # suffix include $(PRO_DIR)/suffix.mak diff --git a/core/suffix.mak b/core/suffix.mak index 53232cdea3f..05f815e28e9 100755 --- a/core/suffix.mak +++ b/core/suffix.mak @@ -284,7 +284,13 @@ endef define MAKE_ALL_SUB_PROS -SUB_PROS_$(1)_all: +SUB_PROS_$(1)_all: $(foreach pro, $(DEP_PROS), DEP_PROS_$(pro)_all) + @echo make $(1) + @$(MAKE) --no-print-directory -C $(1) +endef + +define MAKE_ALL_DEP_PROS +DEP_PROS_$(1)_all: @echo make $(1) @$(MAKE) --no-print-directory -C $(1) endef @@ -295,6 +301,7 @@ all: \ $(foreach name, $(NAMES), $(if $($(name)_FILES), $(eval $(call MAKE_ALL,$(name),$($(name)_TYPE))), )) $(foreach pro, $(SUB_PROS), $(eval $(call MAKE_ALL_SUB_PROS,$(pro)))) +$(foreach pro, $(DEP_PROS), $(eval $(call MAKE_ALL_DEP_PROS,$(pro)))) # ###################################################################################### # make install @@ -405,7 +412,15 @@ SUB_PROS_$(1)_install: @echo install $(1) @$(MAKE) --no-print-directory -C $(1) install endef + +# make dep-projects +define MAKE_INSTALL_DEP_PROS +DEP_PROS_$(1)_install: $(foreach pro, $(DEP_PROS), DEP_PROS_$(pro)_install) + @echo install $(1) + @$(MAKE) --no-print-directory -C $(1) install +endef $(foreach pro, $(SUB_PROS), $(eval $(call MAKE_INSTALL_SUB_PROS,$(pro)))) +$(foreach pro, $(DEP_PROS), $(eval $(call MAKE_INSTALL_DEP_PROS,$(pro)))) # ###################################################################################### # make clean @@ -418,7 +433,13 @@ $(1)_$(2)_clean: endef define MAKE_CLEAN_SUB_PROS -SUB_PROS_$(1)_clean: +SUB_PROS_$(1)_clean: $(foreach pro, $(DEP_PROS), DEP_PROS_$(pro)_clean) + @echo clean $(1) + @$(MAKE) --no-print-directory -C $(1) clean +endef + +define MAKE_CLEAN_DEP_PROS +DEP_PROS_$(1)_clean: @echo clean $(1) @$(MAKE) --no-print-directory -C $(1) clean endef @@ -429,13 +450,20 @@ clean: \ $(foreach name, $(NAMES), $(eval $(call MAKE_CLEAN,$(name),$($(name)_TYPE)))) $(foreach pro, $(SUB_PROS), $(eval $(call MAKE_CLEAN_SUB_PROS,$(pro)))) +$(foreach pro, $(DEP_PROS), $(eval $(call MAKE_CLEAN_DEP_PROS,$(pro)))) # ###################################################################################### # make update # # define MAKE_UPDATE_SUB_PROS -SUB_PROS_$(1)_update: +SUB_PROS_$(1)_update: $(foreach pro, $(DEP_PROS), DEP_PROS_$(pro)_update) + @echo update $(1) + @$(MAKE) --no-print-directory -C $(1) update +endef + +define MAKE_UPDATE_DEP_PROS +DEP_PROS_$(1)_update: @echo update $(1) @$(MAKE) --no-print-directory -C $(1) update endef @@ -444,6 +472,7 @@ update: .null $(foreach pro, $(SUB_PROS), SUB_PROS_$(pro)_update) -@$(RM) *.b *.a *.so *.exe *.dll *.lib *.pdb *.ilk $(foreach pro, $(SUB_PROS), $(eval $(call MAKE_UPDATE_SUB_PROS,$(pro)))) +$(foreach pro, $(DEP_PROS), $(eval $(call MAKE_UPDATE_DEP_PROS,$(pro)))) # ###################################################################################### # null diff --git a/install b/install index cf48e1a835a..efd681c1e71 100755 --- a/install +++ b/install @@ -52,7 +52,6 @@ if [ $? -ne 0 ]; then fi make c make -make if [ $? -ne 0 ]; then make o exit;