I've just started using GNU make (3.80), and I'm confused why the following doesn't work:

$(TARGETS): target := $@

The target variable remains empty.

According to the manual, "All variables that appear within the variable-assignment are evaluated within the context of the target" (http://www.gnu.org/software/make/manual/html_chapter/ make_6.html#SEC77). As far as I have been able to determine, inside the context of the target, $@ contains the name of the target.

Am I doing something wrong, misunderstanding the manual, or is something else going on? Is there a simple way to accomplish what I want?

Full disclosure:
I encountered this situation while completing a homework assignment on the recursive use of make. Since I wasn't able to use the above, I submitted my solution listing the targets as follows:
target1: target = target1
target2: target = target2
...

Thanks in advance for any assistance.

Ryan


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

Reply via email to