On Thu, Mar 4, 2010 at 8:38 PM, Galen Seitz <[email protected]> wrote:

> I would like to list both the object files and linker script as
> prerequisites to linker pattern rule.  However the linker script needs to
> appear as an argument to a linker option.  I'm having trouble coming up with
> a clean way to handle this.  Here is what I've come up with.

    In this situation, I generally do:

%$(ABS) : $(LD_SCRIPT) $(OBJS)
-       $(CC) $(LDFLAGS) $(TARGET_ARCH) $(filter-out %.x,$^) \
+       $(CC) $(LDFLAGS) $(TARGET_ARCH) $(OBJS) \
         $(LOADLIBES) $(LDLIBS) -o $@

    Rationale: if you later have additional dependencies, they'll also
have to be filtered out, and anything that goes into that part of the
command line for the link is going to belong in $(OBJS) anyways.

                                                   Todd.

-- 
 Todd Showalter, President,
 Electron Jump Games, Inc.


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

Reply via email to