help-make
[Top][All Lists]
Advanced

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

Linking rule advice


From: Darin Johnson
Subject: Linking rule advice
Date: Sat, 4 Jun 2005 17:27:53 -0700 (GMT-07:00)

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

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

But the $^ expands into full paths.  If I put the libraries into LDLIBS and
not as a dependency, then make doesn't know to relink if a library is
modified.  Other solutions I've seen look like:

    $(LINK.o) $(OBJS) $(LDLIBS) ...

But that doesn't work to well in a pattern rule.  What do others do for this
sort of thing?  Is it not worth bothering to keep the command lines small
(I already have quiet vs. verbose flag)?

Darin Johnson




reply via email to

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