Subject: Re: can't get bmake to accept .if ${OPSYS}
To: Gavan Fantom <gavan@coolfactor.org>
From: Mark E. Perkins <perkinsm@bway.net>
List: tech-pkg
Date: 09/03/2004 20:28:50
On 9/3/04 19:48, Gavan Fantom wrote:

> On Fri, 3 Sep 2004, Jeremy C. Reed wrote:
> 
>> On Fri, 3 Sep 2004, Mark E. Perkins wrote:
>>
>>> .if ${OPSYS} == "Darwin"
>>> MAKEFLAGS+=    RANLIB=ranlib
>>> .endif
>>>
>>> When I do this, I get the following errors:
>>>
>>> bmake: "/usr/pkgsrc/local/tidy/Makefile" line 27: Malformed conditional
>>> (${OPSYS} == "Darwin")
>>
>>
>> I think this is because OPSYS is not defined yet. Include the
>> mk/bsd.prefs.mk before that.
> 
> 
> You might also consider writing the following:
> 
> OPSYSVARS+=        MAKEFLAGS
> MAKEFLAGS.Darwin+=    RANLIB=ranlib
> 

Which approach is preferred? Or is it a matter of personal preference? 
Gavan's method does not require (explicit) inclusion of mk/bsd.prefs.mk, 
but how much of an advantage is that?

Mark