diff -up levmar-2.5/Makefile.so.shared levmar-2.5/Makefile.so
old
|
new
|
|
6 | 6 | # major & minor shared lib numbers |
7 | 7 | MAJ=2 |
8 | 8 | MIN=2 |
9 | | ODIR=sobj # where to place object files for shared lib |
| 9 | # ODIR defines where to place object files for shared lib |
| 10 | ODIR=sobj |
10 | 11 | CC=gcc |
11 | 12 | CONFIGFLAGS=-ULINSOLVERS_RETAIN_MEMORY |
12 | 13 | #ARCHFLAGS=-march=pentium4 # YOU MIGHT WANT TO UNCOMMENT THIS FOR P4 |
… |
… |
CFLAGS=-fPIC $(CONFIGFLAGS) $(ARCHFLAGS) |
14 | 15 | LAPACKLIBS_PATH=/usr/local/lib # WHEN USING LAPACK, CHANGE THIS TO WHERE YOUR COMPILED LIBS ARE! |
15 | 16 | LIBOBJS=$(ODIR)/lm.o $(ODIR)/Axb.o $(ODIR)/misc.o $(ODIR)/lmlec.o $(ODIR)/lmbc.o $(ODIR)/lmblec.o $(ODIR)/lmbleic.o |
16 | 17 | LIBSRCS=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. |
| 18 | DEMOBJS=lmdemo.o |
| 19 | DEMOSRCS=lmdemo.c |
| 20 | # -lf2c removed from LAPACKLIBS for Fedora |
| 21 | # comment the following line if you are not using LAPACK. |
| 22 | LAPACKLIBS=-llapack -lblas |
18 | 23 | # On systems with a FORTRAN (not f2c'ed) version of LAPACK, -lf2c is |
19 | 24 | # not necessary; on others, -lf2c is equivalent to -lF77 -lI77 |
20 | 25 | |
21 | 26 | LIBS=$(LAPACKLIBS) |
22 | 27 | |
| 28 | all: $(ODIR)/liblevmar.so.$(MAJ).$(MIN) lmdemo |
| 29 | |
23 | 30 | $(ODIR)/liblevmar.so.$(MAJ).$(MIN): $(LIBOBJS) |
24 | | $(CC) -shared -Wl,-soname,liblevmar.so.$(MAJ) -o $(ODIR)/liblevmar.so.$(MAJ).$(MIN) $(LIBOBJS) #-llapack -lblas -lf2c |
| 31 | $(CC) -shared -Wl,-install_name,@rpath/liblevmar.so.$(MAJ) -o $(ODIR)/liblevmar.so.$(MAJ).$(MIN) $(LIBOBJS) $(LIBS) |
| 32 | |
| 33 | $(ODIR)/liblevmar.so: $(ODIR)/liblevmar.so.$(MAJ).$(MIN) |
| 34 | ln -s liblevmar.so.$(MAJ).$(MIN) $(ODIR)/liblevmar.so |
25 | 35 | |
26 | 36 | # implicit rule for generating *.o files in ODIR from *.c files |
27 | 37 | $(ODIR)/%.o : %.c |
… |
… |
$(ODIR)/lmbc.o: lmbc.c lmbc_core.c levma |
36 | 46 | $(ODIR)/lmblec.o: lmblec.c lmblec_core.c levmar.h misc.h |
37 | 47 | $(ODIR)/lmbleic.o: lmbleic.c lmbleic_core.c levmar.h misc.h |
38 | 48 | |
| 49 | lmdemo.o: levmar.h |
| 50 | |
| 51 | lmdemo: $(DEMOBJS) $(ODIR)/liblevmar.so |
| 52 | $(CC) $(LDFLAGS) $(DEMOBJS) -o lmdemo -L$(ODIR) -llevmar $(LIBS) -lm # -u MAIN__ |
| 53 | |
39 | 54 | clean: |
40 | 55 | @rm -f $(LIBOBJS) |
41 | 56 | |
… |
… |
cleanall: clean |
43 | 58 | @rm -f $(ODIR)/liblevmar.so.$(MAJ).$(MIN) |
44 | 59 | |
45 | 60 | depend: |
46 | | makedepend -f Makefile $(LIBSRCS) |
| 61 | makedepend -f Makefile $(LIBSRCS) $(DEMOSRCS) |
47 | 62 | |
48 | 63 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
49 | 64 | |