From b04ceea293fc1456d5ba1fd3dd48b131566e893b Mon Sep 17 00:00:00 2001 From: Berne Campbell Date: Thu, 14 Jan 2021 01:26:28 +1100 Subject: [PATCH] Add static library target --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 49e8a98..39679e5 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ OS = $(shell uname) all: train predict -lib: linear.o newton.o blas/blas.a +lib: linear.o newton.o blas/blas.a liblinear.a if [ "$(OS)" = "Darwin" ]; then \ SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,liblinear.so.$(SHVER)"; \ else \ @@ -31,7 +31,10 @@ linear.o: linear.cpp linear.h blas/blas.a: blas/*.c blas/*.h make -C blas OPTFLAGS='$(CFLAGS)' CC='$(CC)'; +liblinear.a: linear.o newton.o + ar -rcvs liblinear.a linear.o newton.o blas/*.o + clean: make -C blas clean make -C matlab clean - rm -f *~ newton.o linear.o train predict liblinear.so.$(SHVER) + rm -f *~ newton.o linear.o train predict liblinear.a liblinear.so.$(SHVER)