Ticket #13779: patch-Makefile

File patch-Makefile, 900 bytes (added by febeling (Florian Ebeling), 17 years ago)

adds creation of libraries for OS X

Line 
1--- Makefile.orig       2008-01-01 23:53:47.000000000 +0100
2+++ Makefile    2008-01-02 11:15:00.000000000 +0100
3@@ -1,7 +1,7 @@
4 CXX? = g++
5-CFLAGS = -Wall -O3
6+CFLAGS = -Wall -O3 -fno-common
7 
8-all: svm-train svm-predict svm-scale
9+all: svm-train svm-predict svm-scale libsvm.a libsvm.dylib
10 
11 svm-predict: svm-predict.c svm.o
12        $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm
13@@ -11,5 +11,14 @@
14        $(CXX) $(CFLAGS) svm-scale.c -o svm-scale
15 svm.o: svm.cpp svm.h
16        $(CXX) $(CFLAGS) -c svm.cpp
17+libsvm.a: svm.o
18+       ar rc libsvm.a svm.o
19+       ranlib libsvm.a
20+libsvm.dylib: svm.o
21+       $(CXX) $(CFLAGS) -dynamiclib -install_name $(PREFIX)/lib/libsvm.dylib \
22+                         -current_version $(VERSION) \
23+                         -compatibility_version $(VERSION) \
24+                         -o libsvm.$(VERSION).dylib svm.o
25 clean:
26        rm -f *~ svm.o svm-train svm-predict svm-scale
27+       rm -f *.a *.dylib