lkml.org 
[lkml]   [2018]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 09/10] kbuild: add *.asn1.[ch] to 'targets' automatically
Date
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 <yamada.masahiro@socionext.com>
---

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
\
 
 \ /
  Last update: 2018-03-23 14:07    [W:0.175 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site