]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: improve asciidoc generic rule
authorKarel Zak <kzak@redhat.com>
Thu, 1 Apr 2021 09:47:21 +0000 (11:47 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 1 Apr 2021 09:47:21 +0000 (11:47 +0200)
* keep it based on suffixes to make possible to generate individual
  pages in dependence on original .adoc
* use absolute builddir to be robust enough for 'make distcheck'
* make man page links depend on man pages

Signed-off-by: Karel Zak <kzak@redhat.com>
Makefile.am

index 0e2d6ea3dec1c55da256e99f024f0020608550ba..48e89559b907253b291c03d03b16cad5dd002499 100644 (file)
@@ -206,12 +206,16 @@ dist_man_MANS += $(MANPAGES) $(MANLINKS)
 CLEANFILES += $(dist_man_MANS)
 EXTRA_DIST += $(MANPAGES:=.adoc) $(MANPAGES_EXTRA)
 
-$(MANPAGES): $(MANPAGES:=.adoc) $(MANPAGES_EXTRA) Makefile
-       @ rm -f $@
-       $(AM_V_at) $(MKDIR_P) $$(dirname $@)
-       $(AM_V_GEN) srcdir=''; \
-               test -f ./$@.adoc || srcdir=$(srcdir)/; \
-               $(asciidoc_man_cmd) --base-dir=$${srcdir} $${srcdir}$@.adoc --destination-dir $$(dirname $@)
+$(MANPAGES): $(MANPAGES_EXTRA) Makefile
+
+SUFFIXES = .1.adoc .3.adoc .5.adoc .8.adoc .1 .3 .5 .8
+.1.adoc.1 .3.adoc.3 .5.adoc.5 .8.adoc.8:
+       $(AM_V_GEN) test -f ./$@ || \
+               $(MKDIR_P) $$(dirname $@) && \
+               $(asciidoc_man_cmd) --base-dir=$(abs_srcdir) \
+                                   --destination-dir $(abs_builddir)/$$(dirname $@) $<
+
+$(MANLINKS): $(MANPAGES)
 
 gen-man: $(dist_man_MANS)