make/Docs.gmk
branchihse-setupexecute-branch
changeset 57162 e1a04d30f1c7
parent 53087 f48737b2f428
child 57230 b3b5ec7737f4
--- a/make/Docs.gmk	Thu Feb 07 19:35:33 2019 +0100
+++ b/make/Docs.gmk	Fri Feb 08 10:42:05 2019 +0100
@@ -195,10 +195,13 @@
 
     # For each module needing a graph, create a png file from the dot file
     # generated by the GenGraphs tool and store it in the target dir.
-    $$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
-	$$(call MakeDir, $$(@D))
-	$$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
-	    $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
+    $$(eval $$(call SetupExecute, gengraphs_png_$1, \
+        INFO := Running dot for module graphs for $2, \
+        DEPS := $$(gengraphs_$1_TARGET), \
+        OUTPUT_FILE := $$($1_$2_PNG_TARGET), \
+        SUPPORT_DIR := $$($1_GENGRAPHS_DIR), \
+        COMMAND := $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC), \
+    ))
 
   $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
 endef
@@ -336,18 +339,18 @@
   $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
       $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
 
-  # Javadoc creates a lot of files but use index.html as a marker
-  $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
-      $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
-	$$(call LogWarn, Generating $1 javadoc for \
-	    $$(words $$($1_ALL_MODULES)) modules)
-	$$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
-	$$(call MakeDir, $$($1_TARGET_DIR))
-	$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
-	    $$($1_JAVADOC_CMD) -d $$($1_TARGET_DIR) \
-	        $$($1_OPTIONS) $$($1_LOG_OPTION))
+  $$(eval $$(call SetupExecute, javadoc_$1, \
+      WARN := Generating $1 javadoc for $$(words $$($1_ALL_MODULES)) modules, \
+      INFO := Javadoc modules: $$($1_ALL_MODULES), \
+      DEPS := $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) $$($1_SOURCE_DEPS) \
+          $$($1_OVERVIEW), \
+      OUTPUT_DIR := $$($1_TARGET_DIR), \
+      SUPPORT_DIR := $$(SUPPORT_OUTPUTDIR)/docs, \
+      COMMAND := $$($1_JAVADOC_CMD) -d $$($1_TARGET_DIR) $$($1_OPTIONS) \
+          $$($1_LOG_OPTION), \
+  ))
 
-  $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
+  $1_JAVADOC_TARGETS := $$(javadoc_$1_TARGET)
 
   ifeq ($$(ENABLE_FULL_DOCS), true)
     # We have asked ModuleGraph to generate links to png files. Now we must
@@ -367,19 +370,18 @@
         $$(TOPDIR)/make/jdk/src/classes/build/tools/jigsaw/javadoc-graphs.properties
 
     $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
-    $1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
 
-    $$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
-	$$(call LogInfo, Running gengraphs for $1 documentation)
-	$$(call MakeDir, $$($1_GENGRAPHS_DIR))
-	$$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
-	    $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
-	    --dot-attributes $$(GENGRAPHS_PROPS) && \
-	    $$(TOUCH) $$($1_GENGRAPHS_MARKER))
+    $$(eval $$(call SetupExecute, gengraphs_$1, \
+        INFO := Running gengraphs for $1 documentation, \
+        DEPS := $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS), \
+        OUTPUT_DIR := $$($1_GENGRAPHS_DIR), \
+        COMMAND := $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
+            --dot-attributes $$(GENGRAPHS_PROPS), \
+    ))
 
     # For each module needing a graph, create a png file from the dot file
     # generated by the GenGraphs tool and store it in the target dir.
-    # They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
+    # They will depend on gengraphs_$1_TARGET, and will be added to $1.
     $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
       $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
     )