diff mbox series

[1/1] Makefile.build: Add an explicit error for missing ASN.1 compiler

Message ID 20200922155341.17906-2-James.Bottomley@HansenPartnership.com
State New
Headers show
Series Add explicit error for missing CONFIG_ASN1 | expand

Commit Message

James Bottomley Sept. 22, 2020, 3:53 p.m. UTC
The current dependency rules mean that the build breaks if the ASN.1
compiler is required but CONFIG_ASN1 isn't set.  However, it isn't
obvious from the error message about missing files what the actual
problem is, so make the build system give an explicit error.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 scripts/Makefile.build | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Masahiro Yamada Sept. 24, 2020, 5:18 p.m. UTC | #1
On Wed, Sep 23, 2020 at 12:55 AM James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:
>
> The current dependency rules mean that the build breaks if the ASN.1
> compiler is required but CONFIG_ASN1 isn't set.  However, it isn't
> obvious from the error message about missing files what the actual
> problem is, so make the build system give an explicit error.
>
> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
> ---

Applied to linux-kbuild.
Thanks.


>  scripts/Makefile.build | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index a467b9323442..bca7003beac8 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -382,6 +382,11 @@ quiet_cmd_asn1_compiler = ASN.1   $(basename $@).[ch]
>        cmd_asn1_compiler = $(objtree)/scripts/asn1_compiler $< \
>                                 $(basename $@).c $(basename $@).h
>
> +ifndef CONFIG_ASN1
> +$(objtree)/scripts/asn1_compiler:
> +       $(error CONFIG_ASN1 must be defined for the asn1_compiler)
> +endif
> +
>  $(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler
>         $(call cmd,asn1_compiler)
>
> --
> 2.26.2
>
diff mbox series

Patch

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index a467b9323442..bca7003beac8 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -382,6 +382,11 @@  quiet_cmd_asn1_compiler = ASN.1   $(basename $@).[ch]
       cmd_asn1_compiler = $(objtree)/scripts/asn1_compiler $< \
 				$(basename $@).c $(basename $@).h
 
+ifndef CONFIG_ASN1
+$(objtree)/scripts/asn1_compiler:
+	$(error CONFIG_ASN1 must be defined for the asn1_compiler)
+endif
+
 $(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler
 	$(call cmd,asn1_compiler)