Permalink
Browse files

Added mostly autogenerated man page. Dependency on executable is broken.

  • Loading branch information...
1 parent e90d75d commit 23a3427a8a473d0d63081d5223f97450aace2913 @mschuerig committed Jan 10, 2009
Showing with 49 additions and 1 deletion.
  1. +18 −1 Makefile.am
  2. +2 −0 configure.ac
  3. +4 −0 hangon.x
  4. +25 −0 tutorial.texi
View
@@ -2,4 +2,21 @@ SUBDIRS = po src tests
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = config.rpath m4/ChangeLog
+man_page = $(PACKAGE).1
+man_MANS = $(man_page)
+CLEANFILES = $(man_page)
+
+EXTRA_DIST = config.rpath m4/ChangeLog $(man_MANS)
+
+# Create the man page from --help and --version output
+
+common_dep = $(top_srcdir)/configure.ac
+### TODO remove the explicit name
+$(man_page): $(common_dep) $(srcdir)/hangon.x $(srcdir)/src/hangon.c
+
+SUFFIXES = .x .1
+.x.1:
+ $(HELP2MAN) \
+ --no-info \
+ --include=$(srcdir)/$*.x \
+ --output=$@ src/$*
View
@@ -34,5 +34,7 @@ AC_CONFIG_FILES([tests/Makefile])
# but not required for simply building it.
# autom4te: used for merging tests into a suite
AM_MISSING_PROG([AUTOM4TE], [autom4te])
+# help2man: used for deriving man pages from --help and --version output
+AM_MISSING_PROG([HELP2MAN], [help2man])
AC_OUTPUT
View
@@ -0,0 +1,4 @@
+[NAME]
+hangon \- restart a command until it finishes
+[DESCRIPTION]
+.\" Add any additional description here
View
@@ -79,3 +79,28 @@ $ autoreconf
$ make check
### Add a man page
+
+# -> configure.ac
+# help2man: used for deriving man pages from --help and --version output
+AM_MISSING_PROG([HELP2MAN], [help2man])
+
+# -> Makefile.am
+
+man_page = $(PACKAGE).1
+man_MANS = $(man_page)
+CLEANFILES = $(man_page)
+
+EXTRA_DIST = config.rpath m4/ChangeLog $(man_MANS)
+
+# Create the man page from --help and --version output
+
+common_dep = $(top_srcdir)/configure.ac
+### TODO remove the explicit name
+$(man_page): $(common_dep) $(srcdir)/hangon.x $(srcdir)/src/hangon.c
+
+SUFFIXES = .x .1
+.x.1:
+ $(HELP2MAN) \
+ --no-info \
+ --include=$(srcdir)/$*.x \
+ --output=$@ src/$*

0 comments on commit 23a3427

Please sign in to comment.