diff --git a/.gitignore b/.gitignore
index d661ba9..1a7b417 100644
--- a/.gitignore
+++ b/.gitignore
unit/test-*.log
unit/test-*.trs
+doc/btmon.1
+
android/system-emulator
android/bluetoothd
android/mcaptest
diff --git a/Makefile.am b/Makefile.am
index 4588ce8..2f05ceb 100644
--- a/Makefile.am
+++ b/Makefile.am
pkgconfig_DATA = lib/bluez.pc
endif
+manual_pages = doc/btmon.1
+
+dist_man_MANS += $(manual_pages)
+
+EXTRA_DIST += $(manual_pages:.1=.txt)
+
DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --enable-library \
--disable-systemd --disable-udev
-DISTCLEANFILES = $(pkgconfig_DATA)
+DISTCLEANFILES = $(pkgconfig_DATA) $(manual_pages)
MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 configure config.h.in config.sub config.guess \
%.service: %.service.in Makefile
$(SED_PROCESS)
+%.1: %.txt
+ $(AM_V_GEN)a2x --doctype manpage --format manpage $(srcdir)/$<
+
src/builtin.h: src/genbuiltin $(builtin_sources)
$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
diff --git a/doc/btmon.txt b/doc/btmon.txt
new file mode 100644
index 0000000..7a7fc53
--- /dev/null
+++ b/doc/btmon.txt
+BTMON(1)
+========
+:doctype: manpage
+
+
+NAME
+----
+btmon - Bluetooth monitor
+
+
+SYNOPSIS
+--------
+*btmon* ['OPTIONS']
+
+
+DESCRIPTION
+-----------
+The btmon(1) command provides access to the Bluetooth subsystem monitor
+infrastructure for reading HCI traces.
+
+
+AUTHOR
+------
+btmon was originally written by Marcel Holtmann.
+
+
+RESOURCES
+---------
+See <http://www.bluez.org/>
+
+
+COPYING
+-------
+Free use of this software is granted under ther terms of the GNU Lesser
+General Public Licenses (LGPL).