Dumb question re makefile variables

Joerg Sonnenberger joerg at britannica.bec.de
Thu Jan 6 13:31:55 PST 2005


On Thu, Jan 06, 2005 at 12:57:41PM -0800, walt wrote:
> Okay, I understand that the typical '#define FOO 1' statement
> in a C header file is read by the C pre-processor, and the
> similar FOO=1 in a Makefile is read my 'make', and a shell
> environment variable (setenv FOO 1) is read by the shell.

Shell environment variable are normally exported for csh or must
be marked as such for sh/ksh/zsh. Those being default values for
Makefile variables and can be overriden by them. Makefile variables
can also be specified on the command line and in that case _override_
all other assigments.

Both types are not related to preprocessor variables. Those are normally
added via CPPFLAGS, CFLAGS or CXXFLAGS.

Joerg





More information about the Users mailing list