Skip to content

Commit

Permalink
fix makefile deps for core
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jan 10, 2016
1 parent ed7b306 commit 825dda9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
5 changes: 3 additions & 2 deletions core/src/makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 0 additions & 4 deletions core/src/xmake/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ xmake_INC_FILES = \
prefix/config.h \
prefix/version.h


# demo
SUB_PROS-$(DEMO) += ../demo

# suffix
include $(PRO_DIR)/suffix.mak

35 changes: 32 additions & 3 deletions core/suffix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion install
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ if [ $? -ne 0 ]; then
fi
make c
make
make
if [ $? -ne 0 ]; then
make o
exit;
Expand Down

0 comments on commit 825dda9

Please sign in to comment.