]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
*.mk: Use $(foreach ...) to reduce repetition
authorAlejandro Colomar <alx@kernel.org>
Mon, 28 Aug 2023 00:15:25 +0000 (02:15 +0200)
committerAlejandro Colomar <alx@kernel.org>
Mon, 28 Aug 2023 00:16:01 +0000 (02:16 +0200)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
share/mk/install/man.mk

index f254ddd00dff5c7f36170cc77be06a4c8a89c056..f27194fb65daf4fb525e3d7cf0b307e54b9ad7f9 100644 (file)
@@ -56,19 +56,8 @@ $(foreach s, $(MANSECTIONS),                                                  \
 $(_manpages):
        $(info INSTALL  $@)
        <$< \
-       $(SED) \
-               -e '/^\.so /s, man1/\(.*\)\.1$$, $(notdir $(man1dir))/\1$(man1ext),' \
-               -e '/^\.so /s, man2/\(.*\)\.2$$, $(notdir $(man2dir))/\1$(man2ext),' \
-               -e '/^\.so /s, man2type/\(.*\)\.2type$$, $(notdir $(man2typedir))/\1$(man2typeext),' \
-               -e '/^\.so /s, man3/\(.*\)\.3$$, $(notdir $(man3dir))/\1$(man3ext),' \
-               -e '/^\.so /s, man3const/\(.*\)\.3const$$, $(notdir $(man3constdir))/\1$(man3constext),' \
-               -e '/^\.so /s, man3head/\(.*\)\.3head$$, $(notdir $(man3headdir))/\1$(man3headext),' \
-               -e '/^\.so /s, man3type/\(.*\)\.3type$$, $(notdir $(man3typedir))/\1$(man3typeext),' \
-               -e '/^\.so /s, man4/\(.*\)\.4$$, $(notdir $(man4dir))/\1$(man4ext),' \
-               -e '/^\.so /s, man5/\(.*\)\.5$$, $(notdir $(man5dir))/\1$(man5ext),' \
-               -e '/^\.so /s, man6/\(.*\)\.6$$, $(notdir $(man6dir))/\1$(man6ext),' \
-               -e '/^\.so /s, man7/\(.*\)\.7$$, $(notdir $(man7dir))/\1$(man7ext),' \
-               -e '/^\.so /s, man8/\(.*\)\.8$$, $(notdir $(man8dir))/\1$(man8ext),' \
+       $(SED) $(foreach s, $(MANSECTIONS), \
+               -e '/^\.so /s, man$(s)/\(.*\)\.$(s)$$, $(notdir $(man$(s)dir))/\1$(man$(s)ext),') \
        | $(INSTALL_DATA) -T /dev/stdin $@
 ifeq ($(LINK_PAGES),symlink)
        if $(GREP) '^\.so ' <$@ >/dev/null; then \