mirror of
https://github.com/mmacierzanka/second-display.git
synced 2026-11-06 12:41:45 +01:00
Name the app bundle 'Second Display' everywhere; second-display for file artifacts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8072ac473a
commit
d3609ae29c
8 files changed
+40
-35
No files matched your search
@@ -1,47 +1,52 @@
|
||||
APP := build/SecondDisplay.app
|
||||
NAME := Second Display
|
||||
APP := build/$(NAME).app
|
||||
# GNU make cannot use paths with spaces as targets, so builds are tracked by a stamp file
|
||||
STAMP := build/.app-built
|
||||
SRC := $(wildcard Sources/*.swift)
|
||||
RES := $(shell find Resources -type f)
|
||||
ENTITLEMENTS := Config/second-display.entitlements
|
||||
# "-" = ad-hoc; set SIGN_ID to a Developer ID identity for distribution
|
||||
SIGN_ID ?= -
|
||||
BUILDNUM := $(shell git rev-list --count HEAD 2>/dev/null || echo 1)
|
||||
|
||||
VERSION := $(shell /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" Config/Info.plist)
|
||||
DMG := build/SecondDisplay-$(VERSION).dmg
|
||||
VOLNAME ?= Second Display
|
||||
DMG := build/second-display-$(VERSION).dmg
|
||||
VOLNAME ?= $(NAME)
|
||||
|
||||
.PHONY: build run clean install uninstall check dmg help
|
||||
build: $(APP) ## Build build/SecondDisplay.app
|
||||
build: $(STAMP) ## Build build/Second Display.app
|
||||
|
||||
$(APP): Makefile $(SRC) $(RES) Config/Info.plist Config/SecondDisplay.entitlements
|
||||
rm -rf $(APP) && mkdir -p $(APP)/Contents/MacOS $(APP)/Contents/Resources
|
||||
swiftc -O -target arm64-apple-macos26.0 $(SRC) -o $(APP)/Contents/MacOS/SecondDisplay-arm64
|
||||
swiftc -O -target x86_64-apple-macos26.0 $(SRC) -o $(APP)/Contents/MacOS/SecondDisplay-x86_64
|
||||
lipo -create $(APP)/Contents/MacOS/SecondDisplay-* -output $(APP)/Contents/MacOS/SecondDisplay
|
||||
rm $(APP)/Contents/MacOS/SecondDisplay-*
|
||||
cp Config/Info.plist $(APP)/Contents/Info.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $(BUILDNUM)" $(APP)/Contents/Info.plist
|
||||
cp -R Resources/en.lproj Resources/pl.lproj Resources/uninstall.sh $(APP)/Contents/Resources/
|
||||
xcrun actool Resources/AppIcon.icon --compile $(APP)/Contents/Resources --platform macosx \
|
||||
$(STAMP): Makefile $(SRC) $(RES) Config/Info.plist $(ENTITLEMENTS)
|
||||
rm -rf "$(APP)" && mkdir -p "$(APP)/Contents/MacOS" "$(APP)/Contents/Resources"
|
||||
swiftc -O -target arm64-apple-macos26.0 $(SRC) -o build/arm64
|
||||
swiftc -O -target x86_64-apple-macos26.0 $(SRC) -o build/x86_64
|
||||
lipo -create build/arm64 build/x86_64 -output "$(APP)/Contents/MacOS/$(NAME)"
|
||||
rm build/arm64 build/x86_64
|
||||
cp Config/Info.plist "$(APP)/Contents/Info.plist"
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $(BUILDNUM)" "$(APP)/Contents/Info.plist"
|
||||
cp -R Resources/en.lproj Resources/pl.lproj Resources/uninstall.sh "$(APP)/Contents/Resources/"
|
||||
xcrun actool Resources/AppIcon.icon --compile "$(APP)/Contents/Resources" --platform macosx \
|
||||
--minimum-deployment-target 26.0 --app-icon AppIcon --output-partial-info-plist /dev/null >/dev/null
|
||||
codesign --force --options runtime --entitlements Config/SecondDisplay.entitlements --sign "$(SIGN_ID)" $(APP)
|
||||
codesign --force --options runtime --entitlements $(ENTITLEMENTS) --sign "$(SIGN_ID)" "$(APP)"
|
||||
touch $(STAMP)
|
||||
|
||||
run: build ## Build and launch
|
||||
open $(APP)
|
||||
open "$(APP)"
|
||||
|
||||
clean: ## Remove build output
|
||||
rm -rf build
|
||||
|
||||
install: build ## Copy to ~/Applications
|
||||
mkdir -p ~/Applications && rm -rf ~/Applications/SecondDisplay.app && cp -R $(APP) ~/Applications/
|
||||
mkdir -p ~/Applications && rm -rf ~/Applications/SecondDisplay.app "$$HOME/Applications/$(NAME).app" && cp -R "$(APP)" ~/Applications/
|
||||
|
||||
uninstall: ## Remove the installed app and all its leftovers
|
||||
~/Applications/SecondDisplay.app/Contents/Resources/uninstall.sh
|
||||
"$$HOME/Applications/$(NAME).app/Contents/Resources/uninstall.sh"
|
||||
|
||||
check: build ## Lint sources, plists, strings and the built bundle
|
||||
swiftc -typecheck $(SRC)
|
||||
plutil -lint Config/Info.plist Config/SecondDisplay.entitlements Resources/*.lproj/*.strings
|
||||
plutil -lint Config/Info.plist $(ENTITLEMENTS) Resources/*.lproj/*.strings
|
||||
scripts/check-strings.sh
|
||||
codesign --verify --strict $(APP)
|
||||
codesign --verify --strict "$(APP)"
|
||||
|
||||
DMGBUILD := build/venv/bin/dmgbuild
|
||||
|
||||
@@ -50,7 +55,7 @@ $(DMGBUILD):
|
||||
|
||||
dmg: build $(DMGBUILD) ## Build a distributable disk image (not notarized)
|
||||
rm -f $(DMG)
|
||||
$(DMGBUILD) -s Config/dmg/settings.py -D app=$(APP) "$(VOLNAME)" $(DMG)
|
||||
$(DMGBUILD) -s Config/dmg/settings.py -D app="$(APP)" "$(VOLNAME)" $(DMG)
|
||||
hdiutil verify $(DMG) | tail -1
|
||||
|
||||
help: ## List targets
|
||||
|
||||
Reference in new issue
Block a user