]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
*.mk: Don't rmdir
authorAlejandro Colomar <alx@kernel.org>
Sat, 29 Apr 2023 17:09:16 +0000 (19:09 +0200)
committerAlejandro Colomar <alx@kernel.org>
Sat, 29 Apr 2023 17:17:49 +0000 (19:17 +0200)
There's no need; we can leave empty dirs on 'make uninstall', and it
allows some simplifications.  We don't need the FORCE target anymore,
and don't need some directory variables either.  While at it, I found
some unused variable that should have been removed a long time ago:
$installdirs_manX

Signed-off-by: Alejandro Colomar <alx@kernel.org>
Makefile
share/mk/cmd.mk
share/mk/install/_.mk
share/mk/install/html.mk
share/mk/install/man.mk
share/mk/src.mk

index 411aa5ad2157c245053e516960ef17819cd2e7de..dd9d527bfc7ea5f0d682e22719c4f2d854c309cf 100644 (file)
--- a/Makefile
+++ b/Makefile
 #   is in a variable of the same name but without the '_'.  The subdir is
 #   named after this project: <*/man>.
 # - Variables ending in '_rm' refer to files that can be removed (exist).
-# - Variables ending in '_rmdir' refer to dirs that can be removed (exist).
 # - Targets of the form '%-rm' remove their corresponding file '%'.
-# - Targets of the form '%-rmdir' remove their corresponding dir '%'.
-# - The 'FORCE' target is used to make phony some variables that can't be
-#   .PHONY to avoid some optimizations.
 #
 ########################################################################
 
@@ -242,4 +238,3 @@ help-variables:
 
 
 .DELETE_ON_ERROR:
-FORCE:
index dfeafcebc401ba3d90e1e5b1f8cd13c509e1c7de..aa7c07c1c0d7b3230c7c96a756a43e81f3cd3777 100644 (file)
@@ -35,7 +35,6 @@ XZ         := xz
 
 INSTALL_DATA := $(INSTALL) -m 644
 INSTALL_DIR  := $(INSTALL) -m 755 -d
-RMDIR        := rmdir --ignore-fail-on-non-empty
 
 
 endif  # include guard
index 98f6f888feaf28622825692ad474982a14e03cd3..751ab97e21983d08082ee9b7e6afabb2b0e6013e 100644 (file)
@@ -26,10 +26,6 @@ $(DESTDIR)%/:
        $(info RM       $*)
        $(RM) $*
 
-%-rmdir:
-       $(info RMDIR    $(@D))
-       $(RMDIR) $(@D)
-
 
 .PHONY: install
 install: install-man;
index ae518d2c2cc7cd667921d592649267f12995cf0d..97e00ce17056b9c50d1df981cee7410c442e94dc 100644 (file)
@@ -18,10 +18,7 @@ _htmldir := $(DESTDIR)$(htmldir_)
 
 
 _htmlpages      := $(patsubst $(_HTMLDIR)/%,$(_htmldir)/%,$(_HTMLPAGES))
-_htmldirs       := $(patsubst $(MANDIR)/%,$(_htmldir)/%,$(MANDIRS))
 _htmlpages_rm   := $(addsuffix -rm,$(wildcard $(_htmlpages)))
-_htmldirs_rmdir := $(addsuffix -rmdir,$(wildcard $(_htmldirs)))
-_htmldir_rmdir  := $(addsuffix -rmdir,$(wildcard $(_htmldir)/))
 
 
 $(_htmlpages): $(_htmldir)/%: $(_HTMLDIR)/% | $$(@D)/
@@ -33,7 +30,7 @@ $(_htmlpages): $(_htmldir)/%: $(_HTMLDIR)/% | $$(@D)/
 install-html: $(_htmlpages);
 
 .PHONY: uninstall-html
-uninstall-html: $(_htmldir_rmdir) $(_htmldirs_rmdir) $(_htmlpages_rm);
+uninstall-html: $(_htmlpages_rm);
 
 
 endif  # include guard
index caafe5e093911c61651a0c99af2dea7395cb804f..a135788cdae584154d5acc60d878d5ffa813f534 100644 (file)
@@ -63,14 +63,6 @@ _man5dir      := $(DESTDIR)$(man5dir)
 _man6dir      := $(DESTDIR)$(man6dir)
 _man7dir      := $(DESTDIR)$(man7dir)
 _man8dir      := $(DESTDIR)$(man8dir)
-_mandirs      := $(_man1dir)/ \
-                 $(_man2dir)/ $(_man2typedir)/ \
-                 $(_man3dir)/ $(_man3constdir)/ $(_man3headdir)/ $(_man3typedir)/ \
-                 $(_man4dir)/ \
-                 $(_man5dir)/ \
-                 $(_man6dir)/ \
-                 $(_man7dir)/ \
-                 $(_man8dir)/ \
 
 _man1pages      := $(patsubst $(MANDIR)/man1/%,$(_man1dir)/%$(Z),$(MAN1PAGES))
 _man2pages      := $(patsubst $(MANDIR)/man2/%,$(_man2dir)/%$(Z),$(MAN2PAGES))
@@ -106,24 +98,8 @@ _man6pages_rm     := $(addsuffix -rm,$(wildcard $(_man6pages)))
 _man7pages_rm     := $(addsuffix -rm,$(wildcard $(_man7pages)))
 _man8pages_rm     := $(addsuffix -rm,$(wildcard $(_man8pages)))
 
-_mandirs_rmdir     := $(addsuffix -rmdir,$(wildcard $(_mandirs)))
-_man1dir_rmdir     := $(addsuffix -rmdir,$(wildcard $(_man1dir)))
-_man2dir_rmdir     := $(addsuffix -rmdir,$(wildcard $(_man2dir)))
-_man2typedir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man2typedir)))
-_man3dir_rmdir     := $(addsuffix -rmdir,$(wildcard $(_man3dir)))
-_man3constdir_rmdir:= $(addsuffix -rmdir,$(wildcard $(_man3constdir)))
-_man3headdir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man3headdir)))
-_man3typedir_rmdir := $(addsuffix -rmdir,$(wildcard $(_man3typedir)))
-_man4dir_rmdir     := $(addsuffix -rmdir,$(wildcard $(_man4dir)))
-_man5dir_rmdir     := $(addsuffix -rmdir,$(wildcard $(_man5dir)))
-_man6dir_rmdir     := $(addsuffix -rmdir,$(wildcard $(_man6dir)))
-_man7dir_rmdir     := $(addsuffix -rmdir,$(wildcard $(_man7dir)))
-_man8dir_rmdir     := $(addsuffix -rmdir,$(wildcard $(_man8dir)))
-_mandir_rmdir      := $(addsuffix -rmdir,$(wildcard $(_mandir)/))
-
 MAN_SECTIONS     := 1 2 2type 3 3const 3head 3type 4 5 6 7 8
 install_manX     := $(foreach x,$(MAN_SECTIONS),install-man$(x))
-installdirs_manX := $(foreach x,$(MAN_SECTIONS),installdirs-man$(x))
 uninstall_manX   := $(foreach x,$(MAN_SECTIONS),uninstall-man$(x))
 
 
@@ -187,9 +163,6 @@ else ifeq ($(Z),.xz)
        fi
 endif
 
-$(_mandirs_rmdir): $(_mandir)/man%/-rmdir: $$(_man%pages_rm) FORCE
-$(_mandir_rmdir): $(uninstall_manX) FORCE
-
 
 .PHONY: install-man1
 install-man1:      $(_man1pages);
@@ -220,10 +193,10 @@ install-man8:      $(_man8pages);
 install-man: $(install_manX);
 
 .PHONY: $(uninstall_manX)
-$(uninstall_manX): uninstall-man%: $$(_man%pages_rm) $$(_man%dir_rmdir);
+$(uninstall_manX): uninstall-man%: $$(_man%pages_rm);
 
 .PHONY: uninstall-man
-uninstall-man: $(_mandir_rmdir) $(uninstall_manX);
+uninstall-man: $(uninstall_manX);
 
 
 endif  # include guard
index e753c4f7b22f49cf8b22fb7a7c0562c231397501..76deb8230a58ba48cb67a26e28b449f5f95e877d 100644 (file)
@@ -19,8 +19,6 @@ MANPAGES := $(shell $(FIND) $(MANDIR)/man*/ -type f \
                | $(GREP) '$(MANEXT)' \
                | $(SORT) \
                | $(SED) 's,:,\\:,g')
-MANDIRS  := $(shell $(FIND) $(MANDIR)/man* -type d \
-               | $(SORT))
 
 MAN1PAGES      := $(filter %.1,$(MANPAGES))
 MAN2PAGES      := $(filter %.2,$(MANPAGES))