]> git.proxmox.com Git - mirror_qemu.git/commitdiff
build-sys: use a generic TEXI2MAN rule
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 13 Jan 2017 14:41:33 +0000 (15:41 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 16 Jan 2017 09:11:43 +0000 (10:11 +0100)
The recipe for making a man page from .texi is duplicated several
times over.  Capture it in suitable pattern rules instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20170113144135.5150-20-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Makefile
rules.mak

index 1d6a31deb31c98e0aaecc65d032d5a074d4e02c9..4a4a34ed8bab11f6d18533f738097ef60a41b54c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -552,35 +552,11 @@ qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
        $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
 
 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi
-       $(call quiet-command, \
-         perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
-         $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
-         "GEN","$@")
 qemu.1: qemu-option-trace.texi
-
 qemu-img.1: qemu-img.texi qemu-option-trace.texi qemu-img-cmds.texi
-       $(call quiet-command, \
-         perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
-         $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
-         "GEN","$@")
-
 fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
-       $(call quiet-command, \
-         perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
-         $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
-         "GEN","$@")
-
 qemu-nbd.8: qemu-nbd.texi qemu-option-trace.texi
-       $(call quiet-command, \
-         perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
-         $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
-         "GEN","$@")
-
 qemu-ga.8: qemu-ga.texi
-       $(call quiet-command, \
-         perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-ga.pod && \
-         $(POD2MAN) --section=8 --center=" " --release=" " qemu-ga.pod > $@, \
-         "GEN","$@")
 
 html: qemu-doc.html
 info: qemu-doc.info
index ce9e7e6ffe57ef5af768c25c1f98d8d50bdf7f36..a7b6c0b020e680d47b247b83f17bf3ea55b01a70 100644 (file)
--- a/rules.mak
+++ b/rules.mak
@@ -363,3 +363,13 @@ define unnest-vars
         $(eval -include $(patsubst %.o,%.d,$(patsubst %.mo,%.d,$($v))))
         $(eval $v := $(filter-out %/,$($v))))
 endef
+
+TEXI2MAN = $(call quiet-command, \
+       perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< $@.pod && \
+       $(POD2MAN) --section=$(subst .,,$(suffix $@)) --center=" " --release=" " $@.pod > $@, \
+       "GEN","$@")
+
+%.1:
+       $(call TEXI2MAN)
+%.8:
+       $(call TEXI2MAN)