bug-make
[Top][All Lists]
Advanced

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

Re: Bug or is it me?


From: Ted Stern
Subject: Re: Bug or is it me?
Date: Mon, 08 Dec 2003 11:31:22 -0800
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

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)





reply via email to

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