docs/api: fix ugly things in Makefile

Turns out automake doesn't like either that we add dependencies to a
target conditionally. Not sure why, but it's a tasteless thing to do
nevertheless:

  gtk-doc.make:174: warning: $(DOC_MAIN_SGML_FILE) was already defined in condition BUILD_DOCS, which is included in condition TRUE ...
  docs/api/Makefile.am:112:   'gtk-doc.make' included from here
  docs/api/Makefile.am:14: ... '$(DOC_MAIN_SGML_FILE)' previously defined here

In any case, the dependency is wrong in the first place -- the source
document doesn't depend on other source. The target (which is a stamp
file, since the xslt processor produces multiple files) does! Moreover,
there's a dependency of the stamp file on $(content_files) already, so
including GENERATED_FILES (like we already do) in content_files should
be sufficient.

While at that, deal with other not-so-nice things; don't extend "all"
target needlessly and don't define a target conditionally.

(cherry picked from commit 4c49d67cc8)
This commit is contained in:
Lubomir Rintel 2022-11-07 19:52:21 +01:00
parent 8080aceb0f
commit 1b24d4db47

View file

@ -2,25 +2,12 @@ AUTOMAKE_OPTIONS = 1.7
XSLTPROC = xsltproc --xinclude --nonet
XMLS = $(wildcard $(top_srcdir)/introspection/nm-*.xml)
GENERATED_FILES =
if BUILD_DOCS
settings-spec.xml: settings-spec.xsl $(top_builddir)/man/nm-settings-docs-dbus.xml
$(AM_V_GEN) (! test -f $@ || chmod u+w $@) && xsltproc --output $@ $^
# Top-level SGML file includes (depends on) settings-spec.xml
$(DOC_MAIN_SGML_FILE): settings-spec.xml
GENERATED_FILES += settings-spec.xml
all: $(GENERATED_FILES)
endif
####################################
# The name of the module.
DOC_MODULE=NetworkManager
@ -130,7 +117,8 @@ setup-build.stamp:
fi
$(AM_V_at)touch setup-build.stamp
####################################
settings-spec.xml: settings-spec.xsl $(top_builddir)/man/nm-settings-docs-dbus.xml
$(AM_V_GEN) (! test -f $@ || chmod u+w $@) && xsltproc --output $@ $^
EXTRA_DIST += \
version.xml.in \