lynx-dev
[Top][All Lists]
Advanced

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

Re: [Lynx-dev] Patch to fix error messages during fresh install


From: Thorsten Glaser
Subject: Re: [Lynx-dev] Patch to fix error messages during fresh install
Date: Thu, 26 Apr 2007 18:40:28 +0000 (UTC)

Chuck Houpt dixit:

>> No, in make you do *not* use && unless you also have an || case.
>>
>>
>> This will abort(!) the make if $(BINDIR)/lynx$x does not exist.
>>
>> Use
>>> -   -mv -f $(BINDIR)/lynx$x $(BINDIR)/lynx.old
>>  -   test -e $(BINDIR)/lynx$x && mv -f $(BINDIR)/lynx$x $(BINDIR)/lynx.old
>>  +     test ! -f $(BINDIR)/lynx$x || mv -f $(BINDIR)/lynx$x
>> $(BINDIR)/lynx.old
>> instead. *(autoconf)Limitations of Builtins:: says that test ! is safe
>> (if ! test isn't), and -e doesn't exist e.g. on Solaris, but -f does.

> Apologies, I should have re-tested. The pattern used in the uninstall targets
> uses Make's "-" to suppress the error. So another possibility is:
>
>    -test -e $(BINDIR)/lynx$x && mv -f $(BINDIR)/lynx$x $(BINDIR)/lynx.old

(I assume you mean test -f, not test -e)

I'd still use the || syntax here, with or without a prefixing -, to make
it clear to people that you don't normally use && in a Makefile.

//mirabile
-- 
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence.              -- Coywolf Qi Hunt




reply via email to

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