With the following Makefile:
----
define thing
echo 1
@echo 2
echo 3
endef
test:
$(thing)
----
run make. In version 3.79.1, the output is
echo 1
1
2
3
In version 3.77, the output is the expected
echo 1
1
2
echo 3
3
The behavior in 3.79.1 does not agree with the behavior described in
the manual in the mode "Defining Canned Command Sequences" as quoted
below:
> In command execution, each line of a canned sequence is treated just
> as if the line appeared on its own in the rule, preceded by a tab. In
> particular, `make' invokes a separate subshell for each line. You can
> use the special prefix characters that affect command lines (`@', `-',
> and `+') on each line of a canned sequence. *Note Writing the Commands
> in Rules: Commands. For example, using this canned sequence:
>
> define frobnicate
> @echo "frobnicating target $@"
> frob-step-1 $< -o $@-step-1
> frob-step-2 $@-step-1 -o $@
> endef
>
> `make' will not echo the first line, the `echo' command. But it _will_
> echo the following two command lines.
>
> On the other hand, prefix characters on the command line that refers
> to a canned sequence apply to every line in the sequence. So the rule:
>
> frob.out: frob.in
> @$(frobnicate)
>
> does not echo _any_ commands. (*Note Command Echoing: Echoing, for a
> full explanation of `@'.)
Based on what happens with slightly more complex examples, it seems
that once the first @command is encountered within a canned command
sequence, no further commands are echoed within the rest of the
command sequence. For example, the following:
----
define thing
echo 1
@echo 2
echo 3
endef
all: test1 test2
test1:
$(thing)
echo 4
test2:
echo 5
----
results in
echo 1
1
2
3
echo 4
4
echo 5
5
I have not investigated further or looked at the source. I also have
no built versions of make between 3.77 and 3.79.1 to test against.
Please let me know if you are unable to reproduce this bug so I can
investigate further.
My version of gnu make 3.79.1 is as distributed with RedHat Linux 7.1,
ix86.
--
E. Jay Berkenbilt <[EMAIL PROTECTED]>
http://www.ql.org/q/
_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make