mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 09:23:09 +00:00
47 lines
715 B
Makefile
47 lines
715 B
Makefile
.POSIX:
|
|
.SUFFIXES:
|
|
.SUFFIXES: .1 .1.scd
|
|
|
|
VERSION=0.1.0
|
|
|
|
PREFIX?=/usr/local
|
|
BINDIR?=$(PREFIX)/bin
|
|
MANDIR?=$(PREFIX)/share/man
|
|
|
|
VPATH=doc
|
|
GO?=go
|
|
GOFLAGS?=
|
|
GOSRC!=find . -name '*.go'
|
|
GOSRC+=go.mod go.sum
|
|
|
|
DOCS := \
|
|
kiln.1
|
|
|
|
all: kiln doc
|
|
|
|
doc: $(DOCS)
|
|
|
|
.1.scd.1:
|
|
scdoc < $< > $@
|
|
|
|
kiln: $(GOSRC)
|
|
$(GO) build $(GOFLAGS) \
|
|
-ldflags "-X main.Prefix=$(PREFIX) \
|
|
-X main.Version=$(VERSION)" \
|
|
-o $@
|
|
|
|
clean:
|
|
$(RM) kiln
|
|
$(RM) $(DOCS)
|
|
|
|
install: all
|
|
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
|
|
install -m755 kiln $(DESTDIR)$(BINDIR)/kiln
|
|
install -m755 kiln.1 $(MANDIR)/man1/kiln.1
|
|
|
|
uninstall:
|
|
$(RM) $(DESTDIR)$(BINDIR)/kiln
|
|
$(RM) $(DESTDIR)$(MANDIR)/man1/kiln.1
|
|
|
|
.PHONY: all doc clean install uninstall
|