mirror of
https://github.com/containers/netavark.git
synced 2026-02-05 06:45:56 +01:00
- build docs on install if needed - clean should remove the .7 page - add uninstall target so users can remove the pages from the system Fixes #1179 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
34 lines
674 B
Makefile
34 lines
674 B
Makefile
PREFIX ?= /usr/local
|
|
DATADIR ?= ${PREFIX}/share
|
|
MANDIR ?= $(DATADIR)/man
|
|
GO ?= go
|
|
GOMD2MAN ?= go-md2man
|
|
|
|
docs: $(patsubst %.md,%,$(wildcard *.[0-9].md))
|
|
|
|
%.1: %.1.md
|
|
$(GOMD2MAN) -in $^ -out $@
|
|
|
|
%.7: %.7.md
|
|
$(GOMD2MAN) -in $^ -out $@
|
|
|
|
.PHONY: .install.md2man
|
|
.install.md2man:
|
|
$(GO) install github.com/cpuguy83/go-md2man/v2@latest
|
|
|
|
.PHONY: install
|
|
install: docs
|
|
install -d ${DESTDIR}/${MANDIR}/man1
|
|
install -m 0644 *.1 ${DESTDIR}/${MANDIR}/man1
|
|
install -d ${DESTDIR}/${MANDIR}/man7
|
|
install -m 0644 *.7 ${DESTDIR}/${MANDIR}/man7
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
rm -f ${DESTDIR}/${MANDIR}/man1/*.1
|
|
rm -f ${DESTDIR}/${MANDIR}/man7/*.7
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) *.1 *.7
|