help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multi-line message to $(error )


From: Masahiro Yamada
Subject: Re: multi-line message to $(error )
Date: Wed, 16 Dec 2020 18:45:02 +0900

On Wed, Dec 16, 2020 at 6:22 PM David <bouncingcats@gmail.com> wrote:
>
> On Wed, 16 Dec 2020 at 17:00, Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> > Is there a good idea to make
> > $(error ) display a multi-line message?
>
> A variable can be defined to contain a newline.
>
> [david@kablamm]$ cat Makefile
>
> define newline
>
>
> endef


Ah, this is a cool idea.


>
> n:=$(newline)
> m1:=This message
> m2:=has several lines
>
> $(error $(n)$(m1)$(n)$(m2))
> [david@kablamm]$ make
> Makefile:12: ***
> This message
> has several lines.  Stop.
> [david@kablamm]$

In hindsight, the preceding *** is a bit unfortunate
(I do not see it for $(warning) )
but this works.

Thank you.

-- 
Best Regards
Masahiro Yamada



reply via email to

[Prev in Thread] Current Thread [Next in Thread]