This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (37 loc) · 1.13 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
42
43
44
45
46
47
48
ifdef TARGET
target := --target ${TARGET}
endif
.PHONY: all generate build clean whisper test run
UNAME_S = $(shell uname -s 2>/dev/null || echo none)
ifeq ($(UNAME_S),Darwin)
LDFLAGS = -framework Metal -framework Foundation
endif
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
LIBRARY_PATH := ${ROOT_DIR}/workspace/models/audio_models/whisper.cpp
C_INCLUDE_PATH := ${ROOT_DIR}/workspace/models/audio_models/whisper.cpp
CGO_ENABLED := 1
all: generate whisper build
generate:
go generate ./...
go fmt ./...
build:
cd cmd/chloe && \
CGO_LDFLAGS="${LDFLAGS}" \
C_INCLUDE_PATH="${C_INCLUDE_PATH}" \
LIBRARY_PATH="${LIBRARY_PATH}" \
CGO_ENABLED=${CGO_ENABLED} \
go build
run:
cd cmd/chloe && ./chloe
whisper:
cd workspace/models/audio_models/whisper.cpp && make main
cd workspace/models/audio_models/whisper.cpp && bash ./models/download-ggml-model.sh medium
cd workspace/models/audio_models/whisper.cpp/bindings/go && make whisper
test:
CGO_LDFLAGS="${LDFLAGS}" \
C_INCLUDE_PATH="${C_INCLUDE_PATH}" \
LIBRARY_PATH="${LIBRARY_PATH}" \
CGO_ENABLED=${CGO_ENABLED} \
go test -v ./...
clean:
rm ./cmd/chloe/chloe