mirror of https://github.com/mkerrisk/man-pages
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:
parent
34afcb0dad
commit
5f9596780c
6
Makefile
6
Makefile
|
@ -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 \
|
||||
|
|
Loading…
Reference in New Issue