-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (26 loc) · 990 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (26 loc) · 990 Bytes
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
PREFIX ?= /usr/local
BINARY_NAME = retina-aware
APP_NAME = RetinaAware.app
INSTALL_PATH = $(PREFIX)/bin/$(BINARY_NAME)
build:
swift build -c release --disable-sandbox
mkdir -p $(APP_NAME)/Contents/MacOS
mkdir -p $(APP_NAME)/Contents/Resources
install .build/release/$(BINARY_NAME) $(APP_NAME)/Contents/MacOS/$(BINARY_NAME)
chmod +x $(APP_NAME)/Contents/MacOS/$(BINARY_NAME)
cp Info.plist $(APP_NAME)/Contents/Info.plist
# Placeholder for Icon
touch $(APP_NAME)/Contents/Resources/AppIcon.icns
install: build
sudo rm -rf /Applications/$(APP_NAME)
sudo cp -R $(APP_NAME) /Applications/
mkdir -p $(PREFIX)/bin
sudo ln -sf /Applications/$(APP_NAME)/Contents/MacOS/$(BINARY_NAME) $(INSTALL_PATH)
# Remove quarantine flag for locally built app
sudo xattr -rd com.apple.quarantine /Applications/$(APP_NAME) || true
uninstall:
rm -f "$(INSTALL_PATH)"
rm -rf "/Applications/$(APP_NAME)"
package: build
zip -r RetinaAware.zip $(APP_NAME)
.PHONY: build install uninstall package