summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-09-04 12:32:46 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-09-04 12:32:46 +0200
commitf0699a35b00d0ae35198485ce09af83665c4a88a (patch)
tree06e7bfa1bbea91505cc1eade5b5e47dd01bd3cd5
parent61380bd7ea3421118228d1823e7a3d87d91bda0e (diff)
downloadlibqmi-f0699a35b00d0ae35198485ce09af83665c4a88a.tar.gz
man: generate qmicli manpage from --help-all
-rw-r--r--.gitignore2
-rw-r--r--configure.ac6
-rw-r--r--docs/Makefile.am2
-rw-r--r--docs/man/Makefile.am21
4 files changed, 29 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 46ad4084..2549070d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -76,3 +76,5 @@ docs/reference/libqmi-glib/html
docs/reference/libqmi-glib/tmpl
docs/reference/libqmi-glib/xml
docs/reference/libqmi-glib/.libs
+
+docs/man/qmicli.1
diff --git a/configure.ac b/configure.ac
index 356fbba3..f04c4467 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,6 +86,9 @@ AC_SUBST(GLIB_MKENUMS)
dnl Documentation
GTK_DOC_CHECK(1.0)
+dnl Man page
+AC_PATH_PROG(HELP2MAN, help2man, false)
+
AC_CONFIG_FILES([Makefile
data/Makefile
data/pkg-config/Makefile
@@ -103,7 +106,8 @@ AC_CONFIG_FILES([Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/libqmi-glib/Makefile
- docs/reference/libqmi-glib/version.xml])
+ docs/reference/libqmi-glib/version.xml
+ docs/man/Makefile])
AC_OUTPUT
echo "
diff --git a/docs/Makefile.am b/docs/Makefile.am
index f3ddc22d..88a54add 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1 +1 @@
-SUBDIRS = reference
+SUBDIRS = reference man
diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am
new file mode 100644
index 00000000..608545b1
--- /dev/null
+++ b/docs/man/Makefile.am
@@ -0,0 +1,21 @@
+
+dist_man_MANS = qmicli.1
+
+# List of all source files which affect the output of --help-all
+SOURCES_WITH_HELP = \
+ $(top_srcdir)/cli/qmicli.c \
+ $(top_srcdir)/cli/qmicli-dms.c \
+ $(top_srcdir)/cli/qmicli-nas.c \
+ $(top_srcdir)/cli/qmicli-wds.c \
+ $(top_srcdir)/cli/qmicli-pbm.c \
+ $(top_srcdir)/cli/qmicli-uim.c
+
+# Depend only in the source files, not in the actual program, so that the
+# manpage doesn't get rebuilt when building from a tarball
+qmicli.1: $(SOURCES_WITH_HELP)
+ - $(AM_V_GEN) $(HELP2MAN) \
+ --output=$@ \
+ --name='Control QMI devices' \
+ --help-option='--help-all' \
+ --libtool \
+ $(top_builddir)/cli/qmicli