help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

defining variables in canned sequences


From: Robert Mecklenburg
Subject: defining variables in canned sequences
Date: 14 Oct 2003 11:52:38 -0600

################################################################
define make-variables
FOO = foo
BAR = bar
endef

$(make-variables)

echo:
        # $(FOO)
        # $(BAR)
################################################################

When executed make reports

  Makefile:5: *** missing separator.  Stop.

Why?

I know I can resolve the issue by wrapping the variable expansion in
$(eval ), but that isn't my question.  I just want to know why the
expansion generates the error.  The define construct explicitly
preserves newlines in the expansion so I would think the parser would
simply see two assignments separated by a newline.  Evidently not.

I've just managed to build make from CVS with some trouble (if you
want, I can report my problems more properly), so I'll dive in with
gdb right now, but maybe someone on the list is willing to lend me
their insight.

Thanks,
--
Robert





reply via email to

[Prev in Thread] Current Thread [Next in Thread]