On Thu, 2010-05-06 at 01:23 -0700, Payal wrote: > Hello all, > 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 the only way. > 2. How to define a target specific macro (with define)? This does not > work. > $ cat -vet Makefile > aaa : define foo$ > hi foo$ > endef$ In this version of GNU make you have to define the value separately, then assign it as a target-specific macro. I did some work on this in the next version of GNU make but it might not yet be fully implemented. This is tricky because you can have ifdef's inside the define, as well as outside, etc. define foo_value hi foo endef aaa: foo = $(foo_value) > 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 cannot. After the colon from a target you can have EITHER prerequisites or a semicolon/recipe combination, OR a target variable assignment. You cannot, ever, mix and match in the same target definition. -- ------------------------------------------------------------------------------- Paul D. Smith <[email protected]> Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
