]> granicus.if.org Git - liblinear/commitdiff
changed version detection to use make conditional statement
authorSinacam <stinkingmadgod@gmail.com>
Sat, 3 Sep 2022 08:29:11 +0000 (16:29 +0800)
committerSinacam <stinkingmadgod@gmail.com>
Sat, 3 Sep 2022 08:29:11 +0000 (16:29 +0800)
Makefile

index 779bc16ae17720793b55094945c1bb3a4c876db3..ac287b32a9fb7d27aa3dd46a29df7be97d0752a3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,19 +2,19 @@ CXX ?= g++
 CC ?= gcc
 CFLAGS = -Wall -Wconversion -O3 -fPIC
 LIBS = blas/blas.a
+#LIBS = -lblas
 SHVER = 5
 OS = $(shell uname)
-#LIBS = -lblas
+ifeq ($(OS),Darwin)
+       SHARED_LIB_FLAG = -dynamiclib -Wl,-install_name,liblinear.so.$(SHVER)
+else
+       SHARED_LIB_FLAG = -shared -Wl,-soname,liblinear.so.$(SHVER)
+endif
 
 all: train predict
 
 lib: linear.o newton.o blas/blas.a
-       if [ "$(OS)" = "Darwin" ]; then \
-               SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,liblinear.so.$(SHVER)"; \
-       else \
-               SHARED_LIB_FLAG="-shared -Wl,-soname,liblinear.so.$(SHVER)"; \
-       fi; \
-       $(CXX) $${SHARED_LIB_FLAG} linear.o newton.o blas/blas.a -o liblinear.so.$(SHVER)
+       $(CXX) $(SHARED_LIB_FLAG) linear.o newton.o blas/blas.a -o liblinear.so.$(SHVER)
 
 train: newton.o linear.o train.c blas/blas.a
        $(CXX) $(CFLAGS) -o train train.c newton.o linear.o $(LIBS)