help-make
[Top][All Lists]
Advanced

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

Quoting when passing variables via $(MAKE)


From: Greg Chicares
Subject: Quoting when passing variables via $(MAKE)
Date: Tue, 31 Jan 2006 17:14:23 +0000
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

In the example below, shouldn't
  foo='$(foo)'
with single quotes pass the string
  $(foo)
itself, instead of its value?

$cat pass_options.make
foo = xyz

.PHONY: all
all:
        $(MAKE) -f receive_options.make foo=$(foo)
        $(MAKE) -f receive_options.make foo='$(foo)'
        $(MAKE) -f receive_options.make foo="$(foo)"

$cat receive_options.make
.PHONY: all
all:
        echo foo is $(foo)

$/tmp/make-3.81beta4/make -s -f pass_options.make
foo is xyz
foo is xyz
foo is xyz

I'm using beta4, but older versions seem to work the same way.




reply via email to

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