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:[EMAIL PROTECTED]]
> Sent: Monday, March 04, 2002 2:59 AM
> To: [EMAIL PROTECTED]
> 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
> [EMAIL PROTECTED]
> http://mail.gnu.org/mailman/listinfo/help-make
> 

_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to