On  5.07.05, kamaraju kusumanchi wrote:
> %.o : %.c
>     $(CC) $(FLAGS) -c $< -o $@
> 
> To produce both static and shared libraries, I need two such rules. Can 
> someone tell me how to do that?

You can use an additional suffix .lo (or anything else) for pic-enabled
objects:

%.lo : %.c
        $(CC) $(CFLAGS) -fPIC -c $< -o $@

libyours.so: file.lo anotherfile.lo evenmore.lo
        $(CC) $(LDFLAGS) -shared -o $@ $?

    René

Attachment: pgp7vq8Iqblnl.pgp
Description: PGP signature

Reply via email to