-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (30 loc) · 1.13 KB
/
Copy pathMakefile
File metadata and controls
34 lines (30 loc) · 1.13 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
APP_NAME := Overtune
BUILD_DIR := .build/release
APP_BUNDLE := $(APP_NAME).app
ENTITLEMENTS := $(APP_NAME).entitlements
.PHONY: build run clean
## Build a release .app bundle and ad-hoc sign it.
build:
swift build -c release
@echo "→ Assembling $(APP_BUNDLE)…"
@rm -rf $(APP_BUNDLE)
@mkdir -p $(APP_BUNDLE)/Contents/MacOS
@mkdir -p $(APP_BUNDLE)/Contents/Resources
@cp $(BUILD_DIR)/$(APP_NAME) $(APP_BUNDLE)/Contents/MacOS/
# Copy bundled resources (Info.plist ends up at the right path after swift build)
@cp .build/release/Overtune_Overtune.bundle/Contents/Resources/Info.plist \
$(APP_BUNDLE)/Contents/Info.plist 2>/dev/null || \
cp Sources/Overtune/Resources/Info.plist $(APP_BUNDLE)/Contents/Info.plist
@cp Overtune.icns $(APP_BUNDLE)/Contents/Resources/Overtune.icns
@echo "→ Signing with ad-hoc identity…"
@codesign --force --deep --sign - \
--entitlements $(ENTITLEMENTS) \
--options runtime \
$(APP_BUNDLE)
@echo "✓ Built: $(APP_BUNDLE)"
## Build and immediately launch the app.
run: build
open $(APP_BUNDLE)
## Remove build artefacts.
clean:
rm -rf .build $(APP_BUNDLE)