bug-make
[Top][All Lists]
Advanced

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

meaning of # in the variable used as a list of targets


From: Arkadiusz Drabczyk
Subject: meaning of # in the variable used as a list of targets
Date: Sun, 26 Feb 2023 19:19:34 +0100

In the manual it says:

"Within a @code{define} directive, comments are not ignored during the
definition of the variable, but rather kept intact in the value of the
variable.  When the variable is expanded they will either be treated
as @code{make} comments or as recipe text, depending on the context in
which the variable is evaluated."

But take the following example:

define var
1 2 3 #something
endef

$(info $$var is [${var}])

$(var):
        echo target from a variable

It's possible to call \#something target:

$ make \#something
$var is [1 2 3 #something]
echo target from a variable
target from a variable

$(var) is not a _recipe text_ so according to the manual it should be
treated as a comment like that:

1 2 3 #something:
        echo target from a variable

which should result in

$ make \#something
$var is [1 2 3 #something]
Makefile:7: *** missing separator.  Stop.

right? Is this an oversight in the manual?

-- 
Arkadiusz Drabczyk <arkadiusz@drabczyk.org>



reply via email to

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