Re: conditionals in Makefiles
"Jeremy C. Reed" <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.pkgsrc.wip.general |
|---|---|
| Message-ID | <[email protected]> |
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