On Thu, May 6, 2010 at 1:23 AM, Payal <[email protected]> wrote:
> I have a few simple doubts. Can someone help with them, please?
>
> 1. In target specific variables, how can I define multiple vars. Is
> this the only way,
> X : a=foo
> X : b=bar

Yes, that's on the only way.  You can only define one variable per line, period.


> 2. How to define a target specific macro (with define)? This does not
> work.
> $ cat -vet Makefile
> aaa : define foo$
> hi foo$
> endef$
> $
> aaa :$
> ^Iecho $(foo)$
> $

Not directly, but this works:

define foo_a
echo foo
echo bar
endef
aaa: foo=${foo_a}
aaa:
        echo ${foo}


> 3. A silly query. In a rule, after target : prereq. can only these
> things come,
> a. a shell command (after a hard tab)
> b. a make comment
>
> Can't we give "make" variables or functions there? If yes, can someone
> give simple example or two please?

You can't combine on a single line the specifying of a prerequisite
for a target with the assignment of a target-specific variable, if
that's what you're wondering about.

(If that isn't what you're wondering about, well, "what problem are
you trying to solve?")


Philip Guenther


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to