Follow-up Comment #7, bug #51974 (project make):

Either the 'new' documentation is not entirely correct, or there is a bug in
the current expansion logic (or I am misunderstanding something).

The documentation states:

----
4. Expand elements of the line which appear in an immediate expansion context
(see How make Reads a Makefile).
5. Scan the line for a separator character, such as ‘:’ or ‘=’, to
determine whether the line is a macro assignment or a rule (see Recipe
Syntax).
6. Internalize the resulting operation and read the next line.

An important consequence of this is that a macro can expand to an entire rule,
if it is one line long.
----

The last statement assumes that a line containing only a variable reference,
such as


$(myrule)


presents an immediate expansion context, although it does not meet any of the
stated forms of an immediate expansion context.

If it were, then this should also work:


myassignment = var = val

$(myassignment)


Step 5 of the list above would apply to the last line of this example (it
expands to 'var = val'). However, make fails with a "missing separator" error.
A slightly different error, "empty variable name", results from this
variation:


myassignment = var := val

$(myassignment)


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?51974>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


Reply via email to