Date: Sun, 29 Oct 2006 11:20:21 +0930 From: "Daniel O'Connor" <doconnor@gsoft.com.au> To: freebsd-hackers@freebsd.org Cc: Garrett Cooper <youshi10@u.washington.edu> Subject: Re: How to write a FreeBSD-style makefile : checking for external vars existence? Message-ID: <200610291220.35363.doconnor@gsoft.com.au> In-Reply-To: <4543F878.2020006@u.washington.edu> References: <4543F878.2020006@u.washington.edu>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Sunday 29 October 2006 11:10, Garrett Cooper wrote:
> -How do I go about checking for external variables, as defined by a shell?
> -How do I go about checking for variables as defined in make.conf?
> -What do variable definitions generally look like in each of these
> cases, ie what's the difference between $$VAR, ${VAR}, and VAR?
AFAIK there is no way to differentiate between environmental variables and
ones set in a makefile. (or ones passed in via the command line)
I don't think $$FOO is a valid construct, also there is no difference between
$(FOO) ${FOO}, $FOO means ${F}OO.
> The reason why I'm asking is because I'm trying to make a set of
> FreeBSD makefiles and the following type of declaration doesn't work for
> some odd reason..
>
> .ifdef $$VAR
> @echo define $$VAR please!
> .else
> #do something to build program
> .endif
Try
.if !defined(VAR)
...
--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)
iD8DBQBFRAjr5ZPcIHs/zowRArE6AJ0avQHpO7GAHf96MEjSdIwt7FH9LwCfcY7q
t+jxWtqCxRn3RMNF980XecM=
=rs2t
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610291220.35363.doconnor>
