I'm not sure if there is something easily accessible for what you want in GNUmake (based on your link, I assume we are talking about this taste). You can somehow imitate him, but I'm afraid that the solution will not be perfect.
use debug flags
make --debug=j mytarget make , , , . :
Live child 0x021d2360 (mytarget) PID 10747
echo Hello World!
Hello World!
Reaping winning child 0x021d2360 PID 10747
Removing child 0x021d2360 PID 10747 from chain.
, , , (-j options) .
SHELL
SHELL, make, . (ab), . Makefile
SHELL=/bin/sh -c 'echo -n "[$@]: " && $$@'
echo "Hello World!"
[mytarget]: "Hello World!"
, make , , SHELL
, make , , :
echo_target=@echo -n '[$@]: ' && echo $(1) && echo -n '[$@]: ' && $(1)
.PHONY: all bla
mytarget:
$(call echo_target, echo "Hello World!")
[mytarget]: echo Hello World!
[mytarget]: Hello World!
call Makefile
:
, SHELL, , , . , SHELL : , , , $@ prepended:
SHELL=/bin/sh -c 'echo -n "[$@] " && echo "$$@" && echo -n "[$@] " && eval "$$@"'
mytarget:
echo 'Hello World!'
@touch foo\ bar
@ls -l "foo bar"
echo 'Hello World!'
[mytarget] echo 'Hello World!'
[mytarget] Hello World!
[mytarget] echo foo\ bar
[mytarget] foo bar
[mytarget] touch foo\ bar
[mytarget] [mytarget] ls -l "foo bar"
[mytarget] -rw-rw-r-- 1 virgile virgile 0 juil. 23 08:44 foo bar
, - , , touch. , , , .