fix doc target recursions
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Tue, 4 Dec 2012 20:25:05 +0000 (21:25 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 5 Dec 2012 16:29:46 +0000 (17:29 +0100)
in particular for the meta Makefiles of debug_and_release.

the logic is as follows:
- the meta targets ('html_docs' in prepare_docs mode, and 'docs' always)
  need to branch out asap, so they are implemented non-recursively in
  every makefile.
- all other targets need to be fully recursive. the meta Makefile will
  recurse only into one of debug or release, depending on the configure
  option (it doesn't matter anyway).

Change-Id: I4e3f714cdda9c3a1021743148b5ee73379e3484d
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
mkspecs/features/qt_docs.prf
mkspecs/features/qt_docs_targets.prf

index 3eb138b..0c46301 100644 (file)
@@ -17,7 +17,6 @@ doc_command = $$QDOC $$QMAKE_DOCS
 prepare_docs {
     prepare_docs.commands += $$doc_command -prepare -no-link-errors
     generate_docs.commands += $$doc_command -generate
-    html_docs.depends += generate_docs
 } else {
     html_docs.commands += $$doc_command
 }
index 9f62e00..1af9fd9 100644 (file)
@@ -1,33 +1,34 @@
-    contains(TEMPLATE, subdirs) {
-        prepare_docs {
-            prepareRecursiveTarget(prepare_docs)
-            prepareRecursiveTarget(generate_docs)
-            html_docs.commands = $(MAKE) -f $(MAKEFILE) prepare_docs && $(MAKE) -f $(MAKEFILE) generate_docs
-        } else {
-            prepareRecursiveTarget(html_docs)
-        }
-        prepareRecursiveTarget(qch_docs)
-        prepareRecursiveTarget(docs)
-    } else {
-        # apps and libs only generate docs if QMAKE_DOCS is set
-        !isEmpty(QMAKE_DOCS) {
-            # backwards compat hack
-            load(qt_docs)
-        }
-    }
-    docs.commands = $(MAKE) -f $(MAKEFILE) html_docs && $(MAKE) -f $(MAKEFILE) qch_docs
-    QMAKE_EXTRA_TARGETS += html_docs qch_docs docs
-    prepare_docs: QMAKE_EXTRA_TARGETS += prepare_docs generate_docs
+DOC_TARGETS = \
+    install_html_docs uninstall_html_docs \
+    install_qch_docs uninstall_qch_docs \
+    install_docs uninstall_docs \
+    qch_docs
+
+prepare_docs {
+    DOC_TARGETS += prepare_docs generate_docs
+    html_docs.commands = $(MAKE) -f $(MAKEFILE) prepare_docs && $(MAKE) -f $(MAKEFILE) generate_docs
+    QMAKE_EXTRA_TARGETS += html_docs
+} else {
+    DOC_TARGETS += html_docs
+}
 
-    contains(TEMPLATE, subdirs) {
-        prepareRecursiveTarget(install_html_docs)
-        prepareRecursiveTarget(uninstall_html_docs)
-        prepareRecursiveTarget(install_qch_docs)
-        prepareRecursiveTarget(uninstall_qch_docs)
-        prepareRecursiveTarget(install_docs)
-        prepareRecursiveTarget(uninstall_docs)
+docs.commands = $(MAKE) -f $(MAKEFILE) html_docs && $(MAKE) -f $(MAKEFILE) qch_docs
+QMAKE_EXTRA_TARGETS += docs
+
+contains(TEMPLATE, subdirs) {
+    for(inst, DOC_TARGETS): \
+        prepareRecursiveTarget($$inst)
+} else:debug_and_release:!build_pass {
+    sub = $$first(BUILDS)
+    for(inst, DOC_TARGETS) {
+        $${inst}.CONFIG = recursive
+        $${inst}.recurse = $$sub
+    }
+} else {
+    # apps and libs only generate docs if QMAKE_DOCS is set
+    !isEmpty(QMAKE_DOCS) {
+        # backwards compat hack
+        load(qt_docs)
     }
-    QMAKE_EXTRA_TARGETS += \
-        install_html_docs uninstall_html_docs \
-        install_qch_docs uninstall_qch_docs \
-        install_docs uninstall_docs
+}
+QMAKE_EXTRA_TARGETS += $$DOC_TARGETS