summaryrefslogtreecommitdiff
blob: b9b97e8a7cbd52e41dbdbcb7ecef0e305bf0db0a (plain)
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
--- Makefile.orig	2010-08-05 20:36:16.000000000 +0100
+++ Makefile	2010-08-05 21:30:42.000000000 +0100
@@ -1,19 +1,19 @@
-CXX ?= g++
-CFLAGS = -Wall -Wconversion -O3 -fPIC
 SHVER = 1
+PICFLAGS=-fPIC
 
-all: svm-train svm-predict svm-scale
+all: svm-train svm-predict svm-scale lib
 
 lib: svm.o
-	$(CXX) -shared -dynamiclib svm.o -o libsvm.so.$(SHVER)
+	$(CXX) $(LDFLAGS) -shared -Wl,-soname,libsvm.so.$(SHVER) svm.o -o libsvm.so.$(SHVER) -lm && \
+	ln -s libsvm.so.$(SHVER) libsvm.so
 
 svm-predict: svm-predict.c svm.o
-	$(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) svm-predict.c svm.o -o svm-predict -lm
 svm-train: svm-train.c svm.o
-	$(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) svm-train.c svm.o -o svm-train -lm
 svm-scale: svm-scale.c
-	$(CXX) $(CFLAGS) svm-scale.c -o svm-scale
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) svm-scale.c -o svm-scale
 svm.o: svm.cpp svm.h
-	$(CXX) $(CFLAGS) -c svm.cpp
+	$(CXX) $(CXXFLAGS) $(PICFLAGS) -c svm.cpp
 clean:
 	rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER)