help-make
[Top][All Lists]
Advanced

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

Re: Linking inside of pattern rules


From: Paul Smith
Subject: Re: Linking inside of pattern rules
Date: Fri, 03 Jan 2020 11:47:55 -0500
User-agent: Evolution 3.34.1-2

On Sun, 2019-12-22 at 17:02 +0000, Bogdan wrote:
> I'd also like to be able to link each executable with the appropriate set
> of libraries. However, I'm not entirely sure how to select them when the
> pattern rule gets executed (other than a hacky solution, like associating
> each executable with a .link file and then doing something like $(CC)
> $(LDFLAGS) -o $@ $< `cat $@.link` but that's pretty horrid).
> 
> I should note that I am trying to limit myself to POSIX make, including
> features coming to Issue 8 of the specification (there are quite a few
> things that GNU Make already has, fortunately). But if that's not at all
> possible, I might use a GNU Make-specific feature.

I don't really understand what you're trying to do; an example might help.

However, from what I do understand why don't you use recursive variable
names?  This feature is widely available in all versions of make and I
think it's going to be added to the standard:

  exe1_LIBS = -lfoo -lbar
  exe2_LIBS = -lbiz -lbaz

  exe%: ...
          ... $($@_LIBS)





reply via email to

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