That's really a nice approach; not only because it completely avoids the need 
to echo and cluster the commands by using block level redirection, but also 
because it clearly seperates _what_ needs to be done (in the recipe) from 
_where_ it needs to be done (by defining SHELL and .SHELLFLAGS as scoped 
variables).

Thanks a lot for sharing this! Cheers,

Chris 

 
-----Original Message-----
From: David Boyce [mailto:[email protected]] 
Sent: Dienstag, 6. Dezember 2011 05:02
To: Warlich, Christof
Cc: Stephan Beal; [email protected]
Subject: Re: here document in recipe

On Nov 22, 2011, at 10:01 AM, "Warlich, Christof"
<[email protected]> wrote:

> That avoids the need for the redirection on every line and the final
> copy, thanks.
>
> But the echos still bother me. I played arround with canned recipes,
> but without success. So it seems that this is the best one can get.

You may find this a better way in general, or at least an interesting
alternative. Requires 3.82 though:

.PHONY: all tgtA tgtB

tgtB: SHELL := /usr/bin/ssh
tgtB: .SHELLFLAGS := <remote-host>

all: tgtA tgtB

tgtA:
        @echo Building $@ on $(shell hostname)

tgtB:
        @echo Building $@ on $(shell hostname)

This test case works fine for me (once <remote-host> is filled in).

-David Boyce

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to