From 5f9596780c5ece8bcbc1fd322c54e77bdc7526b5 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 9 May 2021 23:39:01 +0200 Subject: [PATCH] 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 Signed-off-by: Michael Kerrisk --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ea31eab80..607b8c98b 100644 --- a/Makefile +++ b/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 \