-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 1021 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
prefix ?= /usr/local
bindir = $(prefix)/bin
pluginsdir = ~/.general/plugins
binary ?= general
ios_binary ?= GeneralIOs
release_binary?=.build/release/General
release_ios_binary?=.build/release/GeneralIOs
completions_folder=Scripts/completions
zsh_completions_folder=/usr/local/share/zsh/site-functions
$(binary): $(release_binary)
cp $(release_binary) $(binary)
$(release_binary):
swift build -c release --disable-sandbox
completions: $(binary)
./$(binary) --generate-completion-script zsh > $(completions_folder)/_general
./$(binary) --generate-completion-script bash > $(completions_folder)/general
./$(binary) --generate-completion-script fish > $(completions_folder)/general.fish
install: build
mkdir -p $(bindir)
mkdir -p $(pluginsdir)
cp -f $(release_binary) $(bindir)/$(binary)
cp -f $(release_ios_binary) $(pluginsdir)/$(ios_binary)
build:
swift build -c release --disable-sandbox
uninstall:
rm -rf "$(bindir)/$(binary)"
clean:
rm -rf .build
.PHONY: build install uninstall clean completions