]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
make : add libwhisper.so target (#144)
authorGeorgi Gerganov <redacted>
Sun, 13 Nov 2022 07:08:33 +0000 (09:08 +0200)
committerGeorgi Gerganov <redacted>
Sun, 13 Nov 2022 07:09:48 +0000 (09:09 +0200)
Makefile

index fb98dcdbd489f6c3dd73d5ef4b902c0e7452443d..463864f0c33f932c1be67e4f3f0f2c7dc23c60a6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -89,14 +89,12 @@ ifneq ($(filter armv8%,$(UNAME_M)),)
        CFLAGS += -mfp16-format=ieee -mno-unaligned-access
 endif
 
+default: main
+
 #
-# Build library + main
+# Build library
 #
 
-main: examples/main/main.cpp ggml.o whisper.o
-       $(CXX) $(CXXFLAGS) examples/main/main.cpp whisper.o ggml.o -o main $(LDFLAGS)
-       ./main -h
-
 ggml.o: ggml.c ggml.h
        $(CC)  $(CFLAGS)   -c ggml.c -o ggml.o
 
@@ -106,8 +104,11 @@ whisper.o: whisper.cpp whisper.h
 libwhisper.a: ggml.o whisper.o
        $(AR) rcs libwhisper.a ggml.o whisper.o
 
+libwhisper.so: ggml.o whisper.o
+       $(CXX) $(CXXFLAGS) -shared -o libwhisper.so ggml.o whisper.o $(LDFLAGS)
+
 clean:
-       rm -f *.o main stream bench libwhisper.a
+       rm -f *.o main stream bench libwhisper.a libwhisper.so
 
 #
 # Examples
@@ -115,6 +116,10 @@ clean:
 
 CC_SDL=`sdl2-config --cflags --libs`
 
+main: examples/main/main.cpp ggml.o whisper.o
+       $(CXX) $(CXXFLAGS) examples/main/main.cpp ggml.o whisper.o -o main $(LDFLAGS)
+       ./main -h
+
 stream: examples/stream/stream.cpp ggml.o whisper.o
        $(CXX) $(CXXFLAGS) examples/stream/stream.cpp ggml.o whisper.o -o stream $(CC_SDL) $(LDFLAGS)