From patchwork Sun Sep 8 01:54:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 273413 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7D6A82C011B for ; Sun, 8 Sep 2013 11:55:08 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 410274A0A6; Sun, 8 Sep 2013 03:55:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TLAvlMNiI2q9; Sun, 8 Sep 2013 03:55:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9040D4A0B3; Sun, 8 Sep 2013 03:54:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 11E324A0A6 for ; Sun, 8 Sep 2013 03:54:52 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8YeM1OJCzJ10 for ; Sun, 8 Sep 2013 03:54:44 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 1A9A84A08F for ; Sun, 8 Sep 2013 03:54:42 +0200 (CEST) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile13) with ESMTP id r881sfTu008390 for ; Sun, 8 Sep 2013 10:54:41 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili11) with ESMTP id r881seR27521 for ; Sun, 8 Sep 2013 10:54:40 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi15) id r881se31018452; Sun, 8 Sep 2013 10:54:40 +0900 Received: from poodle by lomi15.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id r881seOZ018440; Sun, 8 Sep 2013 10:54:40 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 97F922743A5C; Sun, 8 Sep 2013 10:54:40 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 8 Sep 2013 10:54:11 +0900 Message-Id: <1378605256-30748-2-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1378605256-30748-1-git-send-email-yamada.m@jp.panasonic.com> References: <1378605256-30748-1-git-send-email-yamada.m@jp.panasonic.com> Subject: [U-Boot] [PATCH 1/6] Makefile: support descending down to subdirectories X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This patch tweaks scripts/Makefile.build to allow the build system to descend into subdirectories like Kbuild. To use this feature, use "obj-y += foo/" syntax. Example: obj-$(CONFIG_FOO) += foo/ Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index f969ec5..2ef7341 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -19,6 +19,11 @@ obj-y := $(sort $(obj-y)) extra-y := $(sort $(extra-y)) lib-y := $(sort $(lib-y)) +subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) +obj-y := $(patsubst %/, %/built-in.o, $(obj-y)) +subdir-obj-y := $(filter %/built-in.o, $(obj-y)) +subdir-obj-y := $(addprefix $(obj),$(subdir-obj-y)) + SRCS += $(COBJS:.o=.c) $(SOBJS:.o=.S) \ $(wildcard $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) $(lib-y:.o=.S) $(extra-y:.o=.c) $(extra-y:.o=.S)) OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS) $(obj-y)) @@ -37,6 +42,14 @@ $(LIBGCC): $(obj).depend $(LGOBJS) $(call cmd_link_o_target, $(LGOBJS)) endif +ifneq ($(subdir-obj-y),) +# Descending +$(subdir-obj-y): $(subdir-y) + +$(subdir-y): FORCE + $(MAKE) -C $@ -f $(TOPDIR)/scripts/Makefile.build +endif + ######################################################################### # defines $(obj).depend target @@ -46,3 +59,5 @@ include $(TOPDIR)/rules.mk sinclude $(obj).depend ######################################################################### + +.PHONY: FORCE