Is the any new feature in 3.81 that addresses and simplifies solution
for this issue?

Well, the case when the source list can contain files with equal name I
will try to do myself :) Just because it is not blocking me right now...

Best regards,
Dmitry

-----Original Message-----
From: Paul Smith [mailto:[EMAIL PROTECTED] On Behalf Of Paul D. Smith
Sent: Friday, April 07, 2006 8:43 PM
To: Smirnov Dmitry
Cc: [email protected]
Subject: RE: Make: Filtering prerequisites

%% "Smirnov Dmitry" <[EMAIL PROTECTED]> writes:

  sd> Let's increase complexity: suppose I have few different source
lists and
  sd> compiled object should be placed in different directories (we need
2
  sd> rules obviously? dir3/subdir3/%.o and dir4/subdir4/%.o)
  sd> Those source lists MAY contain files that have equal file names.
  sd> How could I use VPATH in this case? 

You can't.  In this situation you'll have to use a bigger hammer.

I think you'll need to move to eval in this case.  Something like:

    SOURCES_1 = ...
    SOURCES_2 = ...

    COMPILE = $(CC) $(CFLAGS) -c -o $@ $<

    $(foreach S,$(SOURCES_1),$(eval dir3/subdir3/$(basename $(notdir
$(S))).o : $(S) ; $(value COMPILE)))

    $(foreach S,$(SOURCES_2),$(eval dir4/subdir4/$(basename $(notdir
$(S))).o : $(S) ; $(value COMPILE)))


(Note: not tested!)  Of course you can also use $(call ...) and define
and make an outer loop for the dir3, dir4 stuff, which might be cleaner.
You'll have to play with the escaping needed to get what you want
though.

-- 
------------------------------------------------------------------------
-------
 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