.PHONY: all build clean install uninstall

BIN := ollied

all: build

build:
	go build -o $(BIN)

clean:
	rm -f $(BIN)

install: build
	install -m755 $(BIN) /usr/bin/
	install -m644 org.ollie.SessionManager.desktop /etc/xdg/autostart/

uninstall:
	pkill -u "$$(id -u)" -x $(BIN) 2>/dev/null; true
	rm -f /usr/bin/$(BIN)
	rm -f /etc/xdg/autostart/org.ollie.SessionManager.desktop
