Skip to content

Commit b04ceea

Browse files
committed
Add static library target
1 parent e9037b8 commit b04ceea

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ OS = $(shell uname)
88

99
all: train predict
1010

11-
lib: linear.o newton.o blas/blas.a
11+
lib: linear.o newton.o blas/blas.a liblinear.a
1212
if [ "$(OS)" = "Darwin" ]; then \
1313
SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,liblinear.so.$(SHVER)"; \
1414
else \
@@ -31,7 +31,10 @@ linear.o: linear.cpp linear.h
3131
blas/blas.a: blas/*.c blas/*.h
3232
make -C blas OPTFLAGS='$(CFLAGS)' CC='$(CC)';
3333

34+
liblinear.a: linear.o newton.o
35+
ar -rcvs liblinear.a linear.o newton.o blas/*.o
36+
3437
clean:
3538
make -C blas clean
3639
make -C matlab clean
37-
rm -f *~ newton.o linear.o train predict liblinear.so.$(SHVER)
40+
rm -f *~ newton.o linear.o train predict liblinear.a liblinear.so.$(SHVER)

0 commit comments

Comments
 (0)