forked from ljain2/libsvm-openset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·56 lines (46 loc) · 1.73 KB
/
Makefile
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
49
50
51
52
53
54
55
56
#LIBMR_DIR should be absolute path, not relative (no ..)
LIBMR_DIR = /Users/macuser/lalitphd/WSVM/libsvm-openset/libMR
ifeq ($(OS),Windows_NT)
CFLAGS += -D WIN32
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
CFLAGS += -D AMD64
LIBSUFFIX = .dll
endif
ifeq ($(PROCESSOR_ARCHITECTURE),x86)
CFLAGS += -D IA32
LIBSUFFIX = .dll
endif
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CFLAGS += -D LINUX -Wl,-rpath=$(LIBMR_DIR)/libMR/build/libMR/
LIBSUFFIX = .so
endif
ifeq ($(UNAME_S),Darwin)
CFLAGS += -D OSX
LIBSUFFIX = .dylib
endif
endif
CXX ?= g++ -g
#CFLAGS = -Wall -Wconversion -g
LIBMR_LIB = $(LIBMR_DIR)/libMR/build/libMR/libMR$(LIBSUFFIX)
#LIBMR_LIB = build/libMR/libMR.so
CFLAGS += -Wall -g -I $(LIBMR_DIR)/libMR
CFLAGS += -O2 -fPIC
SHVER = 2
all: svm-train svm-predict svm-scale $(LIBMR_LIB)
$(LIBMR_LIB): $(LIBMR_DIR)/libMR/MetaRecognition.h $(LIBMR_DIR)/libMR/MetaRecognition.cpp
mkdir -p $(LIBMR_DIR)/libMR/build
cd $(LIBMR_DIR)/libMR/build; cmake -DCMAKE_BUILD_TYPE=Debug $(LIBMR_DIR); make
lib: svm.o $(LIBMR_LIB)
$(CXX) -shared -dynamiclib svm.o $(LIBMR_LIB) -o libsvm.so.$(SHVER)
svm-predict: svm-predict.cpp svm.o $(LIBMR_LIB)
$(CXX) $(CFLAGS) svm-predict.cpp svm.o $(LIBMR_LIB) -o svm-predict -lm
svm-train: svm-train.cpp svm.o $(LIBMR_LIB)
$(CXX) $(CFLAGS) svm-train.cpp svm.o $(LIBMR_LIB) -o svm-train -lm
svm-scale: svm-scale.c $(LIBMR_LIB)
$(CXX) $(CFLAGS) svm-scale.c $(LIBMR_LIB) -o svm-scale
svm.o: svm.cpp svm.h
$(CXX) $(CFLAGS) -c svm.cpp
clean:
rm -fr *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) $(LIBMR_DIR)/libMR/build