2017-04-14 20:48:53 +08:00
|
|
|
PREFIX := /usr/local
|
|
|
|
DATADIR := ${PREFIX}/share
|
|
|
|
MANDIR := $(DATADIR)/man
|
2021-11-01 18:58:50 +08:00
|
|
|
# Following go-md2man is guaranteed on host
|
|
|
|
GOMD2MAN ?= ../tests/tools/build/go-md2man
|
2022-04-28 17:58:10 +08:00
|
|
|
ifeq ($(shell uname -s),FreeBSD)
|
|
|
|
SED=gsed
|
|
|
|
else
|
|
|
|
SED=sed
|
|
|
|
endif
|
2017-03-23 02:40:31 +08:00
|
|
|
|
2021-09-28 22:41:24 +08:00
|
|
|
docs: $(patsubst %.md,%,$(wildcard *.md))
|
2017-03-23 02:40:31 +08:00
|
|
|
|
2021-09-28 22:41:24 +08:00
|
|
|
%.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
|
2022-01-25 06:20:04 +08:00
|
|
|
### this ensures that manpages are rendered correctly
|
2023-06-03 07:31:09 +08:00
|
|
|
@$(SED) -e 's/\((buildah[^)]*\.md\(#.*\)\?)\)//g' \
|
2021-09-28 22:41:24 +08:00
|
|
|
-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 $@
|
|
|
|
|
2017-03-29 03:37:24 +08:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
2017-04-14 20:48:53 +08:00
|
|
|
install -d ${DESTDIR}/${MANDIR}/man1
|
|
|
|
install -m 0644 buildah*.1 ${DESTDIR}/${MANDIR}/man1
|
2021-08-25 02:03:02 +08:00
|
|
|
install -m 0644 links/buildah*.1 ${DESTDIR}/${MANDIR}/man1
|
2017-03-29 03:37:24 +08:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
$(RM) buildah*.1
|