summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-01-10 16:58:28 +0800
committerruki <[email protected]>2016-01-10 16:58:28 +0800
commit825dda9d93448ba783e18f7947eef0b4eb07942e (patch)
tree151657412b0dc32cef76070d5980ca6ae3357c2b
parented7b3067d15125dfbb3c61682d258539a7dc6b52 (diff)
fix makefile deps for corev1.0.4
-rwxr-xr-xcore/src/makefile5
-rwxr-xr-xcore/src/xmake/makefile4
-rwxr-xr-xcore/suffix.mak35
-rwxr-xr-xinstall1
4 files changed, 35 insertions, 10 deletions
diff --git a/core/src/makefile b/core/src/makefile
index f712f7abc..8b34827e8 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 276a1b64b..105bc2eff 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 53232cdea..05f815e28 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 cf48e1a83..efd681c1e 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;