Dear all

I am trying to have a Makefile that can create both static (.a) and
dynamic (.so) library. I have no problem to build the static library and
updating it if a file is changed. When it comes to the dynamic library I
am able to build the dynamic library but I can not figure out how to
remove the objects *.o without to have to rebuild the .so
In fact I would that my .so should be rebuild  only if one of the .c is
newer than the .so file.

I have in my makefile

DYNAMIC=libtoto.so

dynamic: $(DYNAMIC)

$(DYNAMIC): $(OBJ)
  $(CC) -shared -o $@ $?
  $(RM) $?

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


Do you have any idea what I am doing wrong ?

Sincerely

Patrick Guio

======================================================================

                            Patrick Guio
          Institute of Theoretical Astrophysics, University of Oslo
                  P.O. box 1029, Blindern, N-0315 Oslo
          Tel : (+47) 22 85 65 19 - Fax : (+47) 22 85 65 05
                    E-mail : [EMAIL PROTECTED] 
                    URL : http://www.astro.uio.no

Reply via email to