From patchwork Thu Oct 17 11:38:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 284174 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 EC1792C00BC for ; Thu, 17 Oct 2013 22:40:04 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AB6524A0C2; Thu, 17 Oct 2013 13:40:00 +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 gLk40t61p77e; Thu, 17 Oct 2013 13:40:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D2554A0C3; Thu, 17 Oct 2013 13:39:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 436E54A0A1 for ; Thu, 17 Oct 2013 13:39:25 +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 fdUM0R8Da2-k for ; Thu, 17 Oct 2013 13:39:20 +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 61F504A09E for ; Thu, 17 Oct 2013 13:39:17 +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-maile14) with ESMTP id r9HBcxNN022426; Thu, 17 Oct 2013 20:38:59 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili12) with ESMTP id r9HBcxo12078; Thu, 17 Oct 2013 20:38:59 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi12) id r9HBcxiP020967; Thu, 17 Oct 2013 20:38:59 +0900 Received: from poodle by lomi12.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id r9HBcxST020946; Thu, 17 Oct 2013 20:38:59 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 8B7F22743A5D; Thu, 17 Oct 2013 20:38:59 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 17 Oct 2013 20:38:51 +0900 Message-Id: <1382009936-17610-2-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1382009936-17610-1-git-send-email-yamada.m@jp.panasonic.com> References: <1382009936-17610-1-git-send-email-yamada.m@jp.panasonic.com> Subject: [U-Boot] [PATCH v4 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 Cc: Simon Glass --- Changes for v4: - No change Changes for v3: - No change Changes for v2: - No change 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