Skip to content

Commit 825dda9

Browse files
committed
fix makefile deps for core
1 parent ed7b306 commit 825dda9

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

core/src/makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# prefix
22
include $(PRO_DIR)/prefix.mak
33

4-
# xmake
5-
SUB_PROS += xmake
4+
# projects
5+
SUB_PROS += demo
6+
DEP_PROS += xmake
67

78
# suffix
89
include $(PRO_DIR)/suffix.mak

core/src/xmake/makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ xmake_INC_FILES = \
5353
prefix/config.h \
5454
prefix/version.h
5555

56-
57-
# demo
58-
SUB_PROS-$(DEMO) += ../demo
59-
6056
# suffix
6157
include $(PRO_DIR)/suffix.mak
6258

core/suffix.mak

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,13 @@ endef
284284

285285

286286
define MAKE_ALL_SUB_PROS
287-
SUB_PROS_$(1)_all:
287+
SUB_PROS_$(1)_all: $(foreach pro, $(DEP_PROS), DEP_PROS_$(pro)_all)
288+
@echo make $(1)
289+
@$(MAKE) --no-print-directory -C $(1)
290+
endef
291+
292+
define MAKE_ALL_DEP_PROS
293+
DEP_PROS_$(1)_all:
288294
@echo make $(1)
289295
@$(MAKE) --no-print-directory -C $(1)
290296
endef
@@ -295,6 +301,7 @@ all: \
295301

296302
$(foreach name, $(NAMES), $(if $($(name)_FILES), $(eval $(call MAKE_ALL,$(name),$($(name)_TYPE))), ))
297303
$(foreach pro, $(SUB_PROS), $(eval $(call MAKE_ALL_SUB_PROS,$(pro))))
304+
$(foreach pro, $(DEP_PROS), $(eval $(call MAKE_ALL_DEP_PROS,$(pro))))
298305

299306
# ######################################################################################
300307
# make install
@@ -405,7 +412,15 @@ SUB_PROS_$(1)_install:
405412
@echo install $(1)
406413
@$(MAKE) --no-print-directory -C $(1) install
407414
endef
415+
416+
# make dep-projects
417+
define MAKE_INSTALL_DEP_PROS
418+
DEP_PROS_$(1)_install: $(foreach pro, $(DEP_PROS), DEP_PROS_$(pro)_install)
419+
@echo install $(1)
420+
@$(MAKE) --no-print-directory -C $(1) install
421+
endef
408422
$(foreach pro, $(SUB_PROS), $(eval $(call MAKE_INSTALL_SUB_PROS,$(pro))))
423+
$(foreach pro, $(DEP_PROS), $(eval $(call MAKE_INSTALL_DEP_PROS,$(pro))))
409424

410425
# ######################################################################################
411426
# make clean
@@ -418,7 +433,13 @@ $(1)_$(2)_clean:
418433
endef
419434

420435
define MAKE_CLEAN_SUB_PROS
421-
SUB_PROS_$(1)_clean:
436+
SUB_PROS_$(1)_clean: $(foreach pro, $(DEP_PROS), DEP_PROS_$(pro)_clean)
437+
@echo clean $(1)
438+
@$(MAKE) --no-print-directory -C $(1) clean
439+
endef
440+
441+
define MAKE_CLEAN_DEP_PROS
442+
DEP_PROS_$(1)_clean:
422443
@echo clean $(1)
423444
@$(MAKE) --no-print-directory -C $(1) clean
424445
endef
@@ -429,13 +450,20 @@ clean: \
429450

430451
$(foreach name, $(NAMES), $(eval $(call MAKE_CLEAN,$(name),$($(name)_TYPE))))
431452
$(foreach pro, $(SUB_PROS), $(eval $(call MAKE_CLEAN_SUB_PROS,$(pro))))
453+
$(foreach pro, $(DEP_PROS), $(eval $(call MAKE_CLEAN_DEP_PROS,$(pro))))
432454

433455
# ######################################################################################
434456
# make update
435457
# #
436458

437459
define MAKE_UPDATE_SUB_PROS
438-
SUB_PROS_$(1)_update:
460+
SUB_PROS_$(1)_update: $(foreach pro, $(DEP_PROS), DEP_PROS_$(pro)_update)
461+
@echo update $(1)
462+
@$(MAKE) --no-print-directory -C $(1) update
463+
endef
464+
465+
define MAKE_UPDATE_DEP_PROS
466+
DEP_PROS_$(1)_update:
439467
@echo update $(1)
440468
@$(MAKE) --no-print-directory -C $(1) update
441469
endef
@@ -444,6 +472,7 @@ update: .null $(foreach pro, $(SUB_PROS), SUB_PROS_$(pro)_update)
444472
-@$(RM) *.b *.a *.so *.exe *.dll *.lib *.pdb *.ilk
445473

446474
$(foreach pro, $(SUB_PROS), $(eval $(call MAKE_UPDATE_SUB_PROS,$(pro))))
475+
$(foreach pro, $(DEP_PROS), $(eval $(call MAKE_UPDATE_DEP_PROS,$(pro))))
447476

448477
# ######################################################################################
449478
# null

install

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ if [ $? -ne 0 ]; then
5252
fi
5353
make c
5454
make
55-
make
5655
if [ $? -ne 0 ]; then
5756
make o
5857
exit;

0 commit comments

Comments
 (0)