From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753375AbeCWNHI (ORCPT ); Fri, 23 Mar 2018 09:07:08 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:54396 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752166AbeCWNHG (ORCPT ); Fri, 23 Mar 2018 09:07:06 -0400 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w2ND4mgf011418 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 09/10] kbuild: add *.asn1.[ch] to 'targets' automatically Date: Fri, 23 Mar 2018 22:04:38 +0900 Message-Id: <1521810279-6282-9-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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use $(call if_changed,...) instead of $(call cmd,...) in case the build command is changed in the future. Add intermediate files to 'targets' automatically to include *.cmd files. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 8c3ca61..cc081af 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -432,8 +432,9 @@ quiet_cmd_asn1_compiler = ASN.1 $@ .PRECIOUS: $(objtree)/$(obj)/%.asn1.c $(objtree)/$(obj)/%.asn1.h -$(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler - $(call cmd,asn1_compiler) +$(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 \ + $(objtree)/scripts/asn1_compiler FORCE + $(call if_changed,asn1_compiler) # Build the compiled-in targets # --------------------------------------------------------------------------- @@ -544,10 +545,12 @@ targets := $(filter-out $(PHONY), $(targets)) intermediate_targets = $(foreach sfx, $(2), \ $(patsubst %$(strip $(1)),%$(sfx), \ $(filter %$(strip $(1)), $(targets)))) +# %.asn1.o <- %.asn1.[ch] <- %.asn1 # %.dtb.o <- %.dtb.S <- %.dtb <- %.dts # %.lex.o <- %.lex.c <- %.l # %.tab.o <- %.tab.[ch] <- %.y -targets += $(call intermediate_targets, .dtb.o, .dtb.S .dtb) \ +targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \ + $(call intermediate_targets, .dtb.o, .dtb.S .dtb) \ $(call intermediate_targets, .lex.o, .lex.c) \ $(call intermediate_targets, .tab.o, .tab.c .tab.h) -- 2.7.4