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

  sd> But the idea I'm trying to implement is simple:
  sd> Suppose I'm having the list of source files. These files can be located
  sd> anywhere.
  sd> All I need is to compile each source file and place the result (.o) into
  sd> some specific directory.

  sd> (let's suppose sources have different file names, i.e. there no
  sd> dir1/file1 and dir2/file1)

If that's true then there's a very simple solution: use VPATH.
Write your makefile like this:

  SOURCES = ...

  VPATH = $(sort $(dir $(SOURCES)))

  dir3/subdir3/%.o : %.c
            $(CC) $(CFLAGS) -c -o $@ $<

All done!

  sd> Unfortunately, I cannot upgrade to 3.81 since it is a company
  sd> policy now to use 3.80. But probably I could try to convince
  sd> others that we need 3.81.

Well there are a number of bugs in 3.80 that are fixed in 3.81.  But
you may not need any of the newer 3.81 features for what you want to
do.

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