help-make
[Top][All Lists]
Advanced

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

Re: handling two types of prerequisites differently in pattern rule


From: Philip Guenther
Subject: Re: handling two types of prerequisites differently in pattern rule
Date: Thu, 4 Mar 2010 18:30:37 -0800

On Thu, Mar 4, 2010 at 5:38 PM, Galen Seitz <address@hidden> 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.
...
> %$(ABS) : $(LD_SCRIPT) $(OBJS)
>        $(CC) $(LDFLAGS) $(TARGET_ARCH) $(filter-out %.x,$^) \
>          $(LOADLIBES) $(LDLIBS) -o $@
>
> Is there a better way to deal with a case like this where one of the
> prerequisites needs special treatment?  Or should I give up on the idea of a
> using generic pattern rule.

Using $(filter-out %.x,$^) or $(filter %.o,$^) seems like exactly the
right solution to me.  I used $(filter) when I did it for a project
some years ago.


Philip Guenther




reply via email to

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