From 7ce7ea30c932f54c5054dbbb06ead194060330aa Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Thu, 30 Jul 2015 16:53:40 -0400 Subject: [PATCH 1/3] add install target to Makefile --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index db6ab346..c534e25e 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,20 @@ CFLAGS = -Wall -Wconversion -O3 -fPIC SHVER = 2 OS = $(shell uname) +LIB = /usr/local/lib +CP = cp +LN = ln -sf + all: svm-train svm-predict svm-scale +install: lib + if [ ! -w $(LIB) ]; then \ + CP='sudo cp'; \ + LN='sudo ln -sf'; \ + fi; \ + $(CP) libsvm.so.2 $(LIB) + $(LN) $(LIB)/libsvm.so.$(SHVER) $(LIB)/libsvm.so + lib: svm.o if [ "$(OS)" = "Darwin" ]; then \ SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.$(SHVER)"; \ From c355a96dec93f7f0614e63448ec2cba4fbb8eadd Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Fri, 31 Jul 2015 06:16:27 +0100 Subject: [PATCH 2/3] add static lib --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index db6ab346..b2eea680 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,10 @@ lib: svm.o fi; \ $(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) +slib: svm.o + ar rcs libsvm.a svm.o + + svm-predict: svm-predict.c svm.o $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm svm-train: svm-train.c svm.o From cd47346d357100f36933c624b9c3f91c2c982cbc Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Fri, 31 Jul 2015 06:17:09 +0100 Subject: [PATCH 3/3] update --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e98f745d --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +libsvm.a +svm-predict +svm-scale +svm-train +svm.o