From patchwork Thu Jul 5 14:42:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Reisner X-Patchwork-Id: 672 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id B56E85459701 for ; Thu, 5 Jul 2018 14:43:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on apollo X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED=0.1, DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,T_DKIMWL_WL_HIGH=-0.01 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Thu, 5 Jul 2018 14:43:15 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 85640BAD18F25; Thu, 5 Jul 2018 14:43:08 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Thu, 5 Jul 2018 14:43:08 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 690D92C794; Thu, 5 Jul 2018 14:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1530801788; bh=oX6efO0C17EHJvHqpTHAGAPhvObYO34EHLUfnQWNUS0=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Reply-To:Cc; b=DTbHNqntg/O26FABb1dXvzUL68m1+XE/L1axVcyUM4J0Vcte18IVGwgs4zs1LaWff hkMn35jycTYtnz9qaKry7ePr5SnbunFSEHNVQwbmNo32VB2988zkRpMGX3I62TdvGf 9zRr5yqMvShsOMZn4Th3yfn/tTq/vOKGcI0ZPB5DMlgnc48x5nGxfE1nj6ZVRsizTQ iFMczGgR7XBzKGjB5vXnq6S9EQim3bnx0FkGc+V34m8u+WPOiFr0AvnP9guAxz9rK8 gu/R4Wg4YmoTCdZDS4OhtoNUlcHFoleXMrEdcfpudtSs5DMBIgDQi6z1LRHJHb6QY7 tfjF0u/gqnViwC2ACfwGZgSlsswsNsnwd+efq7FWU4aoXyofWy1B41O5ijEjSRv9Ew 1ZfadDEo9Sz4v5cuky5tLpEZGzwFvn2ePw5D7FoxqNU8++MSYGWJi09IARTIe6Cv6B VoHbWUOlzBlcdys2jjXiYurFRKcAruc2fP7pj/WazA1bAyHrFzmV3yRpg5pk8fl+a4 GXNpEMrsJlQZIyeKI0bIDzY1W/AzXfM+n1tPXRk5SaC0J+HAPjjVEu+GxwVJUoCVcO RdcU4O5Kya8EmkqkqgWqq0aiwY2pNIiLkMY8Sd6kF/j4y1YIgn8G7l13aveIYCiO4L qq713bo4PTJDZSgFn2keo8v4= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id C79872C12B for ; Thu, 5 Jul 2018 14:43:06 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Thu, 5 Jul 2018 14:43:06 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 3DA36BAD18E12; Thu, 5 Jul 2018 14:42:55 +0000 (UTC) Received: from localhost (unknown [IPv6:2604:2000:1406:11:309a:eca6:7ba1:ff59]) (using TLSv1.2 with cipher DHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) (Authenticated sender: dreisner) by orion.archlinux.org (Postfix) with ESMTPSA id 64BA5BAD18E0C; Thu, 5 Jul 2018 14:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1530801775; bh=oX6efO0C17EHJvHqpTHAGAPhvObYO34EHLUfnQWNUS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gW1gZEX/oGIUUZItTkH1MyNov/JdTCWtVDSR/9qXVc7vGIwYK/3DT8XwBTouXVdFv d0vbpIEDScC+e6wYWmpT0S+Ud1zLAqbtBjg5zyIBkd4WPAiQDMVmX5fUgUNYJnwgeA mobFj6A4I5O9XWW5aLNhUTnRiDvgH6cELEDvlC+ZSuI92tM1TfNpPsBL9hTraC6y7Q 1JY1nvhyJRMFYPuY+AaUp3GP4JkujNE8kcyQ6kHW2P3fJsKl9UB6gEElHbDpuT3M6a 8jHYoMm86NDLUzMh6ZcfaxLd4mo2uxyHpq/He9Q+t8qHi0GxkshlpbX8jZUxMx2JIk dtlifvZkscKq0NAZJ7rlAlscZs+J/1ZX1n9hgfdhhh38dHyh/8ozRXzVgg5RivOfXQ xFI+WpqoTSQkxUHIoCFOBUceSbBFYeT3xpYJ4BSoflYQdy0DZ6OunZdfhyrOuPLeMn C0kCzBfHvRwOTBBE0GjpJkSXxOax4dlE06E89IN10gXm0ZLCoG1CGenor8K1pG+W9e oQ2eAeEP79cUBsswzot5cfNb4XU1FvdzztOr/eTSAMqsM0cyRPowLQU1GwXJoOhEh2 IemVcku7mCx1Xk3CA6XRpq6XenNCWvEajqE6o5pNLBD1CzFIeN58fDYHduaD0uTivg vZQ3LAri4aAg+cEzB3MFr/5A= From: Dave Reisner To: pacman-dev@archlinux.org Date: Thu, 5 Jul 2018 10:42:43 -0400 Message-Id: <20180705144244.15619-3-dreisner@archlinux.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180705144244.15619-1-dreisner@archlinux.org> References: <20180705144244.15619-1-dreisner@archlinux.org> Subject: [pacman-dev] [PATCH 3/4] doc: use implicit rules to build manpages X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Discussion list for pacman development Cc: Dave Reisner Errors-To: pacman-dev-bounces@archlinux.org Sender: "pacman-dev" Use implicit dependency rules to translate asciidoc inputs to HTML and manpage outputs. We should only have to declare explicit dependencies for odd cases, e.g. the PKGBUILD documentation has an additional include file and isn't a 1:1 conversion. --- doc/Makefile.am | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 8dec4ab1..2ac38cba 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -3,7 +3,7 @@ # files listed in EXTRA_DIST no matter what. However, we only add them to # man_MANS if --enable-asciidoc and/or --enable-doxygen are used. -ASCIIDOC_MANS = \ +MANPAGES = \ alpm-hooks.5 \ pacman.8 \ makepkg.8 \ @@ -66,11 +66,11 @@ EXTRA_DIST = \ submitting-patches.asciidoc \ translation-help.asciidoc \ Doxyfile \ - $(ASCIIDOC_MANS) \ + $(MANPAGES) \ $(DOXYGEN_MANS) # Files that should be removed, but which Automake does not know. -MOSTLYCLEANFILES = *.xml $(ASCIIDOC_MANS) $(HTML_DOCS) repo-remove.8 website.tar.gz +MOSTLYCLEANFILES = *.xml $(MANPAGES) $(HTML_DOCS) repo-remove.8 website.tar.gz # Ensure manpages are fresh when building a dist tarball dist-hook: @@ -85,7 +85,7 @@ REAL_PACKAGE_VERSION = $(PACKAGE_VERSION) endif man_MANS = -dist_man_MANS = $(ASCIIDOC_MANS) +dist_man_MANS = $(MANPAGES) if USE_DOXYGEN man_MANS += $(DOXYGEN_MANS) @@ -96,6 +96,7 @@ doxygen.in: $(DOXYGEN) $(srcdir)/Doxyfile endif +man: $(MANPAGES) html: $(HTML_DOCS) website: website.tar.gz @@ -129,11 +130,12 @@ A2X_OPTS = \ -f manpage \ --xsltproc-opts='-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0' -# These rules are due to the includes and files of the asciidoc text -$(ASCIIDOC_MANS): asciidoc.conf footer.asciidoc Makefile.am +# Generate manpages +%: %.asciidoc asciidoc.conf footer.asciidoc Makefile.am $(AM_V_GEN)a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS) --out-file=./$@.xml" $(srcdir)/$@.asciidoc -%.html: %.asciidoc +# Generate HTML pages +%.html: %.asciidoc asciidoc.conf footer.asciidoc Makefile.am $(AM_V_GEN)asciidoc $(ASCIIDOC_OPTS) -o - $*.asciidoc | \ sed -e 's/\r$$//' > $@ @@ -142,27 +144,15 @@ HACKING.html: ../HACKING sed -e 's/\r$$//' > $@ # Customizations for certain HTML docs -$(HTML_MANPAGES): asciidoc.conf footer.asciidoc Makefile.am -$(HTML_OTHER): asciidoc.conf Makefile.am %.html: ASCIIDOC_OPTS += -a linkcss -a toc -a icons -a max-width=960px -a stylesheet=asciidoc-override.css %.8.html: ASCIIDOC_OPTS += -d manpage %.5.html: ASCIIDOC_OPTS += -d manpage %.3.html: ASCIIDOC_OPTS += -d manpage -# Dependency rules -alpm-hooks.5 alpm-hooks.5.html: alpm-hooks.5.asciidoc -pacman.8 pacman.8.html: pacman.8.asciidoc -makepkg.8 makepkg.8.html: makepkg.8.asciidoc -makepkg-template.1 makepkg-template.1.html: makepkg-template.1.asciidoc -repo-add.8 repo-add.8.html: repo-add.8.asciidoc -vercmp.8 vercmp.8.html: vercmp.8.asciidoc -pkgdelta.8 pkgdelta.8.html: pkgdelta.8.asciidoc -pacman-key.8 pacman-key.8.html: pacman-key.8.asciidoc +# Custom dependency rules PKGBUILD.5 PKGBUILD.5.html: PKGBUILD.5.asciidoc PKGBUILD-example.txt -makepkg.conf.5 makepkg.conf.5.html: makepkg.conf.5.asciidoc -pacman.conf.5 pacman.conf.5.html: pacman.conf.5.asciidoc -libalpm.3 libalpm.3.html: libalpm.3.asciidoc -# this one is just a symlink + +# Manpages as symlinks repo-remove.8: repo-add.8 $(RM) repo-remove.8 $(LN_S) repo-add.8 repo-remove.8