--- levmar-2.6.orig/Makefile.so 2009-12-04 13:26:31.000000000 -0800
+++ levmar-2.6/Makefile.so 2012-03-03 13:41:25.000000000 -0800
# major & minor shared lib numbers
-ODIR=sobj # where to place object files for shared lib
+# ODIR defines where to place object files for shared lib
CONFIGFLAGS=-ULINSOLVERS_RETAIN_MEMORY
#ARCHFLAGS=-march=pentium4 # YOU MIGHT WANT TO UNCOMMENT THIS FOR P4
LAPACKLIBS_PATH=/usr/local/lib # WHEN USING LAPACK, CHANGE THIS TO WHERE YOUR COMPILED LIBS ARE!
LIBOBJS=$(ODIR)/lm.o $(ODIR)/Axb.o $(ODIR)/misc.o $(ODIR)/lmlec.o $(ODIR)/lmbc.o $(ODIR)/lmblec.o $(ODIR)/lmbleic.o
LIBSRCS=lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c lmbleic.c
-LAPACKLIBS=-llapack -lblas -lf2c # comment this line if you are not using LAPACK.
+# -lf2c removed from LAPACKLIBS for Fedora
+# comment the following line if you are not using LAPACK.
+LAPACKLIBS=-llapack -lblas
# On systems with a FORTRAN (not f2c'ed) version of LAPACK, -lf2c is
# not necessary; on others, -lf2c is equivalent to -lF77 -lI77
-$(ODIR)/liblevmar.so.$(MAJ).$(MIN): $(LIBOBJS)
- $(CC) -shared -Wl,-soname,liblevmar.so.$(MAJ) -o $(ODIR)/liblevmar.so.$(MAJ).$(MIN) $(LIBOBJS) #-llapack -lblas -lf2c
+all: $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib lmdemo
+$(ODIR)/liblevmar.$(MAJ).$(MIN).dylib: $(LIBOBJS)
+ $(CC) -shared -Wl,-install_name,@rpath/liblevmar.$(MAJ).dylib -o $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib $(LIBOBJS) $(LIBS)
+$(ODIR)/liblevmar.dylib: $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib
+ ln -s liblevmar.$(MAJ).$(MIN).dylib $(ODIR)/liblevmar.dylib
+ ln -s liblevmar.$(MAJ).$(MIN).dylib $(ODIR)/liblevmar.$(MAJ).dylib
# implicit rule for generating *.o files in ODIR from *.c files
$(ODIR)/lmblec.o: lmblec.c lmblec_core.c levmar.h misc.h
$(ODIR)/lmbleic.o: lmbleic.c lmbleic_core.c levmar.h misc.h
+lmdemo: $(DEMOBJS) $(ODIR)/liblevmar.dylib
+ $(CC) $(LDFLAGS) $(DEMOBJS) -o lmdemo -L$(ODIR) -llevmar $(LIBS) -lm # -u MAIN__
- @rm -f $(ODIR)/liblevmar.so.$(MAJ).$(MIN)
+ @rm -f $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib
- makedepend -f Makefile $(LIBSRCS)
+ makedepend -f Makefile $(LIBSRCS) $(DEMOSRCS)
# DO NOT DELETE THIS LINE -- make depend depends on it.