From aa417238310ff54d6547f3f01a6a727c57bb044e Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sat, 13 Dec 2025 12:09:46 +0000 Subject: Add a Makefile and a launchd agent --- Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6e2a5cd --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +BIN = .build/$(CONFIG) +CONFIG ?= release +DESTDIR ?= ~/.local/bin +LAUNCHD ?= ~/Library/LaunchAgents + +.PHONY: clean install install-launchd-agent + +caffeinate-downloads: $(BIN)/caffeinate-downloads + cp $< $@ + +clean: + rm -f caffeinate-downloads + swift package clean + +install: $(DESTDIR) $(DESTDIR)/caffeinate-downloads +install-launchd-agent: $(LAUNCHD)/caffeinate-downloads.plist + +$(BIN)/caffeinate-downloads: $(wildcard Sources/*.swift) + swift build --configuration $(CONFIG) + +$(DESTDIR): + install -d $@ + +$(DESTDIR)/caffeinate-downloads: $(BIN)/caffeinate-downloads + install $< $@ + +$(LAUNCHD)/caffeinate-downloads.plist: launchd-agent.json + DESTDIR=$(DESTDIR) plutil -convert xml1 -o $@ - <<< $$(envsubst < $<) -- cgit v1.3