-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (29 loc) · 1.04 KB
/
Copy pathMakefile
File metadata and controls
37 lines (29 loc) · 1.04 KB
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
APP_NAME := QuickSave
BUNDLE_ID := com.wangxiaoyu.quicksave
BUILD_DIR := build
APP_BUNDLE := $(BUILD_DIR)/$(APP_NAME).app
.PHONY: all clean install uninstall launch codesign
all: $(APP_BUNDLE)
$(APP_BUNDLE): Sources/main.swift Resources/Info.plist
@mkdir -p $(APP_BUNDLE)/Contents/MacOS $(APP_BUNDLE)/Contents/Resources
cp Resources/Info.plist $(APP_BUNDLE)/Contents/Info.plist
swiftc -O \
-target arm64-apple-macos13.0 \
-framework AppKit -framework ApplicationServices -framework Carbon \
-framework ServiceManagement -framework UserNotifications \
Sources/main.swift -o $(APP_BUNDLE)/Contents/MacOS/$(APP_NAME)
codesign --force --sign - $(APP_BUNDLE) 2>/dev/null || true
@echo "Built $(APP_BUNDLE)"
codesign: $(APP_BUNDLE)
codesign --force --sign - $(APP_BUNDLE)
launch: $(APP_BUNDLE)
open $(APP_BUNDLE)
install: $(APP_BUNDLE)
mkdir -p $(PREFIX)/bin
cp -R $(APP_BUNDLE) $(PREFIX)/bin/
@echo "Installed to $(PREFIX)/bin/$(APP_NAME).app"
uninstall:
rm -rf $(PREFIX)/bin/$(APP_NAME).app
clean:
rm -rf $(BUILD_DIR)