-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (27 loc) · 941 Bytes
/
Makefile
File metadata and controls
33 lines (27 loc) · 941 Bytes
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
.PHONY: build dist install clean run
APP_NAME = markit
APP_BUNDLE = .build/$(APP_NAME).app
DIST_ZIP = .build/$(APP_NAME)-macos.zip
INSTALL_DIR = /Applications
build:
swift build -c release
@BIN_PATH=$$(swift build -c release --show-bin-path) && \
mkdir -p "$(APP_BUNDLE)/Contents/MacOS" && \
cp "$$BIN_PATH/$(APP_NAME)" "$(APP_BUNDLE)/Contents/MacOS/$(APP_NAME)" && \
cp Resources/Info.plist "$(APP_BUNDLE)/Contents/Info.plist" && \
codesign -s - --force "$(APP_BUNDLE)"
@echo "Built $(APP_BUNDLE)"
dist: build
rm -f "$(DIST_ZIP)"
ditto -c -k --keepParent "$(APP_BUNDLE)" "$(DIST_ZIP)"
@echo "Built $(DIST_ZIP)"
install: build
rm -rf "$(INSTALL_DIR)/$(APP_NAME).app"
cp -R "$(APP_BUNDLE)" "$(INSTALL_DIR)/$(APP_NAME).app"
@echo "Installed to $(INSTALL_DIR)/$(APP_NAME).app"
run: build
@pkill -x markit 2>/dev/null; sleep 0.3; true
@open "$(APP_BUNDLE)" --args $(FILE)
clean:
swift package clean
rm -rf "$(APP_BUNDLE)"