Index: configure
===================================================================
--- configure	(revision 15810)
+++ configure	(working copy)
@@ -64,6 +64,7 @@
   echo "  --libdir-name=LIBNAME    search/install libraries in PREFIX/LIBNAME [$libdir_name]"
   echo "  --disable-ccache         disable compiler cache (ccache)"
   echo "  --disable-distcc         disable distributed compilation (distcc)"
+  echo "  --enable-dev-docs        builds the developer documentation"
 <<BLOCK_QUOTE
   echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
   echo "  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]"
@@ -862,6 +863,7 @@
 MYTHTV_CONFIG_LIST='
     backend
     dbox2
+    dev_docbuild
     directfb
     directx
     dvb
@@ -874,6 +876,7 @@
     lirc
     opengl_vsync
     opengl_video
+    user_docbuild
     v4l
     valgrind
     x11
@@ -1144,6 +1147,8 @@
 enable audio_oss
 bindings_perl="yes"
 dbox2="yes"
+dev_docbuild="no"
+directx="no"
 directfb="yes"
 dvb_path="/usr/include"
 dvb="yes"
@@ -1157,6 +1162,7 @@
 lamemp3="yes"
 lirc="yes"
 opengl="yes"
+user_docbuild="no"
 v4l="yes"
 x11="yes"
 x11_include_path="/usr/X11R6/include"
@@ -1311,6 +1317,8 @@
   ;;
   --arch=*) arch="$optval" && arch_raw="$optval" && enable cpu_override
   ;;
+  --disable-distcc) distcc="no"
+  ;;
   --cpu=*) cpu="$optval" && enable cpu_override
   ;;
 
@@ -1379,6 +1387,29 @@
           fi
       done
   ;;
+  --disable-dev-docs) dev_docbuild="no"
+  ;;
+  --enable-dev-docs) dev_docbuild="yes"
+        doxygen --version > /dev/null 2>&1
+        if test $? -ne 0 ; then
+            dev_docbuild="no"
+            echo "*** Doxygen unavailable, disabling dev-docs!"
+        fi
+  ;;
+  --disable-user-docs) user_docbuild="no"
+  ;;
+  --enable-user-docs) user_docbuild="yes"
+        which htmldoc > /dev/null 2>&1
+        if test $? -ne 0 ; then
+            user_docbuild="no"
+            echo "*** htmldoc unavailable, disabling user-docs!"
+        fi
+        which linuxdoc > /dev/null 2>&1
+        if test $? -ne 0 ; then
+            user_docbuild="no"
+            echo "*** linuxdoc unavailable, disabling user-docbuild!"
+        fi
+  ;;
   --disable-encoders) disable $ENCODER_LIST
   ;;
   --disable-decoders) disable $DECODER_LIST
@@ -2969,6 +3000,10 @@
 echo "# Misc Features"
 echo "Frontend                  ${frontend-no}"
 echo "Backend                   ${backend-no}"
+echo "Build Developer Docs      ${dev_docbuild}"
+if test x"${user_docbuild}" = x"yes"; then
+  echo "Build User Docs           ${user_docbuild}"
+fi
 echo
 
 echo "# Bindings"
Index: docs/docs.pro
===================================================================
--- docs/docs.pro	(revision 0)
+++ docs/docs.pro	(revision 0)
@@ -0,0 +1,110 @@
+# To build this stuff, you need the linuxdoc tools and htmldoc.  On Debian,
+# this means: linuxdoc-tools linuxdoc-tools-text htmldoc
+#
+#  - mdz
+
+#
+# The dev docs need "doxygen" to build.
+#
+
+include ( ../config.mak )
+include ( ../settings.pro )
+
+INSTALLDIR = $${PREFIX}/share/doc/mythtv
+
+TARGET = dummy
+SOURCES = dummy.c
+QMAKE_CLEAN += $${TARGET}
+
+phony.target = .PHONY
+phony.depends = clean install doc_installer
+QMAKE_EXTRA_UNIX_TARGETS += phony
+
+validate.target = validate
+validate.depends = mythtv-HOWTO.sgml
+validate.commands = linuxdoc -B check mythtv-HOWTO.sgml 2>&1 | tee validate
+QMAKE_EXTRA_UNIX_TARGETS += validate
+CLEAN_FILES += validate
+
+splithtml.target = index.html
+splithtml.depends = validate
+splithtml.commands = linuxdoc -B html --split=1 --toc=2 mythtv-HOWTO.sgml; \
+    $${QMAKE_MOVE} mythtv-HOWTO.html index.html
+QMAKE_EXTRA_UNIX_TARGETS += splithtml
+USER_INSTALLS += index.html mythtv-HOWTO-[0-9]*.html
+using_user_docbuild {
+    CLEAN_FILES += index.html mythtv-HOWTO-[0-9]*.html
+}
+
+singlehtml.target = mythtv-HOWTO-singlehtml.html
+singlehtml.depends = validate
+singlehtml.commands = linuxdoc -B html --split=0 --toc=2 mythtv-HOWTO.sgml; \
+    $${QMAKE_MOVE} mythtv-HOWTO.html mythtv-HOWTO-singlehtml.html
+QMAKE_EXTRA_UNIX_TARGETS += singlehtml
+#USER_INSTALLS += mythtv-HOWTO-singlehtml.html
+using_user_docbuild {
+    CLEAN_FILES += mythtv-HOWTO-singlehtml.html
+}
+
+textdoc.target = mythtv-HOWTO.txt
+textdoc.depends = validate
+textdoc.commands = linuxdoc -B txt mythtv-HOWTO.sgml
+QMAKE_EXTRA_UNIX_TARGETS += textdoc
+USER_INSTALLS += mythtv-HOWTO.txt
+using_user_docbuild {
+    CLEAN_FILES += mythtv-HOWTO.txt
+}
+
+pdf.target = mythtv-HOWTO.pdf
+pdf.depends = mythtv-HOWTO-singlehtml.html
+pdf.commands = htmldoc --book --quiet \
+    --outfile mythtv-HOWTO.pdf mythtv-HOWTO-singlehtml.html
+QMAKE_EXTRA_UNIX_TARGETS += pdf
+USER_INSTALLS += mythtv-HOWTO.pdf
+using_user_docbuild {
+    CLEAN_FILES += mythtv-HOWTO.pdf
+}
+
+devdocs.target = dev-docs
+devdocs.commands = doxygen doxygen-create-developer-docs.cfg
+QMAKE_EXTRA_UNIX_TARGETS += devdocs
+using_dev_docbuild {
+    DEV_INSTALLS += dev-docs
+}
+CLEAN_FILES += doxygen-warnings.txt
+CLEAN_COMMANDS += ; rm -Rf dev-docs
+
+# Ask qmake to clean these files
+# The commands MUST be last
+#
+QMAKE_CLEAN += $${CLEAN_FILES} $${CLEAN_COMMANDS}
+
+# Control what is built with a plain "make"
+#
+using_user_docbuild {
+    PRE_TARGETDEPS += index.html
+    PRE_TARGETDEPS += mythtv-HOWTO-singlehtml.html
+    PRE_TARGETDEPS += mythtv-HOWTO.txt
+    PRE_TARGETDEPS += mythtv-HOWTO.pdf
+}
+using_dev_docbuild {
+    PRE_TARGETDEPS += dev-docs
+}
+
+# Get on with it...
+# Install the file bundle, if not done as a separate group
+# qmake tries to build the docs when installing them.
+# This is a problem with doxygen :)
+#
+doc_installer.target = doc_installer
+doc_installer.path = $${INSTALLDIR}
+doc_installer.files = $${USER_INSTALLS} $${DEV_INSTALLS}
+INSTALLS += doc_installer
+
+# Ensure that the makefile is remade after any target is built.
+# This is needed as qmake expands the file wildcards when
+# it writes out the Makefile. If the install files/dirs do
+# not exist when "qmake docs.pro" is run it wont get
+# included in the install list
+#
+POST_TARGETDEPS += qmake
Index: docs/Makefile
===================================================================
--- docs/Makefile	(revision 15810)
+++ docs/Makefile	(working copy)
@@ -1,42 +0,0 @@
-# To build this stuff, you need the linuxdoc tools and htmldoc.  On Debian,
-# this means: linuxdoc-tools linuxdoc-tools-text htmldoc
-#
-#  - mdz
-
-TARGETS = mythtv-HOWTO.txt mythtv-HOWTO.html mythtv-HOWTO-singlehtml.html mythtv-HOWTO.pdf index.html
-LINUXDOC_HTML_SPLIT := 1
-
-all: $(TARGETS)
-clean:
-	rm -f $(TARGETS) $(patsubst %.html,%-[0-9]*.html,$(filter %.html,$(TARGETS)))
-	rm -Rf doxygen-dev-docs doxygen-warnings.txt
-
-distclean: clean
-
-validate: mythtv-HOWTO.sgml
-	linuxdoc -B check $<
-
-%.txt: %.sgml
-	linuxdoc -B txt $<
-
-# Generate PDF via LaTeX using linuxdoc
-#%.pdf: %.sgml
-#	linuxdoc -B latex -o pdf $<
-
-# Generate PDF via HTML using htmldoc
-%.pdf: %-singlehtml.html
-	# htmldoc exits unsuccessfully for no good reason -mdz
-	htmldoc --book --quiet --outfile $@ $< || true
-
-%.html: %.sgml
-	linuxdoc -B html --split=$(LINUXDOC_HTML_SPLIT) --toc=2 $<
-
-%-singlehtml.html: LINUXDOC_HTML_SPLIT=0
-%-singlehtml.sgml: %.sgml
-	cp $< $@
-
-index.html: mythtv-HOWTO.html
-	cp $< $@
-
-devdocs:
-	doxygen doxygen-create-developer-docs.cfg
Index: docs/doxygen-create-developer-docs.cfg
===================================================================
--- docs/doxygen-create-developer-docs.cfg	(revision 15810)
+++ docs/doxygen-create-developer-docs.cfg	(working copy)
@@ -30,7 +30,7 @@
 # If a relative path is entered, it will be relative to the location 
 # where doxygen was started. If left blank the current directory will be used.
 
-OUTPUT_DIRECTORY       = doxygen-dev-docs
+OUTPUT_DIRECTORY       = dev-docs
 
 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
 # 2 levels of 10 sub-directories under the output directory of each output 
@@ -567,7 +567,7 @@
 # If a relative path is entered the value of OUTPUT_DIRECTORY will be 
 # put in front of it. If left blank `html' will be used as the default path.
 
-HTML_OUTPUT            = html
+HTML_OUTPUT            = .
 
 # The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
 # each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
Index: docs/dummy.c
===================================================================
--- docs/dummy.c	(revision 0)
+++ docs/dummy.c	(revision 0)
@@ -0,0 +1,5 @@
+int main (void)
+{
+   return 0;
+}
+ 
Index: mythtv.pro
===================================================================
--- mythtv.pro	(revision 15810)
+++ mythtv.pro	(working copy)
@@ -12,7 +12,7 @@
 include ( settings.pro )
 
 # Directories
-SUBDIRS += libs filters programs themes i18n
+SUBDIRS += libs filters programs themes i18n docs
 
 using_bindings_* {
     SUBDIRS += bindings
