-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
49 lines (37 loc) · 1.21 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
49
PRODUCT_NAME=figmagen
PRODUCT_VERSION=1.0.0
TEMPLATES_NAME=Templates
README_NAME=README.md
LICENSE_NAME=LICENSE
RELEASE_PATH=.build/release/$(PRODUCT_NAME)-$(PRODUCT_VERSION)
RELEASE_ZIP_PATH = ./$(PRODUCT_NAME)-$(PRODUCT_VERSION).zip
PRODUCT_PATH=.build/release/$(PRODUCT_NAME)
TEMPLATES_PATH=$(TEMPLATES_NAME)
README_PATH=$(README_NAME)
LICENSE_PATH=$(LICENSE_NAME)
PREFIX = /usr/local
BIN_PATH=$(PREFIX)/bin
BIN_PRODUCT_PATH=$(BIN_PATH)/$(PRODUCT_NAME)
SHARE_PRODUCT_PATH=$(PREFIX)/share/$(PRODUCT_NAME)
.PHONY: all version build install uninstall release lint
version:
@echo $(PRODUCT_VERSION)
build:
swift build --disable-sandbox -c release
install: build
mkdir -p $(BIN_PATH)
cp -f $(PRODUCT_PATH) $(BIN_PRODUCT_PATH)
mkdir -p $(SHARE_PRODUCT_PATH)
cp -R $(TEMPLATES_PATH)/. $(SHARE_PRODUCT_PATH)
uninstall:
rm -rf $(BIN_PRODUCT_PATH)
rm -rf $(SHARE_PRODUCT_PATH)
release: build
mkdir -p $(RELEASE_PATH)
cp -f $(PRODUCT_PATH) $(RELEASE_PATH)
cp -r $(TEMPLATES_PATH) $(RELEASE_PATH)
cp -f $(README_PATH) $(RELEASE_PATH)
cp -f $(LICENSE_PATH) $(RELEASE_PATH)
(cd $(RELEASE_PATH); zip -yr - $(PRODUCT_NAME) $(TEMPLATES_NAME) $(README_NAME) $(LICENSE_NAME)) > $(RELEASE_ZIP_PATH)
lint:
swiftlint lint --quiet