forked from aarnphm/whispercpp
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 1.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# excerpt from ./extern/whispercpp/Makefile
SHELL := /bin/bash
CXX := clang
ifndef UNAME_S
UNAME_S := $(shell uname -s)
endif
CFLAGS = -O3 -fPIC -std=c11 $(shell python3-config --includes) -Iextern -I./extern/pybind11/include -DGGML_USE_ACCELERATE
CXXFLAGS = -O3 -fPIC -std=c++11 $(shell python3-config --includes) -Iextern -I./extern/pybind11/include -I./extern/whispercpp/examples
LDFLAGS =
ifeq ($(UNAME_S),Linux)
CFLAGS += -pthread
CXXFLAGS += -pthread
endif
ifeq ($(UNAME_S),Darwin)
CFLAGS += -pthread
CXXFLAGS += -pthread
endif
default: api
EXTRA_CXXFLAGS = -Isrc/whispercpp/
ifeq ($(UNAME_S),Darwin)
EXTRA_CXXFLAGS += -Wl,-undefined,dynamic_lookup
endif
context.o: src/whispercpp/context.cc src/whispercpp/context.h
$(CXX) $(CXXFLAGS) -o src/whispercpp/context.o -c src/whispercpp/context.cc
api_export.o: src/whispercpp/api_export.cc
$(CXX) $(CXXFLAGS) -o src/whispercpp/api_export.o -c src/whispercpp/api_export.cc
api: api_export.o context.o
@echo "Building pybind11 extension..."
@cd ./extern/whispercpp && $(MAKE) ggml.o whisper.o && mv whisper.o ggml.o ../../src/whispercpp/
$(CXX) $(CXXFLAGS) $(EXTRA_CXXFLAGS) -shared -o src/whispercpp/api.so src/whispercpp/*.o
clean:
rm -rf **/*.o **/*.so