X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=blobdiff_plain;f=mk%2Frte.subdir.mk;h=92f5de4c89851bbc1562245fa52ccc6db997c694;hp=5341f1feb8f351dfc28eec78f57e82dd632be26c;hb=feb9f680cd2c1df3d47bf4c05dc872467176e1e3;hpb=5b2976c718e0717f5e1b39b50ac71fb2ce80e47c diff --git a/mk/rte.subdir.mk b/mk/rte.subdir.mk index 5341f1feb8..92f5de4c89 100644 --- a/mk/rte.subdir.mk +++ b/mk/rte.subdir.mk @@ -37,6 +37,8 @@ include $(RTE_SDK)/mk/internal/rte.install-pre.mk include $(RTE_SDK)/mk/internal/rte.clean-pre.mk include $(RTE_SDK)/mk/internal/rte.build-pre.mk +ALL_DEPDIRS := $(patsubst DEPDIRS-%,%,$(filter DEPDIRS-%,$(.VARIABLES))) + CLEANDIRS = $(addsuffix _clean,$(DIRS-y) $(DIRS-n) $(DIRS-)) VPATH += $(SRCDIR) @@ -60,7 +62,8 @@ build: _postbuild $(DIRS-y): @[ -d $(CURDIR)/$@ ] || mkdir -p $(CURDIR)/$@ @echo "== Build $S/$@" - @$(MAKE) S=$S/$@ -f $(SRCDIR)/$@/Makefile -C $(CURDIR)/$@ all + @$(MAKE) S=$S/$@ -f $(SRCDIR)/$@/Makefile -C $(CURDIR)/$@ \ + DEPDIRS="$(DEPDIRS-$@)" all .PHONY: clean clean: _postclean @@ -72,34 +75,16 @@ clean: _postclean fi @rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS) -# -# include .depdirs and define rules to order priorities between build -# of directories. -# --include $(RTE_OUTPUT)/.depdirs - define depdirs_rule -$(1): $(sort $(patsubst $(S)/%,%,$(LOCAL_DEPDIRS-$(S)/$(1)))) -endef - -$(foreach d,$(DIRS-y),$(eval $(call depdirs_rule,$(d)))) +$(DEPDIRS-$(1)): -DEPDIRS = $(wildcard $(addprefix $(S)/,$(DIRS-y))) +$(1): | $(DEPDIRS-$(1)) -.PHONY: depdirs $(DEPDIRS) -depdirs: $(DEPDIRS) - -$(DEPDIRS): - @$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile depdirs +$(if $(D),$(info $(1) depends on $(DEPDIRS-$(1)))) +endef -.PHONY: depgraph -depgraph: - @for d in $(DIRS-y); do \ - echo " \"$(S)\" -> \"$(S)/$$d\"" ; \ - if [ -f $(SRCDIR)/$$d/Makefile ]; then \ - $(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile depgraph ; \ - fi ; \ - done +$(foreach dir,$(ALL_DEPDIRS),\ + $(eval $(call depdirs_rule,$(dir)))) include $(RTE_SDK)/mk/internal/rte.install-post.mk include $(RTE_SDK)/mk/internal/rte.clean-post.mk