From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 29 01:50:46 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1BAE16A412 for ; Sun, 29 Oct 2006 01:50:46 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9F4143D5A for ; Sun, 29 Oct 2006 01:50:43 +0000 (GMT) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (ppp222-190.lns2.adl4.internode.on.net [203.122.222.190]) (authenticated bits=0) by cain.gsoft.com.au (8.13.5/8.13.4) with ESMTP id k9T1odDK017960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Oct 2006 12:20:39 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org Date: Sun, 29 Oct 2006 11:20:21 +0930 User-Agent: KMail/1.9.4 References: <4543F878.2020006@u.washington.edu> In-Reply-To: <4543F878.2020006@u.washington.edu> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1926769.yE4iDYJp9d"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200610291220.35363.doconnor@gsoft.com.au> X-Spam-Score: -2.304 () AWL,BAYES_00 X-Scanned-By: MIMEDefang 2.57 on 203.31.81.10 Cc: Garrett Cooper Subject: Re: How to write a FreeBSD-style makefile : checking for external vars existence? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Oct 2006 01:50:46 -0000 --nextPart1926769.yE4iDYJp9d Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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= =20 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 betwe= en=20 $(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 =2Eif !defined(VAR) =2E.. =2D-=20 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 --nextPart1926769.yE4iDYJp9d Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBFRAjr5ZPcIHs/zowRArE6AJ0avQHpO7GAHf96MEjSdIwt7FH9LwCfcY7q t+jxWtqCxRn3RMNF980XecM= =rs2t -----END PGP SIGNATURE----- --nextPart1926769.yE4iDYJp9d--