URL:
<http://savannah.gnu.org/bugs/?21661>
Summary: Make expands command-line variable defnitions
after/during every command invocation
Project: make
Submitted by: bobbogo
Submitted on: Wednesday 28/11/07 at 16:43
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 3.81
Operating System: Any
Fixed Release: None
_______________________________________________________
Details:
(Eh, what? I don't really know how to rationalise this.) It seems that
something like "var=def" specified on the command line will be evaluated after
each rule is run. Consider:
$ cat Makefile
tgts := 1 2 3 4 5
.PHONY: all ${tgts}
all: ${tgts}
all ${tgts}:
echo 'Commands for [EMAIL PROTECTED]'
This runs fine:
$ make
echo 'Commands for [1]'
Commands for [1]
echo 'Commands for [2]'
Commands for [2]
echo 'Commands for [3]'
Commands for [3]
echo 'Commands for [4]'
Commands for [4]
echo 'Commands for [5]'
Commands for [5]
echo 'Commands for [all]'
However, try adding a command-line definition
$ make 'var=$(warning hello)'
echo 'Commands for [1]'
make: hello
Commands for [1]
echo 'Commands for [2]'
make: hello
Commands for [2]
echo 'Commands for [3]'
make: hello
Commands for [3]
echo 'Commands for [4]'
make: hello
Commands for [4]
echo 'Commands for [5]'
make: hello
Commands for [5]
echo 'Commands for [all]'
make: hello
Commands for [all]
Make seems to be expanding the expression "var=$(warning hello)". This is
very annoying --- it precludes doing something like 'fixme=$(error urk)' on
the command-line.
Present in make-3.81-10.fc8.x86_64 on Fedora 8, the system make on MacOS
10.5.1, and the current cygwin make (all 3.81).
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?21661>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make