Index: common/waf.py
===================================================================
--- common/waf.py	(revision 47aad7a5c3727a23496bb7695cb42c03f82faa36)
+++ common/waf.py	(revision dd43d0b0f86c277bcd33b1f76e41209c23af6c49)
@@ -79,69 +79,4 @@
 	ctx.end_msg("yes (%s)" % ".".join(map(str, ver)))
 
-
-def doc_pdf(ctx, source_dir, conf_dir):
-	if not ctx.env.PDFLATEX or not ctx.env.MAKEINDEX:
-		ctx.fatal('The programs pdflatex and makeindex are required')
-
-        build_dir = ctx.path.get_bld().relpath()
-        output_dir = os.path.join(ctx.path.get_bld().abspath(), 'latex')
-
-	ctx(
-		rule   = "${BIN_SPHINX_BUILD} %s -b latex -c %s -d build/%s/doctrees %s %s" % (sphinx_verbose(ctx), conf_dir, build_dir, source_dir, output_dir),
-		cwd    = ctx.path,
-		source = ctx.path.ant_glob('**/*.rst'),
-		target = ctx.path.find_or_declare("latex/%s.tex" % (ctx.path.name))
-	)
-
-	ctx.add_group()
-
-	ctx(
-		features	= 'tex',
-		cwd             = output_dir,
-		type		= 'pdflatex',
-		source		= "latex/%s.tex" % ctx.path.name,
-		prompt		= 0
-	)
-
-def doc_singlehtml(ctx, source_dir, conf_dir):
-	if not ctx.env.BIN_INLINER:
-		ctx.fatal("Node inliner is required install with 'npm install -g inliner' (https://github.com/remy/inliner)")
-
-	ctx(
-		rule	= "${BIN_SPHINX_BUILD} -b singlehtml -c %s -j %d -d build/doctrees %s build/singlehtml" % (conf_dir, ctx.options.jobs, source_dir),
-		cwd		= ctx.path.abspath(),
-		source	= ctx.path.ant_glob('**/*.rst'),
-		target	= "singlehtml/index.html"
-	)
-
-	ctx.add_group()
-
-	ctx(
-		rule	= "${BIN_INLINER} ${SRC} > ${TGT}",
-		source	= "singlehtml/index.html",
-		target	= "singlehtml/%s.html" % ctx.path.name
-	)
-
-def is_top_build(ctx):
-        from_top = False
-        if ctx.env['BUILD_FROM_TOP'] and ctx.env['BUILD_FROM_TOP'] == 'yes':
-                from_top = True
-        return from_top
-
-def build_type(ctx):
-        build_type = 'html'
-        if ctx.options.pdf:
-                build_type = 'pdf'
-        return build_type
-
-def build_dir_setup(ctx):
-        btype = build_type(ctx)
-        where = btype
-        if is_top_build(ctx):
-                where = os.path.join(ctx.path.name, where)
-        bnode = ctx.bldnode.find_node(where)
-        if bnode is None:
-                ctx.bldnode.make_node(where).mkdir()
-        return where
 
 def html_resources(ctx):
@@ -167,4 +102,101 @@
 #	)
 
+def doc_pdf(ctx, source_dir, conf_dir):
+	if not ctx.env.PDFLATEX or not ctx.env.MAKEINDEX:
+		ctx.fatal('The programs pdflatex and makeindex are required')
+
+        build_dir = ctx.path.get_bld().relpath()
+        output_node = ctx.path.get_bld().make_node('latex')
+        output_dir = output_node.abspath()
+
+	ctx(
+		rule         = "${BIN_SPHINX_BUILD} %s -b latex -c %s -d build/%s/doctrees %s %s" % (sphinx_verbose(ctx), conf_dir, build_dir, source_dir, output_dir),
+		cwd          = ctx.path,
+		source       = ctx.path.ant_glob('**/*.rst'),
+		target       = ctx.path.find_or_declare("latex/%s.tex" % (ctx.path.name))
+	)
+
+	ctx.add_group()
+
+	ctx(
+		features     = 'tex',
+		cwd          = output_dir,
+		type         = 'pdflatex',
+		source       = "latex/%s.tex" % ctx.path.name,
+		prompt       = 0
+	)
+
+        ctx.install_files('${PREFIX}/%s' % (ctx.path.name),
+                          'latex/%s.pdf' % (ctx.path.name),
+                          cwd = output_node,
+                          quiet = True)
+
+def doc_singlehtml(ctx, source_dir, conf_dir):
+	if not ctx.env.BIN_INLINER:
+		ctx.fatal("Node inliner is required install with 'npm install -g inliner' (https://github.com/remy/inliner)")
+
+	html_resources(ctx)
+
+	ctx(
+		rule	= "${BIN_SPHINX_BUILD} -b singlehtml -c %s -j %d -d build/doctrees %s build/singlehtml" % (conf_dir, ctx.options.jobs, source_dir),
+		cwd		= ctx.path.abspath(),
+		source	= ctx.path.ant_glob('**/*.rst'),
+		target	= "singlehtml/index.html",
+                install_path = None
+	)
+
+	ctx.add_group()
+
+	ctx(
+		rule	= "${BIN_INLINER} ${SRC} > ${TGT}",
+		source	= "singlehtml/index.html",
+		target	= "singlehtml/%s.html" % ctx.path.name,
+                install_path = None
+	)
+
+def doc_html(ctx, conf_dir, source_dir):
+
+	html_resources(ctx)
+
+        build_dir = ctx.path.get_bld().relpath()
+        output_node = ctx.path.get_bld().make_node('html')
+        output_dir = output_node.abspath()
+
+	ctx(
+		rule         = "${BIN_SPHINX_BUILD} %s -b html -c %s -d build/%s/doctrees %s %s" % (sphinx_verbose(ctx), conf_dir, build_dir, source_dir, output_dir),
+		cwd          = ctx.path,
+		source       =  ctx.path.ant_glob('**/*.rst'),# + ctx.path.ant_glob('conf.py'),
+		target       = ctx.path.find_or_declare('html/index.html'),
+		install_path = None
+	)
+
+        ctx.install_files('${PREFIX}/%s' % (ctx.path.name),
+                          output_node.ant_glob('**/*'),
+                          cwd = output_node,
+                          relative_trick = True,
+                          quiet = True)
+
+def is_top_build(ctx):
+        from_top = False
+        if ctx.env['BUILD_FROM_TOP'] and ctx.env['BUILD_FROM_TOP'] == 'yes':
+                from_top = True
+        return from_top
+
+def build_type(ctx):
+        build_type = 'html'
+        if ctx.options.pdf:
+                build_type = 'pdf'
+        return build_type
+
+def build_dir_setup(ctx):
+        btype = build_type(ctx)
+        where = btype
+        if is_top_build(ctx):
+                where = os.path.join(ctx.path.name, where)
+        bnode = ctx.bldnode.find_node(where)
+        if bnode is None:
+                ctx.bldnode.make_node(where).mkdir()
+        return where
+
 def cmd_build(ctx, conf_dir = ".", source_dir = "."):
         build_dir_setup(ctx)
@@ -178,13 +210,5 @@
 		doc_singlehtml(ctx, source_dir, conf_dir)
 	else:
-		html_resources(ctx)
-                build_dir = ctx.path.get_bld().relpath()
-                output_dir = os.path.join(ctx.path.get_bld().abspath(), 'html')
-		ctx(
-			rule   = "${BIN_SPHINX_BUILD} %s -b html -c %s -d build/%s/doctrees %s %s" % (sphinx_verbose(ctx), conf_dir, build_dir, source_dir, output_dir),
-			cwd	= ctx.path,
-			source =  ctx.path.ant_glob('**/*.rst'),# + ctx.path.ant_glob('conf.py'),
-			target = ctx.path.find_or_declare('html/index.html')
-		)
+		doc_html(ctx, source_dir, conf_dir)
 
 def cmd_options(ctx):
Index: user/wscript
===================================================================
--- user/wscript	(revision 47aad7a5c3727a23496bb7695cb42c03f82faa36)
+++ user/wscript	(revision dd43d0b0f86c277bcd33b1f76e41209c23af6c49)
@@ -3,4 +3,8 @@
 path.append(abspath('../common/'))
 
-from waf import cmd_configure as configure, cmd_build as build, \
-                spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
+from waf import cmd_configure as configure, \
+                cmd_build as build, \
+                spell, \
+		cmd_spell, \
+		cmd_options as options, \
+		linkcheck, cmd_linkcheck
Index: wscript
===================================================================
--- wscript	(revision 47aad7a5c3727a23496bb7695cb42c03f82faa36)
+++ wscript	(revision dd43d0b0f86c277bcd33b1f76e41209c23af6c49)
@@ -28,5 +28,4 @@
     for b in building:
         conf.recurse(b)
-
     conf.env['BUILD_FROM_TOP'] = 'yes'
 
@@ -34,2 +33,6 @@
     for b in building:
         ctx.recurse(b)
+
+def install(ctx):
+    for b in building:
+        ctx.recurse(b)
