2020-11-02 02:51:43 +01:00
|
|
|
.POSIX:
|
|
|
|
.SUFFIXES:
|
2021-04-20 22:57:05 +02:00
|
|
|
.SUFFIXES: .1.scd .1
|
2020-11-02 02:51:43 +01:00
|
|
|
|
2021-04-20 22:44:29 +02:00
|
|
|
_git_version=$(shell git describe --tags --dirty 2>/dev/null)
|
|
|
|
ifeq ($(strip $(_git_version)),)
|
2021-05-21 23:34:28 +02:00
|
|
|
VERSION=0.2.0
|
2021-04-20 22:44:29 +02:00
|
|
|
else
|
|
|
|
VERSION=$(_git_version)
|
|
|
|
endif
|
2020-11-02 02:51:43 +01:00
|
|
|
|
|
|
|
PREFIX?=/usr/local
|
2020-11-20 18:07:38 +01:00
|
|
|
BINDIR?=$(PREFIX)/bin
|
2020-11-11 01:34:05 +01:00
|
|
|
MANDIR?=$(PREFIX)/share/man
|
2020-11-02 02:51:43 +01:00
|
|
|
GO?=go
|
|
|
|
GOFLAGS?=
|
|
|
|
|
2021-04-20 22:57:05 +02:00
|
|
|
all: kiln docs
|
2020-11-11 01:34:05 +01:00
|
|
|
|
2021-04-20 22:57:05 +02:00
|
|
|
docs: docs/kiln.1
|
2020-11-11 01:34:05 +01:00
|
|
|
|
|
|
|
.1.scd.1:
|
|
|
|
scdoc < $< > $@
|
2020-11-02 02:51:43 +01:00
|
|
|
|
2021-05-21 22:59:20 +02:00
|
|
|
kiln: *.go go.mod go.sum config.toml templates/_default/*
|
2020-11-02 02:51:43 +01:00
|
|
|
$(GO) build $(GOFLAGS) \
|
2021-04-12 06:31:55 +02:00
|
|
|
-ldflags "-X main.Version=$(VERSION)" \
|
2020-11-02 02:51:43 +01:00
|
|
|
-o $@
|
|
|
|
|
|
|
|
clean:
|
2020-11-11 01:34:05 +01:00
|
|
|
$(RM) kiln
|
2021-04-20 23:05:05 +02:00
|
|
|
$(RM) docs/kiln.1
|
2020-11-02 02:51:43 +01:00
|
|
|
|
|
|
|
install: all
|
2020-11-20 18:07:38 +01:00
|
|
|
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
|
|
|
|
install -m755 kiln $(DESTDIR)$(BINDIR)/kiln
|
2021-08-25 21:09:27 +02:00
|
|
|
install -m644 docs/kiln.1 $(DESTDIR)$(MANDIR)/man1/kiln.1
|
2020-11-02 02:51:43 +01:00
|
|
|
|
|
|
|
uninstall:
|
2020-11-20 18:07:38 +01:00
|
|
|
$(RM) $(DESTDIR)$(BINDIR)/kiln
|
2020-11-11 01:34:05 +01:00
|
|
|
$(RM) $(DESTDIR)$(MANDIR)/man1/kiln.1
|
2020-11-02 02:51:43 +01:00
|
|
|
|
2021-04-20 22:57:05 +02:00
|
|
|
.PHONY: all docs clean install uninstall
|