[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Only one pattern-specific variable assignment per target

From: Bob Byrnes
Subject: Only one pattern-specific variable assignment per target
Date: Thu, 3 Jul 2003 16:45:00 -0400

Put this in a Makefile:

  foo.%bc: FIRST=first
  foo.a%c: SECOND=second
  foo.abc: THIRD=third

  foo.abc: ; @echo $(FIRST) $(SECOND) $(THIRD)

Run "make".  We believe that it *should* print "first second third",
but instead it prints "first third".

If you swap the order of the first and second lines, it instead prints
"second third".

This is because Make only interprets one pattern-specific variable
assignment for each target.  This behavior does not seem to be documented,
and we don't think it's correct.

We've observed this behavior in make 3.77, 3.78.1, 3.79.1, and 3.80.

We have a patch to fix the problem, if you're interested.

Bob Byrnes                        e-mail: address@hidden
Curl Corporation                  phone:  617-761-1200
1 Cambridge Center, 10th Floor    fax:    617-761-1201
Cambridge, MA 02142-1612

reply via email to

[Prev in Thread] Current Thread [Next in Thread]