help-make
[Top][All Lists]
Advanced

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

RE: i need some smart rule


From: Miller, Bryan
Subject: RE: i need some smart rule
Date: Tue, 5 Mar 2002 09:06:53 -0800

How about

%.a: %.o: $(objects1)
        command1

%.a: %.o: $(objects2)
        command2

%.a: %.o: $(objects3)
        command3

where the dependencies for each rule would vary even if the rule does not?
I would recommend not prefacing the rule with the path (e.g. bin\) but
rather map that to the list of objects with $(addprefix) or something
similar.

Cheers,
Bryan

> -----Original Message-----
> From: Maciej Walezak [mailto:address@hidden
> Sent: Monday, March 04, 2002 2:59 AM
> To: address@hidden
> Subject: i need some smart rule
> 
> 
> 
> Hello,
> 
> I need several rules that would link binary files and each of 
> them with different commands, i.e. one for binaries from 
> objects from C sources, one for binaries from objects from 
> C++ sources and one for Fortran.
> I can not use pattern rule like this
> $(bin)/%: %
>       command
> because there is no way to distinguish the three rules.
> My current solution is
> $(bin)/$(cbin):
>       command1
> $(bin)/$(ccbin):
>       command2
> $(bin)/$(fbin):
>       command3
> I do not like this solution as it requires that appropriate 
> variable is defined and it prevents me from linking more that 
> one binary in single makefile (cbin is set to a concrete file).
> 
> Is there a way to write these rules in more flexible way?
> 
> --
> Maciej Walezak
> -GDN-
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-make
> 



reply via email to

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