help-make
[Top][All Lists]
Advanced

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

Re: How to make 'cd' errors stop a rule?


From: Tommy Nordgren
Subject: Re: How to make 'cd' errors stop a rule?
Date: Mon, 5 Dec 2005 00:28:07 +0100

Splitting into two lines won't work, since that will change how the command works
if the directory exists.
Instead use:
        cd bogus-this-is-not-a-real-directory && ls -l

Dec 4, 2005 kl. 11:59 PM skrev Dave Hylands:

Hi Matt,

I find that the 'cd' command in this rule does not stop this make script:


all:
        cd bogus-this-is-not-a-real-directory; ls -l
        @echo This is the 2nd cmd in the rule

You're actually executing two commands. And make is seeing the return
code from the ls -l.

So split it into two lines and it should fail if trying to cd into a
non-existance directory.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/


_______________________________________________
Help-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-make

-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
address@hidden







reply via email to

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