forked from XyjVam/levmarcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.so
More file actions
49 lines (38 loc) · 1.79 KB
/
Makefile.so
File metadata and controls
49 lines (38 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
# Unix/Linux GCC Makefile for Levenberg - Marquardt minimization
# Under windows, use Makefile.vc for MSVC
#
# major & minor shared lib numbers
MAJ=2
MIN=2
ODIR=sobj # where to place object files for shared lib
CC=gcc
CONFIGFLAGS=-ULINSOLVERS_RETAIN_MEMORY
#ARCHFLAGS=-march=pentium4 # YOU MIGHT WANT TO UNCOMMENT THIS FOR P4
CFLAGS=-fPIC $(CONFIGFLAGS) $(ARCHFLAGS) -O3 -funroll-loops -Wall #-pg
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.
# On systems with a FORTRAN (not f2c'ed) version of LAPACK, -lf2c is
# not necessary; on others, -lf2c is equivalent to -lF77 -lI77
LIBS=$(LAPACKLIBS)
$(ODIR)/liblevmar.so.$(MAJ).$(MIN): $(LIBOBJS)
$(CC) -shared -Wl,-soname,liblevmar.so.$(MAJ) -o $(ODIR)/liblevmar.so.$(MAJ).$(MIN) $(LIBOBJS) #-llapack -lblas -lf2c
# implicit rule for generating *.o files in ODIR from *.c files
$(ODIR)/%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(ODIR)/lm.o: lm.c lm_core.c levmar.h misc.h compiler.h
$(ODIR)/Axb.o: Axb.c Axb_core.c levmar.h misc.h
$(ODIR)/misc.o: misc.c misc_core.c levmar.h misc.h
$(ODIR)/lmlec.o: lmlec.c lmlec_core.c levmar.h misc.h
$(ODIR)/lmbc.o: lmbc.c lmbc_core.c levmar.h misc.h compiler.h
$(ODIR)/lmblec.o: lmblec.c lmblec_core.c levmar.h misc.h
$(ODIR)/lmbleic.o: lmbleic.c lmbleic_core.c levmar.h misc.h
clean:
@rm -f $(LIBOBJS)
cleanall: clean
@rm -f $(ODIR)/liblevmar.so.$(MAJ).$(MIN)
depend:
makedepend -f Makefile $(LIBSRCS)
# DO NOT DELETE THIS LINE -- make depend depends on it.