annotate make/Docs.gmk @ 45323:52500c1d7f1f

8175824: Adapt javadoc generation to different requirements for JDK and JavaSE Reviewed-by: erikj, mchung
author ihse
date Mon, 29 May 2017 09:18:10 +0200
parents 538af025db97
children e9dbf9eb0100 0444b69aad04
rev   line source
ihse@43047 1 # Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
ohair@13697 2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@13697 3 #
ohair@13697 4 # This code is free software; you can redistribute it and/or modify it
ohair@13697 5 # under the terms of the GNU General Public License version 2 only, as
ohair@13697 6 # published by the Free Software Foundation. Oracle designates this
ohair@13697 7 # particular file as subject to the "Classpath" exception as provided
ohair@13697 8 # by Oracle in the LICENSE file that accompanied this code.
ohair@13697 9 #
ohair@13697 10 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@13697 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@13697 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@13697 13 # version 2 for more details (a copy is included in the LICENSE file that
ohair@13697 14 # accompanied this code).
ohair@13697 15 #
ohair@13697 16 # You should have received a copy of the GNU General Public License version
ohair@13697 17 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@13697 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@13697 19 #
ohair@13697 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@13697 21 # or visit www.oracle.com if you need additional information or have any
ohair@13697 22 # questions.
ohair@13697 23 #
ohair@13697 24
ihse@41652 25 default: all
ihse@41652 26
ohair@13697 27 include $(SPEC)
ohair@13697 28 include MakeBase.gmk
ihse@44725 29 include Modules.gmk
ihse@44983 30 include ProcessMarkdown.gmk
ihse@44725 31 include ZipArchive.gmk
chegar@43285 32 include $(JDK_TOPDIR)/make/Tools.gmk
mchung@44397 33 include $(JDK_TOPDIR)/make/ModuleTools.gmk
ohair@13697 34
ihse@44725 35 # This is needed to properly setup DOCS_MODULES.
ihse@44725 36 $(eval $(call ReadImportMetaData))
ihse@44725 37
ihse@41652 38 ################################################################################
ihse@44827 39 # Hook to include the corresponding custom file, if present.
ihse@45103 40 $(eval $(call IncludeCustomExtension, , Docs.gmk))
ihse@44827 41
ihse@44827 42 ################################################################################
ihse@45323 43 # This file generates all documentation for OpenJDK.
ihse@45323 44 #
ihse@45323 45 # We will generate API documentation for two different selections of the source
ihse@45323 46 # code: "Java SE", which contains just the modules covered by the top-level
ihse@45323 47 # module java.se.ee, and "JDK", which covers all of Java SE and also all
ihse@45323 48 # other available modules that should be documented, including imported modules,
ihse@45323 49 # if any.
ihse@45323 50 #
ihse@45323 51 # We will also generate separate, free-standing specifications from either
ihse@45323 52 # markdown or existing html files.
ihse@45323 53 #
ihse@45323 54
ihse@45323 55 ################################################################################
ihse@44725 56 # Javadoc settings
ohair@13697 57
ihse@44725 58 # On top of the sources that was used to compile the JDK, we need some
ihse@44725 59 # extra java.rmi sources that are used just for javadoc.
ihse@44726 60 MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
ihse@44725 61 $(SUPPORT_OUTPUTDIR)/rmic/* $(JDK_TOPDIR)/src/*/share/doc/stub)
alanb@36506 62
ihse@41652 63 # URLs
ihse@45108 64 JAVADOC_BASE_URL := http://www.oracle.com/pls/topic/lookup?ctx=javase9&id=homepage
ihse@41652 65 BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
ihse@44725 66 COPYRIGHT_URL := {@docroot}/../legal/cpyr.html
ihse@44990 67 LICENSE_URL := http://www.oracle.com/technetwork/java/javase/terms/license/java9speclicense.html
ihse@44990 68 REDISTRIBUTION_URL := http://www.oracle.com/technetwork/java/redist-137594.html
ihse@44990 69
ihse@42135 70 # In order to get a specific ordering it's necessary to specify the total
ihse@42135 71 # ordering of tags as the tags are otherwise ordered in order of definition.
ihse@44725 72 JAVADOC_TAGS := \
ihse@42135 73 -tag beaninfo:X \
ihse@42135 74 -tag revised:X \
ihse@42135 75 -tag since.unbundled:X \
ihse@42135 76 -tag spec:X \
ihse@42135 77 -tag specdefault:X \
ihse@42135 78 -tag Note:X \
ihse@42135 79 -tag ToDo:X \
ihse@42135 80 -tag 'apiNote:a:API Note:' \
ihse@42135 81 -tag 'implSpec:a:Implementation Requirements:' \
ihse@42135 82 -tag 'implNote:a:Implementation Note:' \
ihse@42135 83 -tag param \
ihse@42135 84 -tag return \
ihse@42135 85 -tag throws \
mchung@44397 86 -taglet build.tools.taglet.ModuleGraph \
ihse@42135 87 -tag since \
ihse@42135 88 -tag version \
ihse@42135 89 -tag serialData \
ihse@42135 90 -tag factory \
ihse@42135 91 -tag see \
ihse@42135 92 -tag 'jvms:a:See <cite>The Java&trade; Virtual Machine Specification</cite>:' \
ihse@42135 93 -tag 'jls:a:See <cite>The Java&trade; Language Specification</cite>:' \
ksrini@44826 94 -taglet build.tools.taglet.ExtLink \
chegar@43285 95 -taglet build.tools.taglet.Incubating \
chegar@43285 96 -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
ihse@44827 97 $(CUSTOM_JAVADOC_TAGS) \
ihse@42135 98 #
ihse@42135 99
ihse@44725 100 # Which doclint checks to ignore
ihse@44725 101 JAVADOC_DISABLED_DOCLINT := accessibility html missing syntax reference
ihse@44725 102
ihse@44725 103 # The initial set of options for javadoc
ihse@44725 104 JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
ihse@44725 105 -serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
ihse@44829 106 -html5 -javafx --expand-requires transitive
ihse@41652 107
ihse@44725 108 # Should we add DRAFT stamps to the generated javadoc?
ihse@44725 109 ifeq ($(VERSION_IS_GA), true)
ihse@44725 110 IS_DRAFT := false
ihse@44725 111 else
ihse@44725 112 IS_DRAFT := true
ihse@44725 113 endif
ohair@13697 114
ihse@41652 115 ################################################################################
ihse@44725 116 # General text snippets
alanb@36506 117
ihse@44725 118 FULL_COMPANY_NAME := Oracle and/or its affiliates
ihse@44725 119 COMPANY_ADDRESS := 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA
ohair@13697 120
ihse@45323 121 JAVA_PLATFORM := Java&trade; Platform
ihse@45323 122
ihse@44725 123 ifeq ($(IS_DRAFT), true)
ihse@44725 124 DRAFT_MARKER_STR := <br><strong>DRAFT $(VERSION_STRING)</strong>
ihse@44725 125 ifeq ($(VERSION_BUILD), 0)
ihse@44725 126 DRAFT_MARKER_TITLE := [ad-hoc build]
ihse@44725 127 else
ihse@44725 128 DRAFT_MARKER_TITLE := [build $(VERSION_BUILD)]
ihse@44725 129 endif
ihse@45323 130 DRAFT_TEXT := Please note that the specifications and other information \
ihse@45323 131 contained herein are not final and are subject to change. The \
ihse@45323 132 information is being made available to you solely for purpose of \
ihse@45323 133 evaluation.
ihse@44725 134 endif
ihse@44725 135
ihse@44725 136 JAVADOC_BOTTOM := \
ihse@44725 137 <span style="font-size:smaller"> \
ihse@44725 138 <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a><br> \
ihse@44725 139 For further API reference and developer documentation, see \
ihse@45108 140 <a href="$(JAVADOC_BASE_URL)" target="_blank">Java SE \
ihse@44725 141 Documentation</a>. That documentation contains more detailed, \
ihse@44725 142 developer-targeted descriptions, with conceptual overviews, definitions \
ihse@44725 143 of terms, workarounds, and working code examples.<br> \
ihse@44725 144 Java is a trademark or registered trademark of $(FULL_COMPANY_NAME) in \
ihse@44725 145 the US and other countries.<br> \
ihse@44725 146 <a href="$(COPYRIGHT_URL)">Copyright</a> \
ihse@44725 147 &copy; 1993, $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
ihse@44990 148 $(COMPANY_ADDRESS). All rights reserved. \
ihse@44990 149 Use is subject to <a href="$(LICENSE_URL)">license terms</a>. Also see the \
ihse@44990 150 <a href="$(REDISTRIBUTION_URL)">documentation redistribution policy</a>. \
ihse@44990 151 $(DRAFT_MARKER_STR)</span>
ihse@44725 152
ihse@44725 153 JAVADOC_TOP := \
ihse@44725 154 <div style="background-color: $(HASH)EEEEEE"><div style="padding: 6px; \
ihse@44725 155 margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: \
ihse@44725 156 6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, \
ihse@45323 157 sans-serif; font-weight: normal;">$(DRAFT_TEXT)</div></div>
ksrini@35367 158
ihse@41652 159 ################################################################################
ihse@44726 160 # JDK javadoc titles/text snippets
ksrini@35367 161
ihse@45323 162 JDK_SHORT_NAME := JDK&trade; $(VERSION_SPECIFICATION)
ihse@45323 163 JDK_LONG_NAME := Standard Edition Development Kit (JDK&trade;) $(VERSION_SPECIFICATION)
ihse@44726 164
ihse@44726 165 ################################################################################
ihse@44726 166 # Java SE javadoc titles/text snippets
ihse@44726 167
ihse@45323 168 JAVASE_SHORT_NAME := SE $(VERSION_SPECIFICATION)
ihse@45323 169 JAVASE_LONG_NAME := Standard Edition $(VERSION_SPECIFICATION)
ksrini@35367 170
ihse@41652 171 ################################################################################
ihse@45323 172 # Index page text titles/snippets
mchung@45105 173
ihse@45323 174 JDK_INDEX_TITLE := $(JAVA_PLATFORM), $(JDK_LONG_NAME) Specification $(DRAFT_MARKER_TITLE)
mchung@45105 175
mchung@45105 176 ################################################################################
ihse@44726 177 # Functions
alanb@36506 178
ihse@44726 179 # Helper function for creating a png file from a dot file generated by the
ihse@44726 180 # GenGraphs tool.
ihse@44726 181 # param 1: SetupJavadocGeneration namespace ($1)
ihse@44726 182 # param 2: module name
ihse@44726 183 #
ihse@44726 184 define setup_gengraph_dot_to_png
ihse@44726 185 $1_$2_DOT_SRC := $$($1_GENGRAPHS_DIR)/$2.dot
ihse@44726 186 $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png
ksrini@35367 187
ihse@44726 188 # For each module needing a graph, create a png file from the dot file
ihse@44726 189 # generated by the GenGraphs tool and store it in the target dir.
ihse@44726 190 $$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
ihse@44726 191 $$(call MakeDir, $$(@D))
ihse@44726 192 $$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
ihse@44726 193 $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
ihse@44725 194
ihse@44726 195 $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
ihse@44726 196 endef
ksrini@35367 197
ihse@45323 198 # Helper function to create the overview.html file to use with the -overview
ihse@45323 199 # javadoc option.
ihse@45323 200 # Returns the filename as $1_OVERVIEW.
ihse@45323 201 #
ihse@45323 202 # param 1: SetupJavadocGeneration namespace ($1)
ihse@45323 203 define create_overview_file
ihse@45323 204 $1_OVERVIEW_TEXT := \
ihse@45323 205 <!DOCTYPE html> \
ihse@45323 206 <html><head></head><body> \
ihse@45323 207 <p>This document is the API specification for $$($1_FULL_NAME).</p> \
ihse@45323 208 #
ihse@45323 209 ifneq ($$($1_GROUPS),)
ihse@45323 210 $1_OVERVIEW_TEXT += \
ihse@45323 211 <p>For an overview of the full specification, grouped by usage, see the <a href="../index.html">$$(JAVA_PLATFORM), $$($1_LONG_NAME) Specification</a>.</p> \
ihse@45323 212 <dl> \
ihse@45323 213 #
ihse@45323 214 $1_OVERVIEW_TEXT += $$(foreach g, $$($1_GROUPS), \
ihse@45323 215 <dt><a href="\#$$g">$$($$g_GROUP_NAME)</a></dt> \
ihse@45323 216 <dd>$$($$g_GROUP_DESCRIPTION)</dt> \
ihse@45323 217 )
ihse@45323 218 $1_OVERVIEW_TEXT += \
ihse@45323 219 </dl> \
ihse@45323 220 #
ihse@45323 221 endif
ihse@45323 222 ifeq ($$(IS_DRAFT), true)
ihse@45323 223 $1_OVERVIEW_TEXT += \
ihse@45323 224 <p><strong>$$(DRAFT_TEXT)</strong></p> \
ihse@45323 225 #
ihse@45323 226 endif
ihse@45323 227 $1_OVERVIEW_TEXT += \
ihse@45323 228 </body></html> \
ihse@45323 229 #
ihse@45323 230
ihse@45323 231 $1_OVERVIEW := $$(SUPPORT_OUTPUTDIR)/docs/$1-overview.html
ihse@45323 232
ihse@45323 233 $1_OVERVIEW_VARDEPS_FILE := $$(call DependOnVariable, $1_OVERVIEW_TEXT, \
ihse@45323 234 $$($1_OVERVIEW).vardeps)
ihse@45323 235
ihse@45323 236 $$($1_OVERVIEW): $$($1_OVERVIEW_VARDEPS_FILE)
ihse@45323 237 $$(call LogInfo, Creating overview.html for $1)
ihse@45323 238 $$(call MakeDir, $$(@D))
ihse@45323 239 $$(PRINTF) > $$@ '$$($1_OVERVIEW_TEXT)'
ihse@45323 240 endef
ihse@45323 241
ihse@41652 242 ################################################################################
ihse@45323 243 # Setup make rules to create an API documentation collection, using javadoc and
ihse@45323 244 # other tools if needed.
ihse@44726 245 #
ihse@44726 246 # Parameter 1 is the name of the rule. This name is used as variable prefix.
ihse@44726 247 # Targets generated are returned as $1_JAVADOC_TARGETS and
ihse@44726 248 # $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
ihse@44726 249 # file" for all the magnitude of files that are generated by javadoc.
ihse@44726 250 #
ihse@44726 251 # Remaining parameters are named arguments. These include:
ihse@44726 252 # MODULES - Modules to generate javadoc for
ihse@45323 253 # GROUPS - Name of the groups to divide the modules into, if any
ihse@45323 254 # SHORT_NAME - The short name of this documentation collection
ihse@45323 255 # LONG_NAME - The long name of this documentation collection
ihse@44726 256 # TARGET_DIR - Where to store the output
ihse@44726 257 #
ihse@44726 258 SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
ihse@44726 259 define SetupApiDocsGenerationBody
ksrini@35367 260
ihse@45233 261 # Figure out all modules, both specified and transitive indirect exports, that
ihse@45233 262 # will be processed by javadoc.
ihse@45233 263 $1_INDIRECT_EXPORTS := $$(call FindTransitiveIndirectDepsForModules, $$($1_MODULES))
ihse@45233 264 $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_INDIRECT_EXPORTS))
ksrini@35367 265
ihse@44726 266 ifeq ($$(ENABLE_FULL_DOCS), true)
ihse@44726 267 # Tell the ModuleGraph taglet to generate html links to soon-to-be-created
ihse@44726 268 # png files with module graphs.
ihse@44726 269 $1_JAVA_ARGS += -DenableModuleGraph=true
ihse@44726 270 endif
ihse@44725 271
ihse@44726 272 # Always include tags and basic options
ihse@44726 273 $1_OPTIONS := $$(JAVADOC_TAGS) $$(JAVADOC_OPTIONS)
ihse@44725 274
ihse@44726 275 $1_OPTIONS += --module-source-path $$(MODULES_SOURCE_PATH)
ihse@44726 276 $1_OPTIONS += --module $$(call CommaList, $$($1_MODULES))
ihse@44725 277
ihse@44726 278 # Create a string like "-Xdoclint:all,-syntax,-html,..."
ihse@44726 279 $1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
ihse@44726 280 $$(JAVADOC_DISABLED_DOCLINT)))
ihse@44726 281
ihse@45323 282 $1_FULL_NAME := $$(JAVA_PLATFORM), $$($1_LONG_NAME) \
ihse@45323 283 $$(DRAFT_MARKER_TITLE)
ihse@45323 284 $1_DOC_TITLE := $$($1_FULL_NAME)<br>API Specification
ihse@45323 285 $1_WINDOW_TITLE := $$(subst &trade;,,$$(JAVA_PLATFORM) $$($1_SHORT_NAME)) \
ihse@45323 286 $$(DRAFT_MARKER_TITLE)
ihse@45323 287 $1_HEADER_TITLE := <strong>$$(JAVA_PLATFORM)<br>$$($1_SHORT_NAME)</strong> \
ihse@45323 288 $$(DRAFT_MARKER_STR)
ihse@45323 289
ihse@44726 290 $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
ihse@44726 291 $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)'
ihse@44726 292 $1_OPTIONS += -header '$$($1_HEADER_TITLE)'
ihse@45323 293 $1_OPTIONS += -bottom '$$(JAVADOC_BOTTOM)'
ihse@44726 294 ifeq ($$(IS_DRAFT), true)
ihse@45323 295 $1_OPTIONS += -top '$$(JAVADOC_TOP)'
ihse@44726 296 endif
ihse@44726 297
ihse@44726 298 # Do not store debug level options in VARDEPS.
ihse@44726 299 ifneq ($$(LOG_LEVEL), trace)
ihse@44726 300 $1_LOG_OPTION += -quiet
ihse@44726 301 else
ihse@44726 302 $1_LOG_OPTION += -verbose
ihse@44726 303 endif
ihse@44726 304
ihse@45323 305 # Generate the overview.html file. This will return the filename in
ihse@45323 306 # $1_OVERVIEW.
ihse@45323 307 $$(eval $$(call create_overview_file,$1))
ihse@45323 308 $1_OPTIONS += -overview $$($1_OVERVIEW)
ihse@45323 309
ihse@45323 310 $$(foreach g, $$($1_GROUPS), \
ihse@45323 311 $$(eval $1_OPTIONS += -group "$$($$g_GROUP_NAME)" "$$($$g_GROUP_MODULES)") \
ihse@45323 312 )
ihse@45323 313
ihse@44726 314 $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
ihse@44726 315 $$($1_ALL_MODULES)
ihse@44726 316 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
ihse@44726 317 $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
ihse@44726 318
ihse@44726 319 # Get a list of all files in all the source dirs for all included modules
ihse@44726 320 $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
ihse@44726 321 $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
ihse@44726 322
ihse@44726 323 # Javadoc creates a lot of files but use index.html as a marker
ihse@44726 324 $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
ihse@44726 325 $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
ihse@45323 326 $$(call LogWarn, Generating $1 javadoc for \
ihse@44726 327 $$(words $$($1_ALL_MODULES)) modules)
ihse@44726 328 $$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
ihse@44726 329 $$(call MakeDir, $$($1_TARGET_DIR))
ihse@44726 330 $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
ihse@44726 331 $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
ihse@44726 332 $$(NEW_JAVADOC) -d $$($1_TARGET_DIR) \
ihse@44726 333 $$(JAVADOC_TAGS) $$($1_OPTIONS) $$($1_LOG_OPTION))
ihse@44726 334
ihse@44726 335 $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
ihse@44726 336
ihse@44726 337 ifeq ($$(ENABLE_FULL_DOCS), true)
ihse@44726 338 # We have asked ModuleGraph to generate links to png files. Now we must
ihse@44726 339 # produce the png files.
ihse@44726 340
ihse@44726 341 # Locate which modules has the @moduleGraph tag in their module-info.java
ihse@44726 342 $1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
ihse@44726 343 $$(if $$(shell $$(GREP) -e @moduleGraph \
ihse@44726 344 $$(wildcard $$(addsuffix /module-info.java, \
ihse@44726 345 $$(call FindModuleSrcDirs, $$m)))), \
ihse@44726 346 $$m) \
ihse@44726 347 ))
ihse@44726 348
ihse@44726 349 # First we run the GenGraph tool. It will query the module structure of the
ihse@44726 350 # running JVM and output .dot files for all existing modules.
ihse@44726 351 GENGRAPHS_PROPS := \
ihse@44726 352 $$(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
ihse@44726 353
ihse@44726 354 $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
ihse@44726 355 $1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
ihse@44726 356
ihse@44726 357 $$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
ihse@45323 358 $$(call LogInfo, Running gengraphs for $1 documentation)
ihse@44726 359 $$(call MakeDir, $$($1_GENGRAPHS_DIR))
ihse@44726 360 $$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
ihse@44726 361 $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
ihse@44726 362 --dot-attributes $$(GENGRAPHS_PROPS) && \
ihse@44726 363 $$(TOUCH) $$($1_GENGRAPHS_MARKER))
ihse@44726 364
ihse@44726 365 # For each module needing a graph, create a png file from the dot file
ihse@44726 366 # generated by the GenGraphs tool and store it in the target dir.
ihse@44726 367 # They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
ihse@44726 368 $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
ihse@44726 369 $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
ihse@44726 370 )
ihse@44726 371 endif
ihse@44726 372 endef
ihse@44726 373
ihse@44726 374 ################################################################################
ihse@44726 375 # Setup generation of the JDK API documentation (javadoc + modulegraph)
ihse@44726 376
ihse@45323 377 # Define the groups of the JDK API documentation
ihse@45323 378 JavaSE_GROUP_NAME := Java SE
ihse@45323 379 JavaSE_GROUP_MODULES := $(call ColonList, $(sort java.se.ee \
ihse@45323 380 $(call FindTransitiveIndirectDepsForModules, java.se.ee)))
ihse@45323 381 JavaSE_GROUP_DESCRIPTION := \
ihse@45323 382 The Java Platform, Standard Edition ("Java SE") APIs define the core Java \
ihse@45323 383 platform for general-purpose computing. These APIs are in modules with \
ihse@45323 384 names starting with the string "java.". \
ihse@45323 385 #
ihse@45323 386 JDK_GROUPS += JavaSE
ihse@45323 387
ihse@45323 388 JDK_GROUP_NAME := JDK
ihse@45323 389 JDK_GROUP_MODULES := jdk.*
ihse@45323 390 JDK_GROUP_DESCRIPTION := \
ihse@45323 391 The Java Development Kit ("JDK") APIs define an implementation of the Java \
ihse@45323 392 SE Platform which may include platform-specific details. These APIs are in \
ihse@45323 393 modules with names starting with the string "jdk.". \
ihse@45323 394 #
ihse@45323 395 JDK_GROUPS += JDK
ihse@45323 396
ihse@45323 397 # If we are importing JavaFX, we need a JavaFX group. In an ideal world, this
ihse@45323 398 # would have been abstracted away to a more proper generic handling of imported
ihse@45323 399 # modules.
ihse@45323 400 ifneq ($(findstring javafx., $(IMPORTED_MODULES)), )
ihse@45323 401 JavaFX_GROUP_NAME := JavaFX
ihse@45323 402 JavaFX_GROUP_MODULES := javafx.*
ihse@45323 403 JavaFX_GROUP_DESCRIPTION := \
ihse@45323 404 The JavaFX APIs define a set of user interface (UI) controls, graphics, \
ihse@45323 405 media, and web packages for developing rich client applications. These \
ihse@45323 406 APIs are in modules with names starting with the string "javafx.". \
ihse@45323 407 #
ihse@45323 408 JDK_GROUPS += JavaFX
ihse@45323 409 endif
ihse@45323 410
ihse@44726 411 # All modules to have docs generated by docs-jdk-api target
ihse@45323 412 JDK_MODULES := $(sort $(DOCS_MODULES))
ihse@44726 413
ihse@44726 414 $(eval $(call SetupApiDocsGeneration, JDK_API, \
ihse@45323 415 MODULES := $(JDK_MODULES), \
ihse@45323 416 GROUPS := $(JDK_GROUPS), \
ihse@45323 417 SHORT_NAME := $(JDK_SHORT_NAME), \
ihse@45323 418 LONG_NAME := $(JDK_LONG_NAME), \
ihse@45103 419 TARGET_DIR := $(DOCS_OUTPUTDIR)/api, \
ihse@44726 420 ))
ihse@44726 421
ihse@44726 422 # Targets generated are returned in JDK_API_JAVADOC_TARGETS and
ihse@44726 423 # JDK_API_MODULEGRAPH_TARGETS.
ihse@44726 424
ihse@44726 425 ################################################################################
ihse@44726 426 # Setup generation of the Java SE API documentation (javadoc + modulegraph)
ihse@44726 427
ihse@45233 428 # The Java SE module scope is just java.se.ee and it's transitive indirect
ihse@45233 429 # exports.
ihse@45323 430 JAVASE_MODULES := java.se.ee
ihse@44726 431
ihse@44726 432 $(eval $(call SetupApiDocsGeneration, JAVASE_API, \
ihse@45323 433 MODULES := $(JAVASE_MODULES), \
ihse@45323 434 SHORT_NAME := $(JAVASE_SHORT_NAME), \
ihse@45323 435 LONG_NAME := $(JAVASE_LONG_NAME), \
ihse@44726 436 TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
ihse@44726 437 ))
ihse@44726 438
ihse@44726 439 # Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
ihse@44726 440 # JAVASE_API_MODULEGRAPH_TARGETS.
ohair@13697 441
ihse@41652 442 ################################################################################
mchung@45105 443
ihse@45229 444 JDK_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
ihse@45229 445 JDK_INDEX_TOOLS_DIR := $(TOOLS_CLASSES_DIR)/build/tools/docs
mchung@45105 446
ihse@45229 447 $(JDK_INDEX_HTML): $(BUILD_JIGSAW_TOOLS) \
ihse@45229 448 $(JDK_INDEX_TOOLS_DIR)/docs-bundle-page.html \
ihse@45229 449 $(JDK_INDEX_TOOLS_DIR)/docs-module-groups.properties
mchung@45105 450 $(call LogInfo, Generating docs bundle index page)
mchung@45105 451 $(MKDIR) -p $(@D)
ihse@45229 452 $(TOOL_GEN_DOCS_BUNDLE_PAGE) --title '$(JDK_INDEX_TITLE)' \
mchung@45105 453 --output $@
mchung@45105 454
ihse@45229 455 JDK_INDEX_TARGETS := $(JDK_INDEX_HTML)
ihse@45229 456
ihse@45229 457 # Copy the global resources
ihse@45229 458 GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/
ihse@45229 459 $(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
ihse@45229 460 SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
ihse@45229 461 FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
ihse@45229 462 DEST := $(DOCS_OUTPUTDIR), \
ihse@45229 463 ))
ihse@45229 464 JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
mchung@45105 465
mchung@45105 466 ################################################################################
ihse@44733 467 # Copy JDK specs files
ihse@41652 468
ihse@44733 469 # For all html documentation in $module/share/specs directories, copy it
ihse@44733 470 # unmodified
ihse@41652 471
ihse@44733 472 ALL_MODULES := $(call FindAllModules)
ihse@44983 473 COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
ihse@44733 474
ihse@44733 475 $(foreach m, $(ALL_MODULES), \
ihse@44733 476 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
ihse@45095 477 $(foreach d, $(SPECS_$m), \
ihse@45095 478 $(if $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
ihse@45095 479 $(eval $(call SetupCopyFiles, COPY_$m, \
ihse@45095 480 SRC := $d, \
ihse@45095 481 FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
ihse@45103 482 DEST := $(DOCS_OUTPUTDIR)/specs/, \
ihse@45095 483 )) \
ihse@45095 484 $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
ihse@45095 485 ) \
ihse@44733 486 ) \
ihse@44733 487 )
ihse@44733 488
ihse@44734 489 ifeq ($(ENABLE_FULL_DOCS), true)
ihse@44734 490 # For all markdown files in $module/share/specs directories, convert them to
ihse@44734 491 # html.
ihse@44734 492
ihse@45229 493 GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
ihse@44734 494
ihse@44734 495 $(foreach m, $(ALL_MODULES), \
ihse@44734 496 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
ihse@44983 497 $(foreach d, $(SPECS_$m), \
ihse@44983 498 $(if $(filter %.md, $(call CacheFind, $d)), \
ihse@44989 499 $(eval $(call SetupProcessMarkdown, CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d), \
ihse@44983 500 SRC := $d, \
ihse@44983 501 FILES := $(filter %.md, $(call CacheFind, $d)), \
ihse@45103 502 DEST := $(DOCS_OUTPUTDIR)/specs/, \
ihse@44983 503 CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
ihse@44983 504 )) \
ihse@44983 505 ) \
ihse@44989 506 $(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d))) \
ihse@44734 507 ) \
ihse@44734 508 )
ihse@44734 509 endif
ihse@44734 510
ihse@44733 511 # Special treatment for generated documentation
ihse@44733 512
ihse@44733 513 JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
ihse@44733 514 $(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
ihse@44733 515 FILES := $(JDWP_PROTOCOL), \
ihse@45103 516 DEST := $(DOCS_OUTPUTDIR)/specs/jdwp, \
ihse@41652 517 ))
ihse@44733 518 JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
ihse@41652 519
ihse@44733 520 # Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
ihse@44733 521 JVMTI_HTML := $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
erikj@41260 522 $(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
erikj@41260 523 FILES := $(JVMTI_HTML), \
ihse@45103 524 DEST := $(DOCS_OUTPUTDIR)/specs, \
erikj@41260 525 ))
ihse@44733 526 JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
ohair@13697 527
ihse@41652 528 ################################################################################
ihse@41652 529 # Optional target which bundles all generated javadocs into a zip archive.
neugens@37034 530
ihse@44725 531 JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
ihse@44725 532 JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
ihse@41652 533
ihse@44725 534 $(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
ihse@45103 535 SRC := $(DOCS_OUTPUTDIR), \
ihse@44733 536 ZIP := $(JAVADOC_ZIP_FILE), \
ihse@44733 537 EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
ihse@44733 538 $(JDK_SPECS_TARGETS), \
ihse@44725 539 ))
neugens@37034 540
ihse@44725 541 ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
erikj@39384 542
erikj@39384 543 ################################################################################
erikj@39384 544
ihse@45103 545 docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS) $(JDK_API_CUSTOM_TARGETS)
mchung@44397 546
ihse@44726 547 docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
ihse@44725 548
ihse@45103 549 docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS) $(JAVASE_API_CUSTOM_TARGETS)
ihse@44726 550
ihse@44726 551 docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
ihse@41652 552
ihse@44733 553 docs-jdk-specs: $(JDK_SPECS_TARGETS)
ihse@41652 554
ihse@45229 555 docs-jdk-index: $(JDK_INDEX_TARGETS)
mchung@45105 556
ihse@41652 557 docs-zip: $(ZIP_TARGETS)
ihse@41652 558
ihse@44726 559 all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
mchung@45105 560 docs-javase-api-modulegraph docs-jdk-specs docs-jdk-index docs-zip
ihse@41652 561
ihse@44726 562 .PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
mchung@45105 563 docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs \
mchung@45105 564 docs-jdk-index docs-zip