1
0
mirror of https://github.com/containers/netavark.git synced 2026-02-05 15:45:47 +01:00
Files
netavark/docs/Makefile
Daniel J Walsh 2d461e397b Add man page and install to Makefile
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-14 10:59:01 -04:00

28 lines
755 B
Makefile

PREFIX := /usr/local
DATADIR := ${PREFIX}/share
MANDIR := $(DATADIR)/man
GOMD2MAN ?= $(shell command -v go-md2man || echo '$(GOBIN)/go-md2man')
docs: $(patsubst %.md,%,$(wildcard *.md))
%.1: %.1.md
### sed is used to filter http/s links as well as relative links
### replaces "\" at the end of a line with two spaces
### this ensures that manpages are renderd correctly
@sed -e 's/\((buildah[^)]*\.md\(#.*\)\?)\)//g' \
-e 's/\[\(buildah[^]]*\)\]/\1/g' \
-e 's/\[\([^]]*\)](http[^)]\+)/\1/g' \
-e 's;<\(/\)\?\(a\|a\s\+[^>]*\|sup\)>;;g' \
-e 's/\\$$/ /g' $< | \
$(GOMD2MAN) -in /dev/stdin -out $@
.PHONY: install
install:
install -d ${DESTDIR}/${MANDIR}/man1
install -m 0644 *.1 ${DESTDIR}/${MANDIR}/man1
.PHONY: clean
clean:
$(RM) *.1