Ryan Berdeen wrote:
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.

That's happening because you used := which means that the variable 'target' is getting fully evaluated when it is defined. At that moment $@ is not defined and hence 'target' is empty.

If you changed the line to:

    $(TARGETS) : target = $@

then it would work.

Here's a simple example:

    all: i_am = $@
    all: ; @echo I am $(i_am)

which will output:

    I am all

John.
--
John Graham-Cumming
[EMAIL PROTECTED]

Home: http://www.jgc.org/
Blog: http://www.jgc.org/blog/

POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/

Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/


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

Reply via email to