bug-make
[Top][All Lists]
Advanced

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

[bug #21661] Make expands command-line variable defnitions after/during


From: Robert Bogomip
Subject: [bug #21661] Make expands command-line variable defnitions after/during every command invocation
Date: Wed, 28 Nov 2007 16:43:38 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.8.1.9) Gecko/20071105 Fedora/2.0.0.9-1.fc8 Firefox/2.0.0.9 pango-text

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 address@hidden'


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/





reply via email to

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