ggerganov commited on
Commit
e86d64e
·
unverified ·
1 Parent(s): 5eb3549

make : add libwhisper.so target (#144)

Browse files
Files changed (1) hide show
  1. Makefile +11 -6
Makefile CHANGED
@@ -89,14 +89,12 @@ ifneq ($(filter armv8%,$(UNAME_M)),)
89
  CFLAGS += -mfp16-format=ieee -mno-unaligned-access
90
  endif
91
 
 
 
92
  #
93
- # Build library + main
94
  #
95
 
96
- main: examples/main/main.cpp ggml.o whisper.o
97
- $(CXX) $(CXXFLAGS) examples/main/main.cpp whisper.o ggml.o -o main $(LDFLAGS)
98
- ./main -h
99
-
100
  ggml.o: ggml.c ggml.h
101
  $(CC) $(CFLAGS) -c ggml.c -o ggml.o
102
 
@@ -106,8 +104,11 @@ whisper.o: whisper.cpp whisper.h
106
  libwhisper.a: ggml.o whisper.o
107
  $(AR) rcs libwhisper.a ggml.o whisper.o
108
 
 
 
 
109
  clean:
110
- rm -f *.o main stream bench libwhisper.a
111
 
112
  #
113
  # Examples
@@ -115,6 +116,10 @@ clean:
115
 
116
  CC_SDL=`sdl2-config --cflags --libs`
117
 
 
 
 
 
118
  stream: examples/stream/stream.cpp ggml.o whisper.o
119
  $(CXX) $(CXXFLAGS) examples/stream/stream.cpp ggml.o whisper.o -o stream $(CC_SDL) $(LDFLAGS)
120
 
 
89
  CFLAGS += -mfp16-format=ieee -mno-unaligned-access
90
  endif
91
 
92
+ default: main
93
+
94
  #
95
+ # Build library
96
  #
97
 
 
 
 
 
98
  ggml.o: ggml.c ggml.h
99
  $(CC) $(CFLAGS) -c ggml.c -o ggml.o
100
 
 
104
  libwhisper.a: ggml.o whisper.o
105
  $(AR) rcs libwhisper.a ggml.o whisper.o
106
 
107
+ libwhisper.so: ggml.o whisper.o
108
+ $(CXX) $(CXXFLAGS) -shared -o libwhisper.so ggml.o whisper.o $(LDFLAGS)
109
+
110
  clean:
111
+ rm -f *.o main stream bench libwhisper.a libwhisper.so
112
 
113
  #
114
  # Examples
 
116
 
117
  CC_SDL=`sdl2-config --cflags --libs`
118
 
119
+ main: examples/main/main.cpp ggml.o whisper.o
120
+ $(CXX) $(CXXFLAGS) examples/main/main.cpp ggml.o whisper.o -o main $(LDFLAGS)
121
+ ./main -h
122
+
123
  stream: examples/stream/stream.cpp ggml.o whisper.o
124
  $(CXX) $(CXXFLAGS) examples/stream/stream.cpp ggml.o whisper.o -o stream $(CC_SDL) $(LDFLAGS)
125