How to write a FreeBSD-style makefile : checking for external vars existence?

Garrett Cooper youshi10 at u.washington.edu
Sun Oct 29 00:40:51 UTC 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
	I was just wondering...

- -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?

	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

	Make reports errors in the above case if I put anything in other
than VAR, which is confusing given my knowledge of shell scripting and
so on.
	TIA,
- -Garrett
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFQ/h36CkrZkzMC68RAv9jAJ4wrk2LKzOYwEoXFmjcCrCh4eEewgCeKTwj
+7BbbZ5ThjGJiOUZARwmoos=
=/FVX
-----END PGP SIGNATURE-----


More information about the freebsd-hackers mailing list