From patchwork Fri Mar 23 13:04:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10304671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 479F860386 for ; Fri, 23 Mar 2018 13:08:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3967F28E63 for ; Fri, 23 Mar 2018 13:08:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E56928E65; Fri, 23 Mar 2018 13:08:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 264A628E62 for ; Fri, 23 Mar 2018 13:08:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753176AbeCWNGJ (ORCPT ); Fri, 23 Mar 2018 09:06:09 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:52876 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753173AbeCWNGH (ORCPT ); Fri, 23 Mar 2018 09:06:07 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id w2ND4mgb011418; Fri, 23 Mar 2018 22:05:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w2ND4mgb011418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521810311; bh=+8TZ2yhEVZuOmdDxcmEatYD3ZYZbJDtr4xBo2rmM6GQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PZ5E0WPbONRluCpDeTjr2svAndyfGICyPHwoLgXdQjRYpYCLiynb163qAh9aJJOIz 2hM/04z+TdYa0G96deYw1Rlu/bwN6o7HIxUvvQLcJAaXmhDLvNs0aomkj3K4VHLxHa Ex2YvYoOXD/duF8eFgpbvoCJHWRgLnJgP2kvEHLLoiaM4WzS7L8CyvtM0cwUdcnki3 080QM77TBgQa/MzD9rCENKs6DmxTQFjC3jzmTami428dFvgsAyC0R2cPx3H//HFXVD Xy5OLcJ4FBaIdLSJf3J+Tsn7cULboJZjwJTIuSVQ/plV+7SdHOgd+psDgoUbxwwag0 ct/no6qKBHCzg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Michal Marek , linux-kernel@vger.kernel.org, Arnd Bergmann , Laurent Pinchart , Frank Rowand , Geert Uytterhoeven , Masahiro Yamada Subject: [PATCH 05/10] kbuild: add %.dtb.S and %.dtb to 'targets' automatically Date: Fri, 23 Mar 2018 22:04:34 +0900 Message-Id: <1521810279-6282-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521810279-6282-1-git-send-email-yamada.masahiro@socionext.com> References: <1521810279-6282-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Another common pattern that consists of chained commands is to compile a DTB as binary data into the kernel image or a module. It is used in several places in the source tree. Let's support it in the build core. $(call if_changed,dt_S_dtb) is more suitable than $(call cmd,dt_S_dtb) in case cmd_dt_S_dtb is changed in the future. Signed-off-by: Masahiro Yamada Acked-by: Frank Rowand --- drivers/of/unittest-data/Makefile | 2 -- scripts/Makefile.build | 4 +++- scripts/Makefile.lib | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/of/unittest-data/Makefile b/drivers/of/unittest-data/Makefile index df69797..333bc4c 100644 --- a/drivers/of/unittest-data/Makefile +++ b/drivers/of/unittest-data/Makefile @@ -7,8 +7,6 @@ obj-$(CONFIG_OF_OVERLAY) += overlay.dtb.o \ overlay_bad_symbol.dtb.o \ overlay_base.dtb.o -targets += $(foreach suffix, dtb dtb.S, $(patsubst %.dtb.o,%.$(suffix),$(obj-y))) - # enable creation of __symbols__ node DTC_FLAGS_overlay := -@ DTC_FLAGS_overlay_bad_phandle := -@ diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 36f7990..15b3bbb 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -544,9 +544,11 @@ targets := $(filter-out $(PHONY), $(targets)) intermediate_targets = $(foreach sfx, $(2), \ $(patsubst %$(strip $(1)),%$(sfx), \ $(filter %$(strip $(1)), $(targets)))) +# %.dtb.o <- %.dtb.S <- %.dtb <- %.dts # %.lex.o <- %.lex.c <- %.l # %.tab.o <- %.tab.[ch] <- %.y -targets += $(call intermediate_targets, .lex.o, .lex.c) \ +targets += $(call intermediate_targets, .dtb.o, .dtb.S .dtb) \ + $(call intermediate_targets, .lex.o, .lex.c) \ $(call intermediate_targets, .tab.o, .tab.c .tab.h) # Descending diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index b7d2c97..7a1fa92 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -278,8 +278,8 @@ cmd_dt_S_dtb= \ echo '.balign STRUCT_ALIGNMENT'; \ ) > $@ -$(obj)/%.dtb.S: $(obj)/%.dtb - $(call cmd,dt_S_dtb) +$(obj)/%.dtb.S: $(obj)/%.dtb FORCE + $(call if_changed,dt_S_dtb) quiet_cmd_dtc = DTC $@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \