-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (48 loc) · 1.9 KB
/
Makefile
File metadata and controls
61 lines (48 loc) · 1.9 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
OS ?= linux
ARCH ?= x64
ONNX_VERSION ?= 1.23.1
# BUILD_TYPE: Release | Debug
BUILD_TYPE ?= Release
PACKAGE_DIR ?= dist
help: ## Show all Makefile targets.
@grep -E '^[a-zA-Z_\/-]+:.*?## .*$$' Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}'
libs/onnx:
@echo "\nEnsuring onnx libraries.."
mkdir -p libs/onnx
wget -q -O libs/onnx/onnxruntime.tgz \
https://github.com/microsoft/onnxruntime/releases/download/v$(ONNX_VERSION)/onnxruntime-$(OS)-$(ARCH)-$(ONNX_VERSION).tgz
tar xvzf libs/onnx/onnxruntime.tgz -C libs/onnx/ --strip-components=1
libs/portaudio:
@echo "\nEnsuring portaudio libraries.."
mkdir -p libs
wget -q -O libs/portaudio.zip \
"https://github.com/PortAudio/portaudio/archive/refs/heads/master.zip"
unzip libs/portaudio.zip -d libs/
$(RM) libs/portaudio.zip
mv libs/portaudio-master libs/portaudio
models:
@echo "\nDownloading onnx models.."
mkdir -p models
@echo "\nDownloading models/meslspectogram.onnx"
wget -q -O models/melspectrogram.onnx https://github.com/dscripka/openWakeWord/releases/download/v0.5.1/melspectrogram.onnx
@echo "\nDownloading models/embedding_model.onnx"
wget -q -O models/embedding_model.onnx https://github.com/dscripka/openWakeWord/releases/download/v0.5.1/embedding_model.onnx
@echo "Downloaded all onnx models.."
setup: libs/onnx models libs/portaudio ## Setup libraries
@echo "\nConfigure.."
cmake -S . -B build
build: setup ## Build
@echo "Creating $(BUILD_TYPE) build.."
@mkdir build 2>/dev/null || true
@cd build; cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) ..;
@cd build; cmake --build .;
package: build ## Create package
@echo "Creating package: $(PACKAGE_DIR) .."
cmake --install ./build --prefix $(PACKAGE_DIR)
clean: ## Clean all build deps and builds
$(RM) -rf build
$(RM) -rf $(PACKAGE_DIR)
clean-all: clean ## Clean all downloaded assets assets
$(RM) -rf libs
$(RM) -rf models
.PHONY: setup package help