2018-05-03 07:30:11 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2014 6WIND S.A.
|
2014-05-16 08:18:56 +00:00
|
|
|
|
|
|
|
MAKEFLAGS += --no-print-directory
|
|
|
|
|
2017-03-24 13:21:31 +00:00
|
|
|
ALL_DEPDIRS := $(patsubst DEPDIRS-%,%,$(filter DEPDIRS-%,$(.VARIABLES)))
|
|
|
|
|
2014-05-16 08:18:56 +00:00
|
|
|
# output directory
|
2017-04-26 21:01:06 +00:00
|
|
|
O ?= $(CURDIR)
|
|
|
|
BASE_OUTPUT ?= $(abspath $(O))
|
2014-05-16 08:18:56 +00:00
|
|
|
CUR_SUBDIR ?= .
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(DIRS-y)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean: $(DIRS-y)
|
|
|
|
|
|
|
|
.PHONY: $(DIRS-y)
|
|
|
|
$(DIRS-y):
|
|
|
|
@echo "== $@"
|
|
|
|
$(Q)$(MAKE) -C $(@) \
|
|
|
|
M=$(CURDIR)/$(@)/Makefile \
|
|
|
|
O=$(BASE_OUTPUT)/$(CUR_SUBDIR)/$(@)/$(RTE_TARGET) \
|
|
|
|
BASE_OUTPUT=$(BASE_OUTPUT) \
|
|
|
|
CUR_SUBDIR=$(CUR_SUBDIR)/$(@) \
|
|
|
|
S=$(CURDIR)/$(@) \
|
|
|
|
$(filter-out $(DIRS-y),$(MAKECMDGOALS))
|
2017-03-24 13:21:31 +00:00
|
|
|
|
|
|
|
define depdirs_rule
|
|
|
|
$(DEPDIRS-$(1)):
|
|
|
|
|
|
|
|
$(1): | $(DEPDIRS-$(1))
|
|
|
|
|
|
|
|
$(if $(D),$(info $(1) depends on $(DEPDIRS-$(1))))
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach dir,$(ALL_DEPDIRS),\
|
|
|
|
$(eval $(call depdirs_rule,$(dir))))
|