-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (36 loc) · 906 Bytes
/
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
BUILD_MODE:=release
PACKAGE=server client llm
BINARIES=$(addprefix target/$(BUILD_MODE)/, $(PACKAGE))
INSTALLED_BINARIES=$(addprefix $(INSTALL_DIR)/voice-, $(PACKAGE))
all: $(BINARIES)
.PHONY: require-bin
require-bin:
ifndef INSTALL_DIR
$(error INSTALL_DIR is not set)
endif
.PHONY: install
install: require-bin $(INSTALLED_BINARIES)
.PHONY: clean
clean: clean-bin
cargo clean
.PHONY: clean-bin
clean-bin:
rm -f $(BINARIES)
ifdef $(INSTALL_DIR)
rm -f $(INSTALLED_BINARIES)
endif
$(INSTALL_DIR)/voice-%: target/$(BUILD_MODE)/%
cp $< $@
ifeq ($(words $(PACKAGE)),1)
target/$(BUILD_MODE)/%:
else
$(BINARIES):
endif
ifeq ($(BUILD_MODE),release)
cargo build --$(BUILD_MODE) $(foreach p, $(PACKAGE),-p $p)
else
cargo build $(foreach p, $(PACKAGE),-p $p)
endif
DAEMON:=local.personal.transcription
kick: require-bin $(INSTALL_DIR)/voice-server
launchctl kickstart -k gui/$(shell id -u)/$(DAEMON)