On 11/02/2008, David Paleino wrote:
> Not true:
> [Snip unrelated logic stuff.]

Yes, true. Functionally, you want foo => bar. Check (assuming here foo
is absent):
,----
| [EMAIL PROTECTED]:~$     [ ! -f foo ] && echo "Doing bar 1"
| Doing bar 1
| [EMAIL PROTECTED]:~$     [ -f foo ]   && echo "Doing bar 2"
| [EMAIL PROTECTED]:~$     [ ! ! -f foo ] || echo "Doing bar 1"
| Doing bar 1
| [EMAIL PROTECTED]:~$     [ ! -f foo  ]  || echo "Doing bar 2"
| [EMAIL PROTECTED]:~$
`----

Now, moving that to a Makefile:
,----
| #!/usr/bin/make -f
|
| and:
|       [ ! -f foo ] && echo "Doing bar 1"
|       [ -f foo ]   && echo "Doing bar 2"
|
| or:
|       [ ! ! -f foo ] || echo "Doing bar 1"
|       [ ! -f foo  ]  || echo "Doing bar 2"
`----

You now get:
,----
| [EMAIL PROTECTED]:~$ make or
| [ ! ! -f foo ] || echo "Doing bar 1"
| Doing bar 1
| [ ! -f foo  ]  || echo "Doing bar 2"
| [EMAIL PROTECTED]:~$ make and
| [ ! -f foo ] && echo "Doing bar 1"
| Doing bar 1
| [ -f foo ]   && echo "Doing bar 2"
| make: *** [and] Erreur 1
`----


> but I can't understand why it couldn't suggest something like:
>
> [ -f Makefile ] && $(MAKE) distclean
>
> which triggers the same result (at least in bash -- that's why I'm
> supposing that "&&" needs to be escaped somehow in Makefiles).

Explained already in my first mail, and in extenso by Justin.

-- 
Cyril Brulebois

Attachment: pgpy7kq0QwpEG.pgp
Description: PGP signature

Reply via email to