On 8 Dec 2003, Jörn von Holten wrote:
>
> # > make a b
> # Once or Twice: lala a
> # Once or Twice: lala b
> # > make a
> # Once or Twice: lala a
> # > make
> # Once or Twice: lala a lala a
> # Once or Twice: lala b lala b
> #
> # The last one is interesting!
> #
> # > make -v
> # GNU Make 3.80
>
> all: a b
> SING := Once or Twice:
> %: SING += lala $@
> a b: ; @echo $(SING)
Hmm, I've never used target-specific variables in a pattern rule.
Also, since target-specific variables look like dependency specifications to
me, I put them after command-containing target rules.
So I'd write this ias
# Variable declarations
SING := Once or Twice:
# Target definitions
.PHONY: all
all: a b
a b: ; @echo $(SING)
# Dependencies
a b: SING += lala $@
which produces what you want when you enter "make" with no arguments. But I
can't really explain why! Maybe Paul can do better ...
Ted
--
Ted Stern Applications Group
Cray Inc. office: 206-701-2182
411 First Avenue South, Suite 600 cell: 206-383-1049
Seattle, WA 98104-2860 FAX: 206-701-2500
Frango ut patefaciam -- I break that I may reveal
(The Paleontological Society motto, equally apropos for debugging)
___
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make