[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ifneq inside a function
From: |
Ken Smith |
Subject: |
Re: ifneq inside a function |
Date: |
Thu, 26 Aug 2004 17:26:21 -0400 |
User-agent: |
Mutt/1.5.6i |
On Thu, Aug 26, 2004 at 04:14:23PM -0400, Paul D. Smith wrote:
> %% Ken Smith <address@hidden> writes:
>
> ks> I can't justify to myself why this makefile
> ks> define something
> ks> ifneq (,)
> ks> $(warning weird)
> ks> endif
> ks> endef
>
> ks> $(call something)
>
> ks> generates the following output
>
> ks> testcase.mk:6: weird
> ks> testcase.mk:6: *** missing separator. Stop.
>
> The expansion of every variable and function must result in a single
> line. You cannot expand into multiple lines.
>
> There are two exceptions to this rule: first, you can expand into
> multiple lines within a command script, so something like this works:
>
> define FOO
> @echo hello
> @echo world
> endef
>
> foo:
> $(FOO)
>
> And second, the argument to the special $(eval ...) function can contain
> multiple lines.
>
>
> No other expansion can result in multiple lines being produced.
This clarifies things considerably. Thank you both for your help.
--
Ken Smith