-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (25 loc) · 944 Bytes
/
Makefile
File metadata and controls
32 lines (25 loc) · 944 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
32
PREFIX ?= /usr/local
BINARY = xdr-boost
BUILD_DIR = .build
.PHONY: build install uninstall clean launch-agent remove-agent
build:
@mkdir -p $(BUILD_DIR)
swiftc -O -o $(BUILD_DIR)/$(BINARY) Sources/main.swift \
-framework Cocoa -framework MetalKit -framework Metal
install: build
install -d $(PREFIX)/bin
install -m 755 $(BUILD_DIR)/$(BINARY) $(PREFIX)/bin/$(BINARY)
uninstall: remove-agent
rm -f $(PREFIX)/bin/$(BINARY)
# Install LaunchAgent to start on login
launch-agent: install
@mkdir -p ~/Library/LaunchAgents
@sed "s|__BINARY__|$(PREFIX)/bin/$(BINARY)|g" \
com.xdr-boost.agent.plist > ~/Library/LaunchAgents/com.xdr-boost.agent.plist
launchctl load ~/Library/LaunchAgents/com.xdr-boost.agent.plist
@echo "xdr-boost will now start on login"
remove-agent:
-launchctl unload ~/Library/LaunchAgents/com.xdr-boost.agent.plist 2>/dev/null
rm -f ~/Library/LaunchAgents/com.xdr-boost.agent.plist
clean:
rm -rf $(BUILD_DIR)