Ticket #36889: patch-Makefile.so.diff

File patch-Makefile.so.diff, 2.4 KB (added by lockhart (Thomas Lockhart), 12 years ago)

Support both atlas and Apple libraries. This is a full file rather than a patch on a patch.

  • Makefile.so

    old new  
    66# major & minor shared lib numbers
    77MAJ=2
    88MIN=2
    9 ODIR=sobj # where to place object files for shared lib
     9# ODIR defines where to place object files for shared lib
     10ODIR=sobj
    1011CC=gcc
    1112CONFIGFLAGS=-ULINSOLVERS_RETAIN_MEMORY
    1213#ARCHFLAGS=-march=pentium4 # YOU MIGHT WANT TO UNCOMMENT THIS FOR P4
     
    1415LAPACKLIBS_PATH=/usr/local/lib # WHEN USING LAPACK, CHANGE THIS TO WHERE YOUR COMPILED LIBS ARE!
    1516LIBOBJS=$(ODIR)/lm.o $(ODIR)/Axb.o $(ODIR)/misc.o $(ODIR)/lmlec.o $(ODIR)/lmbc.o $(ODIR)/lmblec.o $(ODIR)/lmbleic.o
    1617LIBSRCS=lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c lmbleic.c
    17 LAPACKLIBS=-llapack -lblas -lf2c # comment this line if you are not using LAPACK.
     18DEMOBJS=lmdemo.o
     19DEMOSRCS=lmdemo.c
     20# -lf2c removed from LAPACKLIBS for Fedora
     21# comment the following line if you are not using LAPACK.
     22LAPACKLIBS=-llapack -lblas
    1823                                 # On systems with a FORTRAN (not f2c'ed) version of LAPACK, -lf2c is
    1924                                 # not necessary; on others, -lf2c is equivalent to -lF77 -lI77
    2025
    2126LIBS=$(LAPACKLIBS)
    2227
    23 $(ODIR)/liblevmar.so.$(MAJ).$(MIN): $(LIBOBJS)
    24         $(CC) -shared -Wl,-soname,liblevmar.so.$(MAJ) -o $(ODIR)/liblevmar.so.$(MAJ).$(MIN) $(LIBOBJS) #-llapack -lblas -lf2c
     28all: $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib lmdemo
     29
     30$(ODIR)/liblevmar.$(MAJ).$(MIN).dylib: $(LIBOBJS)
     31        $(CC) -shared -Wl,-install_name,@rpath/liblevmar.$(MAJ).dylib -o $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib $(LIBOBJS) $(LIBS)
     32
     33$(ODIR)/liblevmar.dylib: $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib
     34        ln -s liblevmar.$(MAJ).$(MIN).dylib $(ODIR)/liblevmar.dylib
     35        ln -s liblevmar.$(MAJ).$(MIN).dylib $(ODIR)/liblevmar.$(MAJ).dylib
    2536
    2637# implicit rule for generating *.o files in ODIR from *.c files
    2738$(ODIR)/%.o : %.c
     
    3646$(ODIR)/lmblec.o: lmblec.c lmblec_core.c levmar.h misc.h
    3747$(ODIR)/lmbleic.o: lmbleic.c lmbleic_core.c levmar.h misc.h
    3848
     49lmdemo.o: levmar.h
     50
     51lmdemo: $(DEMOBJS) $(ODIR)/liblevmar.dylib
     52        $(CC) $(LDFLAGS) $(DEMOBJS) -o lmdemo -L$(ODIR) -llevmar $(LIBS) -lm # -u MAIN__
     53
    3954clean:
    4055        @rm -f $(LIBOBJS)
    4156
    4257cleanall: clean
    43         @rm -f $(ODIR)/liblevmar.so.$(MAJ).$(MIN)
     58        @rm -f $(ODIR)/liblevmar.$(MAJ).$(MIN).dylib
    4459
    4560depend:
    46         makedepend -f Makefile $(LIBSRCS)
     61        makedepend -f Makefile $(LIBSRCS) $(DEMOSRCS)
    4762
    4863# DO NOT DELETE THIS LINE -- make depend depends on it.
    4964