From patchwork Thu Sep 26 11:51:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 278167 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 8211F2C00C5 for ; Thu, 26 Sep 2013 21:53:20 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DE0EA4A094; Thu, 26 Sep 2013 13:53:06 +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 Qgph3s2YOukN; Thu, 26 Sep 2013 13:53:06 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D305B4A0B0; Thu, 26 Sep 2013 13:52:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 664F04A08A for ; Thu, 26 Sep 2013 13:52:12 +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 oP0smBr3AeSA for ; Thu, 26 Sep 2013 13:52:08 +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 721F44A081 for ; Thu, 26 Sep 2013 13:51:56 +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 r8QBppZ7025024 for ; Thu, 26 Sep 2013 20:51:51 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili17) with ESMTP id r8QBpq305705 for ; Thu, 26 Sep 2013 20:51:52 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi11) id r8QBpqKf021467; Thu, 26 Sep 2013 20:51:52 +0900 Received: from poodle by lomi11.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id r8QBpqc0021401; Thu, 26 Sep 2013 20:51:52 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 3A25D2743A5D; Thu, 26 Sep 2013 20:51:52 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 26 Sep 2013 20:51:14 +0900 Message-Id: <1380196286-10810-8-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1380196286-10810-1-git-send-email-yamada.m@jp.panasonic.com> References: <1380196286-10810-1-git-send-email-yamada.m@jp.panasonic.com> Subject: [U-Boot] [PATCH v2 07/19] ARM: imx-common: convert makefiles to Kbuild style 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 Multiple targets are included in arch/arm/imx-common/Makefile In order to refactor it, we need to tweak Makefile and spl/Makefile. Signed-off-by: Masahiro Yamada --- Changes for v2 - No change Makefile | 8 +++++--- arch/arm/imx-common/Makefile | 35 ++++++----------------------------- spl/Makefile | 4 +++- 3 files changed, 14 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index 36bbd09..66c8c66 100644 --- a/Makefile +++ b/Makefile @@ -414,6 +414,8 @@ ALL-y += $(obj)u-boot-nodtb-tegra.bin endif endif +build := -f $(TOPDIR)/scripts/Makefile.build -C + all: $(ALL-y) $(SUBDIR_EXAMPLES) $(obj)u-boot.dtb: checkdtc $(obj)u-boot @@ -461,7 +463,7 @@ $(obj)u-boot.img: $(obj)u-boot.bin -d $< $@ $(obj)u-boot.imx: $(obj)u-boot.bin depend - $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx + $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx $(obj)u-boot.kwb: $(obj)u-boot.bin $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ @@ -499,11 +501,11 @@ $(obj)tpl/u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin $(call SPL_PAD_APPEND,$<,$(obj)u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO)) $(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin - $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \ + $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \ $(OBJTREE)/u-boot-with-spl.imx $(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin - $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \ + $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \ $(OBJTREE)/u-boot-with-nand-spl.imx $(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile index 727a052..50873d8 100644 --- a/arch/arm/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -7,31 +7,18 @@ # SPDX-License-Identifier: GPL-2.0+ # -include $(TOPDIR)/config.mk - -LIB = $(obj)libimx-common.o - ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610)) -COBJS-y = iomux-v3.o +obj-y = iomux-v3.o endif ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) -COBJS-y += timer.o cpu.o speed.o -COBJS-$(CONFIG_I2C_MXC) += i2c-mxv7.o +obj-y += timer.o cpu.o speed.o +obj-$(CONFIG_I2C_MXC) += i2c-mxv7.o endif ifeq ($(SOC),$(filter $(SOC),mx6 mxs)) -COBJS-y += misc.o +obj-y += misc.o endif -COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o -COBJS-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o -COBJS := $(sort $(COBJS-y)) - -SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) - -all: $(obj).depend $(LIB) - -$(LIB): $(OBJS) - $(call cmd_link_o_target, $(OBJS)) +obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o +obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp : $(SRCTREE)/% mkdir -p $(dir $@) @@ -67,13 +54,3 @@ $(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin $(OBJTREE)/u-boot.uim cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim > $@ rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim - - -######################################################################### - -# defines $(obj).depend target -include $(SRCTREE)/rules.mk - -sinclude $(obj).depend - -######################################################################### diff --git a/spl/Makefile b/spl/Makefile index 48f2c65..3197d61 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -153,6 +153,8 @@ ifeq ($(wildcard $(LDSCRIPT)),) $(error could not find linker script) endif +build := -f $(TOPDIR)/scripts/Makefile.build -C + # Special flags for CPP when processing the linker script. # Pass the version down so we can handle backwards compatibility # on the fly. @@ -172,7 +174,7 @@ $(OBJTREE)/MLO.byteswap: $(obj)u-boot-spl.bin -a $(CONFIG_SPL_TEXT_BASE) -d $< $@ $(OBJTREE)/SPL : $(obj)u-boot-spl.bin depend - $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $@ + $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $@ ALL-y += $(obj)$(SPL_BIN).bin