diff options
| author | Grégoire Duchêne <greg@awhk.org> | 2025-12-13 12:09:46 +0000 |
|---|---|---|
| committer | Grégoire Duchêne <greg@awhk.org> | 2025-12-13 12:09:46 +0000 |
| commit | aa417238310ff54d6547f3f01a6a727c57bb044e (patch) | |
| tree | 80e361ad0016434d337580e3a31583ff757d7456 /Makefile | |
| parent | 07c6d7fc24af62a56fff0ee7c5514858ea92dc9e (diff) | |
Add a Makefile and a launchd agent
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 28 |
1 files changed, 28 insertions, 0 deletions
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 < $<) |
