help-make
[Top][All Lists]
Advanced

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

-Orecurse in combination with pipes


From: Alejandro Colomar
Subject: -Orecurse in combination with pipes
Date: Tue, 20 Feb 2024 00:37:25 +0100

Hi!

I'm trying to add a prefix to every line from a recursive make(1), so
that I know what's going on, but it breaks -Orecurse.

$ cat Makefile 
.PHONY: all f b foo bar
all: f b;

f:
        $(info  MAKE    foo)
        @$(MAKE) foo | sed 's,^,MAKE    foo:    ,'
b:
        $(info  MAKE    bar)
        @$(MAKE) bar | sed 's,^,MAKE    bar:    ,'

foo:
        $(info  CC      foo)
        @sleep 1
        @echo errors from cc foo >&2
bar:
        $(info  CC      bar)
        @echo errors from cc bar >&2


$ make -j24 --no-print-directory -Orecurse
MAKE    bar
errors from cc bar
MAKE    bar:    CC      bar
MAKE    foo
errors from cc foo
MAKE    foo:    CC      foo


Do you know if there's a way to achieve something like this thing
without breaking -Orecurse?

Thanks!

Have a lovely night!
Alex

P.S.: Usually, I'd avoid recursive make, but for having a `distcheck`
target, I specifically need to create the tarball, and then run MAKE
from within that tarball.

-- 
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.

Attachment: signature.asc
Description: PGP signature


reply via email to

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