help-make
[Top][All Lists]
Advanced

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

Re: ssh, $(MAKE) and -n weirdness


From: David Boyce
Subject: Re: ssh, $(MAKE) and -n weirdness
Date: Mon, 14 Jul 2008 23:47:52 -0400

On Mon, Jul 14, 2008 at 10:46 PM, Martin d'Anjou <address@hidden> wrote:
Hello,

Can someone explain why the remote1 and the remote2 targets respond differently to passing the -n switch in the following makefile?

$ cat makefile
remote=localhost
remote1:
       ssh $(remote) "cd $(PWD) && $(MAKE) -f makefile this"
remote2:
       ssh $(remote) "cd $(PWD) && make -f makefile this"
this:
       @echo This is done!

$ make remote1 -n
ssh localhost "cd /home/me && make -f makefile this"
This is done!
$ make remote2 -n
ssh localhost "cd /home/me && make -f makefile this"
$

What I do not understand is why "remote1" is built even though I pass -n?

This is documented. See GNU Make Manual section 5.7.1: "Command lines containing MAKE are executed normally despite the presence of a flag that causes most commands not to be run".

David Boyce

reply via email to

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