From b1fdc9cdddd8709198d35ef19d6f825ffbf44353 Mon Sep 17 00:00:00 2001 From: Daemonratte Date: Tue, 28 Apr 2026 21:22:03 +0200 Subject: [PATCH] docs: avoid duplicate html and pdf targets Automake warns when html and pdf targets are defined separately in both branches of the HAVE_DOCBOOK conditional. Define the public html and pdf targets once and dispatch to DocBook or non-DocBook helper targets instead. This preserves the existing behavior while avoiding duplicate target warnings with newer Automake. --- docs/faq/Makefile.am | 48 ++++++++++++++++++++++++-------------- docs/tutorial/Makefile.am | 49 +++++++++++++++++++++++++-------------- 2 files changed, 62 insertions(+), 35 deletions(-) diff --git a/docs/faq/Makefile.am b/docs/faq/Makefile.am index f53c96c5d..988d66c0c 100644 --- a/docs/faq/Makefile.am +++ b/docs/faq/Makefile.am @@ -4,7 +4,20 @@ EXTRA_DIST += \ gtk-faq.sgml if HAVE_DOCBOOK -html: +FAQ_HTML_TARGET = html-docbook +FAQ_PDF_TARGET = pdf-docbook +FAQ_DIST_TARGET = dist-hook-docbook + +all-local: html +else +FAQ_HTML_TARGET = html-no-docbook +FAQ_PDF_TARGET = pdf-no-docbook +FAQ_DIST_TARGET = dist-hook-no-docbook +endif + +html: $(FAQ_HTML_TARGET) + +html-docbook: if test -w $(srcdir); then \ (cd $(srcdir); \ db2html gtk-faq.sgml; \ @@ -12,33 +25,34 @@ html: mv gtk-faq html); \ fi -pdf: +html-no-docbook: + echo "***" + echo "*** Warning: FAQ not built" + echo "***" + +pdf: $(FAQ_PDF_TARGET) + +pdf-docbook: if test -w $(srcdir); then \ (cd $(srcdir); db2pdf gtk-faq.sgml); \ fi -all-local: html +pdf-no-docbook: + echo "***" + echo "*** Warning: FAQ not built" + echo "***" -dist-hook: html +dist-hook: $(FAQ_DIST_TARGET) + +dist-hook-docbook: html cp -Rp $(srcdir)/html $(distdir) -else -html: - echo "***" - echo "*** Warning: FAQ not built" - echo "***" -pdf: - echo "***" - echo "*** Warning: FAQ not built" - echo "***" - -dist-hook: +dist-hook-no-docbook: echo "***" echo "*** Warning: FAQ not built" echo "*** DISTRIBUTION IS INCOMPLETE" echo "***" -endif -.PHONY: html +.PHONY: html pdf html-docbook html-no-docbook pdf-docbook pdf-no-docbook dist-hook-docbook dist-hook-no-docbook -include $(top_srcdir)/git.mk diff --git a/docs/tutorial/Makefile.am b/docs/tutorial/Makefile.am index 488e09da3..bd4820492 100644 --- a/docs/tutorial/Makefile.am +++ b/docs/tutorial/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/Makefile.decl -.PHONY: html pdf +.PHONY: html pdf html-docbook html-no-docbook pdf-docbook pdf-no-docbook dist-hook-docbook dist-hook-no-docbook EXTRA_DIST += \ gtk-tut.sgml \ @@ -37,7 +37,20 @@ EXTRA_DIST += \ images/tictactoe.png if HAVE_DOCBOOK -html: gtk-tut.sgml +TUTORIAL_HTML_TARGET = html-docbook +TUTORIAL_PDF_TARGET = pdf-docbook +TUTORIAL_DIST_TARGET = dist-hook-docbook + +all-local: html +else +TUTORIAL_HTML_TARGET = html-no-docbook +TUTORIAL_PDF_TARGET = pdf-no-docbook +TUTORIAL_DIST_TARGET = dist-hook-no-docbook +endif + +html: $(TUTORIAL_HTML_TARGET) + +html-docbook: gtk-tut.sgml if test -w $(srcdir); then \ (cd $(srcdir); \ db2html gtk-tut.sgml; \ @@ -47,32 +60,32 @@ html: gtk-tut.sgml cp images/*.png html/images); \ fi -pdf: gtk-tut.sgml +html-no-docbook: + echo "***" + echo "*** Warning: Tutorial not built" + echo "***" + +pdf: $(TUTORIAL_PDF_TARGET) + +pdf-docbook: gtk-tut.sgml if test -w $(srcdir); then \ (cd $(srcdir); db2pdf gtk-tut.sgml); \ fi -all-local: html +pdf-no-docbook: + echo "***" + echo "*** Warning: Tutorial not built" + echo "***" -dist-hook: html +dist-hook: $(TUTORIAL_DIST_TARGET) + +dist-hook-docbook: html cp -Rp $(srcdir)/html $(distdir) -else -html: - echo "***" - echo "*** Warning: Tutorial not built" - echo "***" -pdf: - echo "***" - echo "*** Warning: Tutorial not built" - echo "***" - -dist-hook: +dist-hook-no-docbook: echo "***" echo "*** Warning: Tutorial not built" echo "*** DISTRIBUTION IS INCOMPLETE" echo "***" -endif - -include $(top_srcdir)/git.mk