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

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

Justin Pryzby wrote:

On Tue, Jul 05, 2005 at 12:54:11PM -0400, kamaraju kusumanchi wrote:
I am thinking of packaging fortranposix library. The upstream provides a makefile which creates only the shared library. Now my question is

1) Should I edit the make file to create a static library as well?
Eventually, you should probably do that.
Thanks for the response. The problem I faced with makefile editing is that, shared libraries' object files need the -fPIC option while the static library's object files should not be built with that.

In my makefile, I have a single rule to convert .c files to .o files. It goes like

%.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?


Kamaraju S Kusumanchi
Graduate Student, MAE
Cornell University

Reply to: