blob: d76913d0fab5f671cc14339339f1fd36e5aea98f (
plain) (
blame)
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
|
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
.PHONY: all build install uninstall clean
all: build
build:
go build -ldflags "-X main.version=$(VERSION)" -o ssg
install: build
install -d $(DESTDIR)$(BINDIR)
install -m 755 ssg $(DESTDIR)$(BINDIR)/
install -d $(DESTDIR)$(MANDIR)/man1
install -m 644 man/ssg.1 $(DESTDIR)$(MANDIR)/man1/
install -m 644 man/ssg-build.1 $(DESTDIR)$(MANDIR)/man1/
install -m 644 man/ssg-serve.1 $(DESTDIR)$(MANDIR)/man1/
install -m 644 man/ssg-init.1 $(DESTDIR)$(MANDIR)/man1/
install -m 644 man/ssg-version.1 $(DESTDIR)$(MANDIR)/man1/
install -m 644 man/ssg-help.1 $(DESTDIR)$(MANDIR)/man1/
install -d $(DESTDIR)$(MANDIR)/man5
install -m 644 man/ssg-templates.5 $(DESTDIR)$(MANDIR)/man5/
uninstall:
rm -f $(DESTDIR)$(BINDIR)/ssg
rm -f $(DESTDIR)$(MANDIR)/man1/ssg.1
rm -f $(DESTDIR)$(MANDIR)/man1/ssg-build.1
rm -f $(DESTDIR)$(MANDIR)/man1/ssg-serve.1
rm -f $(DESTDIR)$(MANDIR)/man1/ssg-init.1
rm -f $(DESTDIR)$(MANDIR)/man1/ssg-version.1
rm -f $(DESTDIR)$(MANDIR)/man1/ssg-help.1
rm -f $(DESTDIR)$(MANDIR)/man5/ssg-templates.5
clean:
rm -f ssg
|