Description: 3dldf manpage for Debian
 Generate the manpage associated to the 3dldf interpreter
 through help2man within the autotools machinery.
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2014-06-05

--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,7 @@
 
 
 # Checks for programs.
+AC_PATH_PROG([HELP2MAN],[help2man])
 AC_PROG_CXX
 AC_PROG_CC
 AC_PROG_INSTALL
--- a/Makefile.am
+++ b/Makefile.am
@@ -72,6 +72,7 @@
 
 SUBDIRS = $(SOURCEDIR) $(EXAMPLESDIR)
 
+man_MANS = 3dldf.1
 
 .PHONY: dummy
 dummy:
@@ -144,6 +145,24 @@
 	echo "libdir = $(libdir)"
 	echo "SOURCEDIR = $(SOURCEDIR)"
 
+AM_H2MFLAGS = \
+	--no-discard-stderr \
+	--manual="3DLDF Manual" \
+	--version-string="$(PACKAGE_VERSION)" \
+	--source="Debian" \
+	--no-info
+
+%.1: %
+	$(HELP2MAN) \
+			-s 1 \
+			$(AM_H2MFLAGS) \
+			-I $(top_srcdir)/debian/man/$*.h2m \
+			-o $@ \
+		$(top_builddir)/src/$<
+
+CLEANFILES = \
+	$(man_MANS)
+
 ## Local Variables:
 ## mode:Makefile
 ## End:
