From patchwork Mon Sep 30 08:23:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 278958 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 B81502C008A for ; Mon, 30 Sep 2013 18:25:43 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BEB874A0D1; Mon, 30 Sep 2013 10:25:18 +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 s7JX4m9j1MBe; Mon, 30 Sep 2013 10:25:18 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E37044A0FB; Mon, 30 Sep 2013 10:24:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1E68C4A0EB for ; Mon, 30 Sep 2013 10:24:41 +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 CQCMlC09JLkN for ; Mon, 30 Sep 2013 10:24:35 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=SKIP(-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 5AF964A0DC for ; Mon, 30 Sep 2013 10:24:15 +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-maile11) with ESMTP id r8U8Nlkm008396; Mon, 30 Sep 2013 17:23:47 +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 r8U8Nmo04271; Mon, 30 Sep 2013 17:23:48 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi15) id r8U8NmhX008279; Mon, 30 Sep 2013 17:23:48 +0900 Received: from poodle by lomi15.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id r8U8NlCJ008236; Mon, 30 Sep 2013 17:23:47 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id CB09A2743A5D; Mon, 30 Sep 2013 17:23:47 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 30 Sep 2013 17:23:33 +0900 Message-Id: <1380529418-28532-2-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1380529418-28532-1-git-send-email-yamada.m@jp.panasonic.com> References: <1380529418-28532-1-git-send-email-yamada.m@jp.panasonic.com> Subject: [U-Boot] [PATCH v3 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 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