On Mon, 2007-01-08 at 14:37 +0100, Pelle Svensson wrote:

> src-files := A/foo.c A/bar.c
> dst-files := B/foo.c B/bar.c
> 
> all: $(dst-files)
> 
> $(dst-files) : $(src-files)
>       mkdir -p $(dir $@)
>       cp -l $< $@

Yeah, that won't do what you want.

A rule like this:

  a b c d : e f g h

is shorthand for this:

  a : e f g h
  b : e f g h
  c : e f g h
  d : e f g h

You can write a pattern rule to do what you want:

B/%.c : A/%.c
        mkdir -p $(@D)
        cp -l $< $@

all: $(dst-files)

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to