-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 loc) · 956 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
SWIFT_BUILD_FLAGS := -c release --disable-sandbox --arch arm64 --arch x86_64
TOOL_NAME := xc
TOOL_BIN_DIR := $(shell swift build $(SWIFT_BUILD_FLAGS) --show-bin-path)
TOOL_BIN := $(TOOL_BIN_DIR)/$(TOOL_NAME)
.PHONY: $(MAKECMDGOALS)
build-cp-zsh: build
sudo rm -f /usr/local/bin/xc
sudo cp $(TOOL_BIN) /usr/local/bin/xc
make install-completion-zsh
install-completion-zsh:
mkdir -p ~/.zsh/competion
xc --generate-completion-script zsh > ~/.zsh/completion/_xc
build:
swift build $(SWIFT_BUILD_FLAGS)
@echo $(TOOL_BIN)
zip: build
rm -f $(TOOL_NAME).zip
zip -j $(TOOL_NAME).zip $(TOOL_BIN)
upload-zip: zip
@[ -n "$(TAG)" ] || (echo "\nERROR: Make sure setting environment variable 'TAG'." && exit 1)
gh release upload $(TAG) $(TOOL_NAME).zip
delete-zip:
@[ -n "$(TAG)" ] || (echo "\nERROR: Make sure setting environment variable 'TAG'." && exit 1)
gh release delete-asset $(TAG) $(TOOL_NAME).zip
sha256-zip:
shasum -a 256 $(TOOL_NAME).zip