Makefile: html: Simplify target

mkdir -p doesn't fail if the directory already exists.
Remove redundant checks.

Use .html as default HTDIR.
Remove checks for undefined HTDIR.

Show what the target does, as with other targets (remove '@').

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-05-09 23:39:01 +02:00 committed by Michael Kerrisk
parent 34afcb0dad
commit 5f9596780c
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,7 @@
DESTDIR=
prefix?=/usr
MANDIR=$(prefix)/share/man
HTDIR?=.html
all: remove install
@ -13,14 +14,13 @@ uninstall remove:
# make HTDIR=/some/dir HTOPTS=whatever html
# The sed removes the lines "Content-type: text/html\n\n"
html:
@if [ x$(HTDIR) = x ]; then echo "You must set HTDIR."; else \
for i in man?; do \
[ -d $(HTDIR)/"$$i" ] || mkdir -p $(HTDIR)/"$$i"; \
mkdir -p $(HTDIR)/"$$i"; \
find "$$i/" -type f | while read f; do \
man2html $(HTOPTS) $$f | \
sed -e '1,2d' > $(HTDIR)/"$$i"/`basename $$f`.html; \
done; \
done; fi
done
install:
for i in man?; do \