[PATCH v2] kbuild: use printf instead of echo -e extension

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Apr 13 02:40:20 PDT 2023

On 13.04.23 11:20, Sascha Hauer wrote:
> Hi Ahmad,
> The subject seems outdated, you are not using printf at all here.

Oh right. I tried printf first, but foreach concatenates with
spaces in-between and printf ignores everything not referenced
by the format string...

> On Thu, Apr 13, 2023 at 10:45:47AM +0200, Ahmad Fatoum wrote:
>> We are using echo -e, so the \n in the string being echo'd are
>> interpreted. As -e is not POSIX and dash doesn't provide it,
>> we use a strange /usr/bin/env echo -e construct hoping that
>> whatever non-builtin echo is first in the search path supports -e.
>> As the new lines are just used to separate CPP directives, we can
>> just pass the directives as $(CPP) flags. This has the same result,
>> but is potable and avoids NixOS complaining when building barebox.
> s/potable/portable/

Will fix.

> Good idea to get rid of the echo -e dependency entirely, I like it :)
> You could replace the '-' for stdin with /dev/null and then drop the
> echo |. Maybe this makes it a bit easier to read.

I had thought about that, but deemed

  In file included from <command-line>:3:
  /home/afa/fragment1.dts:6:2: warning: #warning hey [-Wcpp]

to be less confusing than it mentioning /dev/null. Now that I actually
tried it out though, the warning also references command-line, so
you will change for v3.


> Sascha

Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

More information about the barebox mailing list