%% Darin Johnson <[EMAIL PROTECTED]> writes:

  dj> I've got over 100 libraries to link in a final build, and the
  dj> command lines are extremely long.  I'd like to use the "-lthing"
  dj> syntax with a "-L" flag to shorten things.  What I've got now is
  dj> something like:

  dj>     mytarget: $(OBJS) $(LIBRARIES)
  dj>     ...
  dj>     # in a "rules.mk" file
  dj>     $(outdir)/%.elf:
  dj>             $(LINK.o) $^ $(LDLIBS) -o $@

  dj> But the $^ expands into full paths.

You have two choices:

 1) Use the "-lfoo" syntax on the prerequisites list, and make sure that
    the directory containing the libraries is listed via VPATH or vpath.

    See the GNU make manual for how make handles these special
    prerequisites.

 2) Use functions to manipulate the contents of $^ when you run the
    shell.  Because it's a requirement that the libraries keep their
    same order, this is very tricky to do.  I expect you'll need to use
    eval to do it.  I suggest using option #1 :-)

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