fi
if [ ! -e $1/.config ] || $reconfig ; then
echo "================== Configure $1"
- make T=$2 O=$1 config
+ make -j$J T=$2 O=$1 config
echo 'Customize configuration'
# Built-in options (lowercase)
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.PHONY: depdirs
-depdirs:
- @for d in $(DEPDIRS-y); do \
- $(RTE_SDK)/buildtools/depdirs-rule.sh $(S) $$d ; \
- done
+.PHONY: depdirs $(DEPDIRS-y)
+depdirs: $(DEPDIRS-y)
+ @echo ""
+
+$(DEPDIRS-y):
+ @$(RTE_SDK)/buildtools/depdirs-rule.sh $(S) $@
.PHONY: depgraph
depgraph:
$(error "need a make config first")
endif
-# use a "for" in a shell to process dependencies: we don't want this
-# task to be run in parallel.
+DEPDIR_FILES = $(addsuffix /.depdirs, $(addprefix $(BUILDDIR)/,$(ROOTDIRS-y)))
+
.PHONY: depdirs
depdirs: $(RTE_OUTPUT)/.depdirs
-$(RTE_OUTPUT)/.depdirs: $(RTE_OUTPUT)/.config
- @rm -f $(RTE_OUTPUT)/.depdirs ; \
- for d in $(ROOTDIRS-y); do \
- if [ -f $(RTE_SRCDIR)/$$d/Makefile ]; then \
- [ -d $(BUILDDIR)/$$d ] || mkdir -p $(BUILDDIR)/$$d ; \
- $(MAKE) S=$$d -f $(RTE_SRCDIR)/$$d/Makefile depdirs \
- >> $(RTE_OUTPUT)/.depdirs ; \
- fi ; \
- done
+$(RTE_OUTPUT)/.depdirs: $(DEPDIR_FILES)
+ @rm -f $@
+ @sort -u -o $@ $(DEPDIR_FILES)
+
+$(DEPDIR_FILES): $(RTE_OUTPUT)/.config
+ @dir=$(notdir $(@D)); \
+ [ -d $(BUILDDIR)/$$dir ] || mkdir -p $(BUILDDIR)/$$dir; \
+ $(MAKE) S=$$dir -f $(RTE_SRCDIR)/$$dir/Makefile depdirs > $@
.PHONY: depgraph
depgraph:
# include .depdirs and define rules to order priorities between build
# of directories.
#
-include $(RTE_OUTPUT)/.depdirs
+-include $(RTE_OUTPUT)/.depdirs
define depdirs_rule
$(1): $(sort $(patsubst $(S)/%,%,$(LOCAL_DEPDIRS-$(S)/$(1))))
$(foreach d,$(DIRS-y),$(eval $(call depdirs_rule,$(d))))
+DEPDIRS = $(wildcard $(addprefix $(S)/,$(DIRS-y)))
-# use a "for" in a shell to process dependencies: we don't want this
-# task to be run in parallel.
-.PHONY: depdirs
-depdirs:
- @for d in $(DIRS-y); do \
- if [ -f $(SRCDIR)/$$d/Makefile ]; then \
- $(MAKE) S=$S/$$d -f $(SRCDIR)/$$d/Makefile depdirs ; \
- fi ; \
- done
+.PHONY: depdirs $(DEPDIRS)
+depdirs: $(DEPDIRS)
+
+$(DEPDIRS):
+ @$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile depdirs
.PHONY: depgraph
depgraph: