Commit 344414be

344414be8c0cMergedon zach-1de969

zach · 1 month ago · 7 files · +2 added · ~5 modified

Details

Commit
344414be8c0c
Parent
df74dca0d99d

MakefilemodifiedView file

@@ -1,6 +1,6 @@
11 APP := target/release/Acorn.app
22
3-.PHONY: build run test app install clean
3+.PHONY: build run test app install icon clean
44
55 build:
66 cargo build --release
@@ -14,13 +14,24 @@
1414 # A macOS app bundle, so acorn can live in /Applications and the Dock.
1515 app: build
1616 rm -rf $(APP)
17- mkdir -p $(APP)/Contents/MacOS
17+ mkdir -p $(APP)/Contents/MacOS $(APP)/Contents/Resources
1818 cp target/release/acorn $(APP)/Contents/MacOS/acorn
1919 cp macos/Info.plist $(APP)/Contents/Info.plist
20+ cp macos/Acorn.icns $(APP)/Contents/Resources/Acorn.icns
2021
2122 install: app
2223 rm -rf /Applications/Acorn.app
2324 cp -R $(APP) /Applications/Acorn.app
25+ touch /Applications/Acorn.app
26+
27+# Regenerates macos/Acorn.icns from a font glyph, e.g.
28+# make icon FONT=$$HOME/Downloads/Yarndings20-Regular.ttf GLYPH=h
29+GLYPH ?= h
30+icon:
31+ @test -n "$(FONT)" || (echo "usage: make icon FONT=path/to/font.ttf [GLYPH=h]" && exit 2)
32+ rm -rf target/Acorn.iconset
33+ swift macos/make-icon.swift "$(FONT)" "$(GLYPH)" target/Acorn.iconset
34+ iconutil -c icns target/Acorn.iconset -o macos/Acorn.icns
2435
2536 clean:
2637 cargo clean