-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (30 loc) · 1.16 KB
/
Copy pathMakefile
File metadata and controls
37 lines (30 loc) · 1.16 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
APP_NAME := Screen Cursor
EXECUTABLE_NAME := ScreenCursor
BUILD_DIR := build
DIST_DIR := dist
APP_BUNDLE := $(BUILD_DIR)/$(APP_NAME).app
EXECUTABLE := $(APP_BUNDLE)/Contents/MacOS/$(EXECUTABLE_NAME)
SOURCES := Sources/ScreenCursor/main.swift
INFO_PLIST := Resources/Info.plist
VERSION := $(shell /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$(INFO_PLIST)")
ZIP_NAME := Screen-Cursor-$(VERSION).zip
ZIP_PATH := $(DIST_DIR)/$(ZIP_NAME)
.PHONY: all clean dist zip run icon
all: $(SOURCES) $(INFO_PLIST)
mkdir -p "$(APP_BUNDLE)/Contents/MacOS" "$(APP_BUNDLE)/Contents/Resources"
swiftc -O -target arm64-apple-macos13.0 -framework Cocoa -framework Carbon "$(SOURCES)" -o "$(EXECUTABLE)"
cp "$(INFO_PLIST)" "$(APP_BUNDLE)/Contents/Info.plist"
cp "Resources/AppIcon.icns" "$(APP_BUNDLE)/Contents/Resources/"
zip:
mkdir -p "$(DIST_DIR)"
ditto -c -k --keepParent "$(APP_BUNDLE)" "$(ZIP_PATH)"
shasum -a 256 "$(ZIP_PATH)"
dist: clean all zip
run: all
open "$(APP_BUNDLE)"
icon:
swift scripts/generate_icon.swift
iconutil -c icns Resources/AppIcon.iconset -o Resources/AppIcon.icns
rm -rf Resources/AppIcon.iconset
clean:
rm -rf "$(BUILD_DIR)" "$(DIST_DIR)"