* [Buildroot] [git commit] Makefile: error out printvars target when VARS is empty or unset
@ 2022-08-03 17:05 Yann E. MORIN
2022-08-04 8:00 ` David Laight
0 siblings, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2022-08-03 17:05 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=ec82347cdee190a5fa451b83cdb3727c78cda315
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
printvars returns nothing when VARS is not passed or empty. This is done
on purpose, see commit fd5bd12379dc ("Makefile: printvars: don't print
anything when VARS is not set").
An error message making explicit what is required from the user in order
to use printvars is however better than silently doing nothing.
This adds a check for a non-empty VARS variable.
Cc: Quentin Schulz <foss+buildroot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Makefile b/Makefile
index 07b594ea8a..5f266e36b2 100644
--- a/Makefile
+++ b/Makefile
@@ -1058,6 +1058,10 @@ endif
# to workaround a bug in make 4.3; see https://savannah.gnu.org/bugs/?59093
.PHONY: printvars
printvars:
+ifndef VARS
+ @echo "Please pass a non-empty VARS to 'make printvars'"
+ @exit 1
+endif
@:
$(foreach V, \
$(sort $(foreach X, $(.VARIABLES), $(filter $(VARS),$(X)))), \
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Buildroot] [git commit] Makefile: error out printvars target when VARS is empty or unset
2022-08-03 17:05 [Buildroot] [git commit] Makefile: error out printvars target when VARS is empty or unset Yann E. MORIN
@ 2022-08-04 8:00 ` David Laight
2022-08-04 11:47 ` Quentin Schulz
2022-08-04 21:16 ` Yann E. MORIN
0 siblings, 2 replies; 5+ messages in thread
From: David Laight @ 2022-08-04 8:00 UTC (permalink / raw)
To: 'Yann E.MORIN', buildroot@buildroot.org
From: Yann E.MORIN
> Sent: 03 August 2022 18:05
>
> printvars returns nothing when VARS is not passed or empty. This is done
> on purpose, see commit fd5bd12379dc ("Makefile: printvars: don't print
> anything when VARS is not set").
>
> An error message making explicit what is required from the user in order
> to use printvars is however better than silently doing nothing.
>
> This adds a check for a non-empty VARS variable.
>
> Cc: Quentin Schulz <foss+buildroot@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> ---
> Makefile | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 07b594ea8a..5f266e36b2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1058,6 +1058,10 @@ endif
> # to workaround a bug in make 4.3; see https://savannah.gnu.org/bugs/?59093
> .PHONY: printvars
> printvars:
> +ifndef VARS
> + @echo "Please pass a non-empty VARS to 'make printvars'"
Shouldn't that have a >&2 ??
David
> + @exit 1
> +endif
> @:
> $(foreach V, \
> $(sort $(foreach X, $(.VARIABLES), $(filter $(VARS),$(X)))), \
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] [git commit] Makefile: error out printvars target when VARS is empty or unset
2022-08-04 8:00 ` David Laight
@ 2022-08-04 11:47 ` Quentin Schulz
2022-08-04 15:08 ` Arnout Vandecappelle
2022-08-04 21:16 ` Yann E. MORIN
1 sibling, 1 reply; 5+ messages in thread
From: Quentin Schulz @ 2022-08-04 11:47 UTC (permalink / raw)
To: David Laight, 'Yann E.MORIN', buildroot@buildroot.org
Hi David,
On 8/4/22 10:00, David Laight wrote:
> From: Yann E.MORIN
>> Sent: 03 August 2022 18:05
>>
>> printvars returns nothing when VARS is not passed or empty. This is done
>> on purpose, see commit fd5bd12379dc ("Makefile: printvars: don't print
>> anything when VARS is not set").
>>
>> An error message making explicit what is required from the user in order
>> to use printvars is however better than silently doing nothing.
>>
>> This adds a check for a non-empty VARS variable.
>>
>> Cc: Quentin Schulz <foss+buildroot@0leil.net>
>> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
>> ---
>> Makefile | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/Makefile b/Makefile
>> index 07b594ea8a..5f266e36b2 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1058,6 +1058,10 @@ endif
>> # to workaround a bug in make 4.3; see https://urldefense.proofpoint.com/v2/url?u=https-3A__savannah.gnu.org_bugs_-3F59093&d=DwICAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=SdXTI_Lnrlv8g37eaCOuHTTozD5N4MfRMymHIsH0uaXJNHhpXLD6usuW5wCzWOeB&s=tp47StqVcL_LvVcxMDmq9Ve_u_dCALifZVz-Mnuyo8s&e=
>> .PHONY: printvars
>> printvars:
>> +ifndef VARS
>> + @echo "Please pass a non-empty VARS to 'make printvars'"
>
> Shouldn't that have a >&2 ??
>
Makes sense. Maybe we should also prefix it with ERROR: like there:
https://git.busybox.net/buildroot/tree/Makefile#n880
?
Could you please send a patch?
Thanks!
Quentin
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] [git commit] Makefile: error out printvars target when VARS is empty or unset
2022-08-04 11:47 ` Quentin Schulz
@ 2022-08-04 15:08 ` Arnout Vandecappelle
0 siblings, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2022-08-04 15:08 UTC (permalink / raw)
To: Quentin Schulz, David Laight, 'Yann E.MORIN',
buildroot@buildroot.org
On 04/08/2022 13:47, Quentin Schulz wrote:
> Hi David,
>
> On 8/4/22 10:00, David Laight wrote:
>> From: Yann E.MORIN
>>> Sent: 03 August 2022 18:05
>>>
>>> printvars returns nothing when VARS is not passed or empty. This is done
>>> on purpose, see commit fd5bd12379dc ("Makefile: printvars: don't print
>>> anything when VARS is not set").
>>>
>>> An error message making explicit what is required from the user in order
>>> to use printvars is however better than silently doing nothing.
>>>
>>> This adds a check for a non-empty VARS variable.
>>>
>>> Cc: Quentin Schulz <foss+buildroot@0leil.net>
>>> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>>> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
>>> ---
>>> Makefile | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index 07b594ea8a..5f266e36b2 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -1058,6 +1058,10 @@ endif
>>> # to workaround a bug in make 4.3; see
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__savannah.gnu.org_bugs_-3F59093&d=DwICAg&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=SdXTI_Lnrlv8g37eaCOuHTTozD5N4MfRMymHIsH0uaXJNHhpXLD6usuW5wCzWOeB&s=tp47StqVcL_LvVcxMDmq9Ve_u_dCALifZVz-Mnuyo8s&e=
>>>
>>> .PHONY: printvars
>>> printvars:
>>> +ifndef VARS
>>> + @echo "Please pass a non-empty VARS to 'make printvars'"
>>
>> Shouldn't that have a >&2 ??
>>
>
> Makes sense. Maybe we should also prefix it with ERROR: like there:
> https://git.busybox.net/buildroot/tree/Makefile#n880
Actually, instead of either of those, it should use $(error ...) - which also
allows you to remove the "exit 1" below.
Regards,
Arnout
> ?
>
> Could you please send a patch?
>
> Thanks!
> Quentin
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] [git commit] Makefile: error out printvars target when VARS is empty or unset
2022-08-04 8:00 ` David Laight
2022-08-04 11:47 ` Quentin Schulz
@ 2022-08-04 21:16 ` Yann E. MORIN
1 sibling, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2022-08-04 21:16 UTC (permalink / raw)
To: David Laight; +Cc: buildroot@buildroot.org
DAvid, All,
On 2022-08-04 08:00 +0000, David Laight spake thusly:
> From: Yann E.MORIN
> > An error message making explicit what is required from the user in order
> > to use printvars is however better than silently doing nothing.
[--SNIP--]
> > printvars:
> > +ifndef VARS
> > + @echo "Please pass a non-empty VARS to 'make printvars'"
> Shouldn't that have a >&2 ??
As usgested by Arnout, I changed that to use $(error).
Thanks for the nudge!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-08-04 21:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-03 17:05 [Buildroot] [git commit] Makefile: error out printvars target when VARS is empty or unset Yann E. MORIN
2022-08-04 8:00 ` David Laight
2022-08-04 11:47 ` Quentin Schulz
2022-08-04 15:08 ` Arnout Vandecappelle
2022-08-04 21:16 ` Yann E. MORIN
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.