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

Re: should I create both static and shared libraries manually?



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: pgpZi5iOo0tAE.pgp
Description: PGP signature


Reply to: