pkgsrc-WIP-discuss archive

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

Re: conditionals in Makefiles



On Wed, 18 Nov 2009, Larson, Timothy E. wrote:

> I am trying to make a block of my package Makefile conditional on the OPSYS, 
> like so...
> 
> .if ${OPSYS} == "SunOS"
> # do stuff....
> .endif
> 
> ...but when I bmake, it says ''Malformed conditional (${OPSYS} == 
> "SunOS")'' and ''Need an operator''.  However, plenty of other package 
> Makefiles are doing this, so I must be missing something.

Probably your OPSYS is not defined yet. Most other packages use:

.include "../../mk/bsd.prefs.mk" 

(prior to the if condition)

See pkgsrc/mk/bsd.prefs.mk which says:

# Packages should include this file before any of the .if directives, as
# well as before modifying variables like CFLAGS, LDFLAGS, and so on.
# Otherwise the behavior may be unexpected.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss


Home | Main Index | Thread Index | Old Index