doc: Add manpages in the overview section for the two TCTIs.

These manuals describe what the libraries are and what they're used for.
Additional pages will be requierd to describe the individual
initialization functions for each and likely more as the need arises.

Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
diff --git a/.gitignore b/.gitignore
index 6217da8..758eaf6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@
 libtool
 ltmain.sh
 m4/
+man/man[0-9]/*
 Makefile
 Makefile.in
 missing
diff --git a/Makefile.am b/Makefile.am
index 453d6da..f372cba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,7 +52,9 @@
 endif #UNIT
 
 TESTS = $(check_PROGRAMS)
-CLEANFILES = $(nodist_pkgconfig_DATA)
+CLEANFILES = \
+    $(nodist_pkgconfig_DATA) \
+    $(man7_MANS)
 
 # headers and where to install them
 libsapidir      = $(includedir)/sapi
@@ -62,6 +64,10 @@
 # pkg-config files
 pkgconfigdir          = $(libdir)/pkgconfig
 nodist_pkgconfig_DATA = lib/sapi.pc lib/tcti-device.pc lib/tcti-socket.pc
+# man pages / documentation
+man7_MANS = man/man7/tcti-device.7 man/man7/tcti-socket.7
+
+EXTRA_DIST = man/tcti-device.7.in man/tcti-socket.7.in
 
 if UNIT
 test_tcti_device_CFLAGS  = $(CMOCKA_CFLAGS) -I$(srcdir)/include -I$(srcdir)/sysapi/include
@@ -176,10 +182,15 @@
 test_tpmclient_tpmclient_SOURCES  = $(TPMCLIENT_CXX) $(COMMON_C) $(SAMPLE_C)
 
 %.pc : %.pc.in
-	if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi
+	$(call make_parent_dir,$@)
 	sed -e "s,[@]VERSION[@],$(PACKAGE_VERSION),g; \
 	        s,[@]includedir[@],$(includedir),g;" $^ > $@
 
+man/man7/%.7 : man/%.7.in $(srcdir)/man/man-postlude.troff
+	$(call make_parent_dir,$@)
+	cat $^ $(srcdir)/man/man-postlude.troff > $@
+	sed -i -e "s,[@]VERSION[@],$(PACKAGE_VERSION),g;" $@
+
 LIBRARY_LDFLAGS = -fPIC -Wl,--no-undefined
 
 # simulator build / run scripts
@@ -225,3 +236,7 @@
 libtcti_device = tcti/libtcti-device.la
 libtcti_socket = tcti/libtcti-socket.la
 tpmclient   = test/tpmclient/tpmclient
+
+define make_parent_dir
+    if [ ! -d $(dir $1) ]; then mkdir -p $(dir $1); fi
+endef
diff --git a/man/man-postlude.troff b/man/man-postlude.troff
new file mode 100644
index 0000000..07589a6
--- /dev/null
+++ b/man/man-postlude.troff
@@ -0,0 +1,12 @@
+.SH AUTHOR
+Philip Tricca <philip.b.tricca@intel.com>
+.SH "SEE ALSO"
+.BR tcti-device (7),
+.BR tcti-socket (7),
+.BR tcti-tabrmd (7),
+.BR tpm2-abrmd (8)
+.SH COLOPHON
+This page is part of release @VERSION@ of Intel's implementation of the TCG
+TPM2 Software Stack (TSS2). A description of the project, information about
+reporting bugs, and the latest version of this page can be found at
+\%https://github.com/01org/tpm2.0-tss/.
diff --git a/man/tcti-device.7.in b/man/tcti-device.7.in
new file mode 100644
index 0000000..7551ad8
--- /dev/null
+++ b/man/tcti-device.7.in
@@ -0,0 +1,14 @@
+.\" Process this file with
+.\" groff -man -Tascii foo.1
+.\"
+.TH TCTI-DEVICE 7 "JUNE 2017" Intel "TPM2 Software Stack"
+.SH NAME
+tcti-device \- device driver TCTI library
+.SH SYNOPSIS
+A TPM Command Transmission Interface (TCTI) module for interaction with the
+TPM device driver.
+.SH DESCRIPTION
+tcti-device is a library that abstracts the details of direct communication
+with the device node exposed by the Linux kernel driver (typically /dev/tpm0).
+The interface exposed by this library is defined in the \*(lqTSS System Level
+API and TPM Command Transmission Interface Specification\*(rq specification.
diff --git a/man/tcti-socket.7.in b/man/tcti-socket.7.in
new file mode 100644
index 0000000..3d05856
--- /dev/null
+++ b/man/tcti-socket.7.in
@@ -0,0 +1,15 @@
+.\" Process this file with
+.\" groff -man -Tascii foo.1
+.\"
+.TH TCTI-SOCKET 7 "JUNE 2017" Intel "TPM2 Software Stack"
+.SH NAME
+tcti-socket \- TPM simulator TCTI library
+.SH SYNOPSIS
+A TPM Command Transmission Interface (TCTI) module for interaction with the
+Microsoft TPM2 simulator.
+.SH DESCRIPTION
+tcti-socket is a library that abstracts the details of direct communication
+with the interface and protocol exposed by the daemon hosting the TPM2
+reference implementation. The interface exposed by this library is defined
+in the \*(lqTSS System Level API and TPM Command Transmission Interface
+Specification\*(rq specification.