~adnano/kiln

ref: 7ac653c62085191327b594a7ae1617cd561c2d32 kiln/Makefile -rw-r--r-- 807 bytes
7ac653c6Adnan Maolood docs: Tweak wording 7 months ago
                                                                                
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
39
40
41
42
43
.POSIX:
.SUFFIXES:
.SUFFIXES: .1.scd .1

_git_version=$(shell git describe --tags --dirty 2>/dev/null)
ifeq ($(strip $(_git_version)),)
VERSION=0.2.0
else
VERSION=$(_git_version)
endif

PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
MANDIR?=$(PREFIX)/share/man
GO?=go
GOFLAGS?=

all: kiln docs

docs: docs/kiln.1

.1.scd.1:
	scdoc < $< > $@

kiln: *.go go.mod go.sum config.toml templates/_default/*
	$(GO) build $(GOFLAGS) \
		-ldflags "-X main.Version=$(VERSION)" \
		-o $@

clean:
	$(RM) kiln
	$(RM) docs/kiln.1

install: all
	mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
	install -m755 kiln $(DESTDIR)$(BINDIR)/kiln
	install -m644 docs/kiln.1 $(DESTDIR)$(MANDIR)/man1/kiln.1

uninstall:
	$(RM) $(DESTDIR)$(BINDIR)/kiln
	$(RM) $(DESTDIR)$(MANDIR)/man1/kiln.1

.PHONY: all docs clean install uninstall