-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 962 Bytes
/
Copy pathMakefile
File metadata and controls
38 lines (29 loc) · 962 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
33
34
35
36
37
38
# Photogram — build / test / install
#
# Installs to ~/.local (on PATH via ~/.zprofile). Override with PREFIX=...
PREFIX ?= $(HOME)/.local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
BIN = photogram
.PHONY: build release test run install uninstall manpage clean
build:
swift build
release:
swift build -c release
test:
swift test
## Build release + copy binary and man page onto PATH
install: release manpage
@mkdir -p "$(BINDIR)" "$(MANDIR)"
install -m 0755 .build/release/$(BIN) "$(BINDIR)/$(BIN)"
install -m 0644 man/$(BIN).1 "$(MANDIR)/$(BIN).1"
@echo "✅ installed $(BINDIR)/$(BIN) (man: $(MANDIR)/$(BIN).1)"
uninstall:
rm -f "$(BINDIR)/$(BIN)" "$(MANDIR)/$(BIN).1"
@echo "removed $(BIN)"
## Regenerate man/photogram.1 from the CLI definitions
manpage:
swift package --allow-writing-to-package-directory generate-manual --output-directory ./man
@rm -rf Sources/photogram/photogram.docc
clean:
swift package clean