annotate make/Docs.gmk @ 45229:88a3fab6006f

8180426: Use standard css file for new docs bundle index.html page Reviewed-by: mchung, erikj
author ihse
date Thu, 18 May 2017 09:23:55 +0200
parents 8ad1bd49f4bc
children 538af025db97
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
ihse@44827 40 # Hook to include the corresponding custom file, if present.
ihse@45103 41 $(eval $(call IncludeCustomExtension, , Docs.gmk))
ihse@44827 42
ihse@44827 43 ################################################################################
ihse@44725 44 # Javadoc settings
ohair@13697 45
ihse@44725 46 # On top of the sources that was used to compile the JDK, we need some
ihse@44725 47 # extra java.rmi sources that are used just for javadoc.
ihse@44726 48 MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
ihse@44725 49 $(SUPPORT_OUTPUTDIR)/rmic/* $(JDK_TOPDIR)/src/*/share/doc/stub)
alanb@36506 50
ihse@41652 51 # URLs
ihse@45108 52 JAVADOC_BASE_URL := http://www.oracle.com/pls/topic/lookup?ctx=javase9&id=homepage
ihse@41652 53 BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
ihse@44725 54 COPYRIGHT_URL := {@docroot}/../legal/cpyr.html
ihse@44990 55 LICENSE_URL := http://www.oracle.com/technetwork/java/javase/terms/license/java9speclicense.html
ihse@44990 56 REDISTRIBUTION_URL := http://www.oracle.com/technetwork/java/redist-137594.html
ihse@44990 57
ihse@41652 58
ihse@42135 59 # In order to get a specific ordering it's necessary to specify the total
ihse@42135 60 # ordering of tags as the tags are otherwise ordered in order of definition.
ihse@44725 61 JAVADOC_TAGS := \
ihse@42135 62 -tag beaninfo:X \
ihse@42135 63 -tag revised:X \
ihse@42135 64 -tag since.unbundled:X \
ihse@42135 65 -tag spec:X \
ihse@42135 66 -tag specdefault:X \
ihse@42135 67 -tag Note:X \
ihse@42135 68 -tag ToDo:X \
ihse@42135 69 -tag 'apiNote:a:API Note:' \
ihse@42135 70 -tag 'implSpec:a:Implementation Requirements:' \
ihse@42135 71 -tag 'implNote:a:Implementation Note:' \
ihse@42135 72 -tag param \
ihse@42135 73 -tag return \
ihse@42135 74 -tag throws \
mchung@44397 75 -taglet build.tools.taglet.ModuleGraph \
ihse@42135 76 -tag since \
ihse@42135 77 -tag version \
ihse@42135 78 -tag serialData \
ihse@42135 79 -tag factory \
ihse@42135 80 -tag see \
ihse@42135 81 -tag 'jvms:a:See <cite>The Java&trade; Virtual Machine Specification</cite>:' \
ihse@42135 82 -tag 'jls:a:See <cite>The Java&trade; Language Specification</cite>:' \
ksrini@44826 83 -taglet build.tools.taglet.ExtLink \
chegar@43285 84 -taglet build.tools.taglet.Incubating \
chegar@43285 85 -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
ihse@44827 86 $(CUSTOM_JAVADOC_TAGS) \
ihse@42135 87 #
ihse@42135 88
ihse@44725 89 # Which doclint checks to ignore
ihse@44725 90 JAVADOC_DISABLED_DOCLINT := accessibility html missing syntax reference
ihse@44725 91
ihse@44725 92 # The initial set of options for javadoc
ihse@44725 93 JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
ihse@44725 94 -serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
ihse@44829 95 -html5 -javafx --expand-requires transitive
ihse@41652 96
ihse@44725 97 # Should we add DRAFT stamps to the generated javadoc?
ihse@44725 98 ifeq ($(VERSION_IS_GA), true)
ihse@44725 99 IS_DRAFT := false
ihse@44725 100 else
ihse@44725 101 IS_DRAFT := true
ihse@44725 102 endif
ohair@13697 103
ihse@41652 104 ################################################################################
ihse@44725 105 # General text snippets
alanb@36506 106
ihse@44725 107 FULL_COMPANY_NAME := Oracle and/or its affiliates
ihse@44725 108 COMPANY_ADDRESS := 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA
ohair@13697 109
ihse@44725 110 ifeq ($(IS_DRAFT), true)
ihse@44725 111 DRAFT_MARKER_STR := <br><strong>DRAFT $(VERSION_STRING)</strong>
ihse@44725 112 ifeq ($(VERSION_BUILD), 0)
ihse@44725 113 DRAFT_MARKER_TITLE := [ad-hoc build]
ihse@44725 114 else
ihse@44725 115 DRAFT_MARKER_TITLE := [build $(VERSION_BUILD)]
ihse@44725 116 endif
ihse@44725 117 endif
ihse@44725 118
ihse@44725 119 JAVADOC_WINDOW_TITLE := Java Platform SE $(VERSION_SPECIFICATION) \
ihse@44725 120 $(DRAFT_MARKER_TITLE)
ohair@13697 121
ihse@44725 122 JAVADOC_HEADER_TITLE := $(subst $(SPACE),&nbsp;,$(strip \
ihse@44725 123 <strong>Java&trade; Platform<br>Standard Ed. \
ihse@44725 124 $(VERSION_SPECIFICATION)</strong>$(DRAFT_MARKER_STR)))
ihse@44725 125
ihse@44725 126 JAVADOC_BOTTOM := \
ihse@44725 127 <span style="font-size:smaller"> \
ihse@44725 128 <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a><br> \
ihse@44725 129 For further API reference and developer documentation, see \
ihse@45108 130 <a href="$(JAVADOC_BASE_URL)" target="_blank">Java SE \
ihse@44725 131 Documentation</a>. That documentation contains more detailed, \
ihse@44725 132 developer-targeted descriptions, with conceptual overviews, definitions \
ihse@44725 133 of terms, workarounds, and working code examples.<br> \
ihse@44725 134 Java is a trademark or registered trademark of $(FULL_COMPANY_NAME) in \
ihse@44725 135 the US and other countries.<br> \
ihse@44725 136 <a href="$(COPYRIGHT_URL)">Copyright</a> \
ihse@44725 137 &copy; 1993, $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
ihse@44990 138 $(COMPANY_ADDRESS). All rights reserved. \
ihse@44990 139 Use is subject to <a href="$(LICENSE_URL)">license terms</a>. Also see the \
ihse@44990 140 <a href="$(REDISTRIBUTION_URL)">documentation redistribution policy</a>. \
ihse@44990 141 $(DRAFT_MARKER_STR)</span>
ihse@44725 142
ihse@44725 143 JAVADOC_TOP := \
ihse@44725 144 <div style="background-color: $(HASH)EEEEEE"><div style="padding: 6px; \
ihse@44725 145 margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: \
ihse@44725 146 6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, \
ihse@44725 147 sans-serif; font-weight: normal;">Please note that the specifications \
ihse@44725 148 and other information contained herein are not final and are subject to \
ihse@44725 149 change. The information is being made available to you solely for \
ihse@44725 150 purpose of evaluation.</div></div>
ksrini@35367 151
ihse@41652 152 ################################################################################
ihse@44726 153 # JDK javadoc titles/text snippets
ksrini@35367 154
ihse@44726 155 JDK_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition Development Kit \
ihse@44726 156 (JDK&trade;) $(VERSION_SPECIFICATION)<br>API Specification
ihse@44726 157
ihse@44726 158 ################################################################################
ihse@44726 159 # Java SE javadoc titles/text snippets
ihse@44726 160
ihse@44726 161 JAVASE_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition \
ihse@44725 162 $(VERSION_SPECIFICATION)<br>API Specification
ksrini@35367 163
ihse@41652 164 ################################################################################
mchung@45105 165
ihse@45229 166 JDK_INDEX_TITLE := Java&trade; Platform, Standard Edition Development Kit \
mchung@45105 167 (JDK&trade;) $(VERSION_SPECIFICATION) Specification<br>$(DRAFT_MARKER_TITLE)
mchung@45105 168
mchung@45105 169 ################################################################################
ihse@44726 170 # Functions
alanb@36506 171
ihse@44726 172 # Helper function for creating a png file from a dot file generated by the
ihse@44726 173 # GenGraphs tool.
ihse@44726 174 # param 1: SetupJavadocGeneration namespace ($1)
ihse@44726 175 # param 2: module name
ihse@44726 176 #
ihse@44726 177 define setup_gengraph_dot_to_png
ihse@44726 178 $1_$2_DOT_SRC := $$($1_GENGRAPHS_DIR)/$2.dot
ihse@44726 179 $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png
ksrini@35367 180
ihse@44726 181 # For each module needing a graph, create a png file from the dot file
ihse@44726 182 # generated by the GenGraphs tool and store it in the target dir.
ihse@44726 183 $$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
ihse@44726 184 $$(call MakeDir, $$(@D))
ihse@44726 185 $$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
ihse@44726 186 $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
ihse@44725 187
ihse@44726 188 $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
ihse@44726 189 endef
ksrini@35367 190
ihse@41652 191 ################################################################################
ihse@44726 192 # Setup make rules for creating the API documentation, using javadoc and other
ihse@44726 193 # tools if needed.
ihse@44726 194 #
ihse@44726 195 # Parameter 1 is the name of the rule. This name is used as variable prefix.
ihse@44726 196 # Targets generated are returned as $1_JAVADOC_TARGETS and
ihse@44726 197 # $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
ihse@44726 198 # file" for all the magnitude of files that are generated by javadoc.
ihse@44726 199 #
ihse@44726 200 # Remaining parameters are named arguments. These include:
ihse@44726 201 # MODULES - Modules to generate javadoc for
ihse@44726 202 # NAME - The name of the javadoc compilation, to be presented to the user
ihse@44726 203 # TARGET_DIR - Where to store the output
ihse@44726 204 # OVERVIEW - Path to an html overview file
ihse@44726 205 # DOC_TITLE - Title to use in -doctitle.
ihse@44726 206 # WINDOW_TITLE - Title to use in -windowtitle.
ihse@44726 207 # HEADER_TITLE - Title to use in -header.
ihse@44726 208 # BOTTOM_TEXT - Text to use in -bottom.
ihse@44726 209 # TOP_TEXT - Text to use in -top.
ihse@44726 210 #
ihse@44726 211 SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
ihse@44726 212 define SetupApiDocsGenerationBody
ksrini@35367 213
ihse@44726 214 # Figure out all modules, both specified and transitive, that will be processed
ihse@44726 215 # by javadoc.
ihse@44726 216 $1_TRANSITIVE_MODULES := $$(call FindTransitiveDepsForModules, $$($1_MODULES))
ihse@44726 217 $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_TRANSITIVE_MODULES))
ksrini@35367 218
ihse@44726 219 ifeq ($$(ENABLE_FULL_DOCS), true)
ihse@44726 220 # Tell the ModuleGraph taglet to generate html links to soon-to-be-created
ihse@44726 221 # png files with module graphs.
ihse@44726 222 $1_JAVA_ARGS += -DenableModuleGraph=true
ihse@44726 223 endif
ihse@44725 224
ihse@44726 225 # Always include tags and basic options
ihse@44726 226 $1_OPTIONS := $$(JAVADOC_TAGS) $$(JAVADOC_OPTIONS)
ihse@44725 227
ihse@44726 228 $1_OPTIONS += -overview $$($1_OVERVIEW)
ihse@44726 229 $1_OPTIONS += --module-source-path $$(MODULES_SOURCE_PATH)
ihse@44726 230 $1_OPTIONS += --module $$(call CommaList, $$($1_MODULES))
ihse@44725 231
ihse@44726 232 # Create a string like "-Xdoclint:all,-syntax,-html,..."
ihse@44726 233 $1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
ihse@44726 234 $$(JAVADOC_DISABLED_DOCLINT)))
ihse@44726 235
ihse@44726 236 $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
ihse@44726 237 $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)'
ihse@44726 238 $1_OPTIONS += -header '$$($1_HEADER_TITLE)'
ihse@44726 239 $1_OPTIONS += -bottom '$$($1_BOTTOM_TEXT)'
ihse@44726 240 ifeq ($$(IS_DRAFT), true)
ihse@44726 241 $1_OPTIONS += -top '$$($1_TOP_TEXT)'
ihse@44726 242 endif
ihse@44726 243
ihse@44726 244 # Do not store debug level options in VARDEPS.
ihse@44726 245 ifneq ($$(LOG_LEVEL), trace)
ihse@44726 246 $1_LOG_OPTION += -quiet
ihse@44726 247 else
ihse@44726 248 $1_LOG_OPTION += -verbose
ihse@44726 249 endif
ihse@44726 250
ihse@44726 251 $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
ihse@44726 252 $$($1_ALL_MODULES)
ihse@44726 253 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
ihse@44726 254 $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
ihse@44726 255
ihse@44726 256 # Get a list of all files in all the source dirs for all included modules
ihse@44726 257 $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
ihse@44726 258 $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
ihse@44726 259
ihse@44726 260 # Javadoc creates a lot of files but use index.html as a marker
ihse@44726 261 $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
ihse@44726 262 $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
ihse@44726 263 $$(call LogWarn, Generating $$($1_NAME) API javadoc for \
ihse@44726 264 $$(words $$($1_ALL_MODULES)) modules)
ihse@44726 265 $$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
ihse@44726 266 $$(call MakeDir, $$($1_TARGET_DIR))
ihse@44726 267 $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
ihse@44726 268 $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
ihse@44726 269 $$(NEW_JAVADOC) -d $$($1_TARGET_DIR) \
ihse@44726 270 $$(JAVADOC_TAGS) $$($1_OPTIONS) $$($1_LOG_OPTION))
ihse@44726 271
ihse@44726 272 $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
ihse@44726 273
ihse@44726 274 ifeq ($$(ENABLE_FULL_DOCS), true)
ihse@44726 275 # We have asked ModuleGraph to generate links to png files. Now we must
ihse@44726 276 # produce the png files.
ihse@44726 277
ihse@44726 278 # Locate which modules has the @moduleGraph tag in their module-info.java
ihse@44726 279 $1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
ihse@44726 280 $$(if $$(shell $$(GREP) -e @moduleGraph \
ihse@44726 281 $$(wildcard $$(addsuffix /module-info.java, \
ihse@44726 282 $$(call FindModuleSrcDirs, $$m)))), \
ihse@44726 283 $$m) \
ihse@44726 284 ))
ihse@44726 285
ihse@44726 286 # First we run the GenGraph tool. It will query the module structure of the
ihse@44726 287 # running JVM and output .dot files for all existing modules.
ihse@44726 288 GENGRAPHS_PROPS := \
ihse@44726 289 $$(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
ihse@44726 290
ihse@44726 291 $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
ihse@44726 292 $1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
ihse@44726 293
ihse@44726 294 $$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
ihse@44726 295 $$(call LogInfo, Running gengraphs for $$($1_NAME) API documentation)
ihse@44726 296 $$(call MakeDir, $$($1_GENGRAPHS_DIR))
ihse@44726 297 $$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
ihse@44726 298 $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
ihse@44726 299 --dot-attributes $$(GENGRAPHS_PROPS) && \
ihse@44726 300 $$(TOUCH) $$($1_GENGRAPHS_MARKER))
ihse@44726 301
ihse@44726 302 # For each module needing a graph, create a png file from the dot file
ihse@44726 303 # generated by the GenGraphs tool and store it in the target dir.
ihse@44726 304 # They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
ihse@44726 305 $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
ihse@44726 306 $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
ihse@44726 307 )
ihse@44726 308 endif
ihse@44726 309 endef
ihse@44726 310
ihse@44726 311 ################################################################################
ihse@44726 312 # Setup generation of the JDK API documentation (javadoc + modulegraph)
ihse@44726 313
ihse@44726 314 # All modules to have docs generated by docs-jdk-api target
ihse@44726 315 JDK_JAVADOC_MODULES := $(sort $(DOCS_MODULES))
ihse@44726 316
ihse@44726 317 JDK_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
ihse@44726 318
ihse@44726 319 $(eval $(call SetupApiDocsGeneration, JDK_API, \
ihse@44726 320 MODULES := $(JDK_JAVADOC_MODULES), \
ihse@44726 321 NAME := JDK, \
ihse@45103 322 TARGET_DIR := $(DOCS_OUTPUTDIR)/api, \
ihse@44726 323 OVERVIEW := $(JDK_JAVADOC_OVERVIEW), \
ihse@44726 324 DOC_TITLE := $(JDK_JAVADOC_DOC_TITLE), \
ihse@44726 325 WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
ihse@44726 326 HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
ihse@44726 327 BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
ihse@44726 328 TOP_TEXT := $(JAVADOC_TOP), \
ihse@44726 329 ))
ihse@44726 330
ihse@44726 331 # Targets generated are returned in JDK_API_JAVADOC_TARGETS and
ihse@44726 332 # JDK_API_MODULEGRAPH_TARGETS.
ihse@44726 333
ihse@44726 334 ################################################################################
ihse@44726 335 # Setup generation of the Java SE API documentation (javadoc + modulegraph)
ihse@44726 336
ihse@44726 337 # The Java SE module scope is just java.se.ee and it's transitive modules.
ihse@44726 338 JAVASE_JAVADOC_MODULES := java.se.ee
ihse@44726 339
ihse@44726 340 JAVASE_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
ihse@44726 341
ihse@44726 342 $(eval $(call SetupApiDocsGeneration, JAVASE_API, \
ihse@44726 343 MODULES := $(JAVASE_JAVADOC_MODULES), \
ihse@44726 344 NAME := Java SE, \
ihse@44726 345 TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
ihse@44726 346 OVERVIEW := $(JAVASE_JAVADOC_OVERVIEW), \
ihse@44726 347 DOC_TITLE := $(JAVASE_JAVADOC_DOC_TITLE), \
ihse@44726 348 WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
ihse@44726 349 HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
ihse@44726 350 BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
ihse@44726 351 TOP_TEXT := $(JAVADOC_TOP), \
ihse@44726 352 ))
ihse@44726 353
ihse@44726 354 # Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
ihse@44726 355 # JAVASE_API_MODULEGRAPH_TARGETS.
ohair@13697 356
ihse@41652 357 ################################################################################
mchung@45105 358
ihse@45229 359 JDK_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
ihse@45229 360 JDK_INDEX_TOOLS_DIR := $(TOOLS_CLASSES_DIR)/build/tools/docs
mchung@45105 361
ihse@45229 362 $(JDK_INDEX_HTML): $(BUILD_JIGSAW_TOOLS) \
ihse@45229 363 $(JDK_INDEX_TOOLS_DIR)/docs-bundle-page.html \
ihse@45229 364 $(JDK_INDEX_TOOLS_DIR)/docs-module-groups.properties
mchung@45105 365 $(call LogInfo, Generating docs bundle index page)
mchung@45105 366 $(MKDIR) -p $(@D)
ihse@45229 367 $(TOOL_GEN_DOCS_BUNDLE_PAGE) --title '$(JDK_INDEX_TITLE)' \
mchung@45105 368 --output $@
mchung@45105 369
ihse@45229 370 JDK_INDEX_TARGETS := $(JDK_INDEX_HTML)
ihse@45229 371
ihse@45229 372 # Copy the global resources
ihse@45229 373 GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/
ihse@45229 374 $(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
ihse@45229 375 SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
ihse@45229 376 FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
ihse@45229 377 DEST := $(DOCS_OUTPUTDIR), \
ihse@45229 378 ))
ihse@45229 379 JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
mchung@45105 380
mchung@45105 381 ################################################################################
ihse@44733 382 # Copy JDK specs files
ihse@41652 383
ihse@44733 384 # For all html documentation in $module/share/specs directories, copy it
ihse@44733 385 # unmodified
ihse@41652 386
ihse@44733 387 ALL_MODULES := $(call FindAllModules)
ihse@44983 388 COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
ihse@44733 389
ihse@44733 390 $(foreach m, $(ALL_MODULES), \
ihse@44733 391 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
ihse@45095 392 $(foreach d, $(SPECS_$m), \
ihse@45095 393 $(if $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
ihse@45095 394 $(eval $(call SetupCopyFiles, COPY_$m, \
ihse@45095 395 SRC := $d, \
ihse@45095 396 FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
ihse@45103 397 DEST := $(DOCS_OUTPUTDIR)/specs/, \
ihse@45095 398 )) \
ihse@45095 399 $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
ihse@45095 400 ) \
ihse@44733 401 ) \
ihse@44733 402 )
ihse@44733 403
ihse@44734 404 ifeq ($(ENABLE_FULL_DOCS), true)
ihse@44734 405 # For all markdown files in $module/share/specs directories, convert them to
ihse@44734 406 # html.
ihse@44734 407
ihse@45229 408 GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
ihse@44734 409
ihse@44734 410 $(foreach m, $(ALL_MODULES), \
ihse@44734 411 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
ihse@44983 412 $(foreach d, $(SPECS_$m), \
ihse@44983 413 $(if $(filter %.md, $(call CacheFind, $d)), \
ihse@44989 414 $(eval $(call SetupProcessMarkdown, CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d), \
ihse@44983 415 SRC := $d, \
ihse@44983 416 FILES := $(filter %.md, $(call CacheFind, $d)), \
ihse@45103 417 DEST := $(DOCS_OUTPUTDIR)/specs/, \
ihse@44983 418 CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
ihse@44983 419 )) \
ihse@44983 420 ) \
ihse@44989 421 $(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d))) \
ihse@44734 422 ) \
ihse@44734 423 )
ihse@44734 424 endif
ihse@44734 425
ihse@44733 426 # Special treatment for generated documentation
ihse@44733 427
ihse@44733 428 JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
ihse@44733 429 $(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
ihse@44733 430 FILES := $(JDWP_PROTOCOL), \
ihse@45103 431 DEST := $(DOCS_OUTPUTDIR)/specs/jdwp, \
ihse@41652 432 ))
ihse@44733 433 JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
ihse@41652 434
ihse@44733 435 # Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
ihse@44733 436 JVMTI_HTML := $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
erikj@41260 437 $(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
erikj@41260 438 FILES := $(JVMTI_HTML), \
ihse@45103 439 DEST := $(DOCS_OUTPUTDIR)/specs, \
erikj@41260 440 ))
ihse@44733 441 JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
ohair@13697 442
ihse@41652 443 ################################################################################
ihse@41652 444 # Optional target which bundles all generated javadocs into a zip archive.
neugens@37034 445
ihse@44725 446 JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
ihse@44725 447 JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
ihse@41652 448
ihse@44725 449 $(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
ihse@45103 450 SRC := $(DOCS_OUTPUTDIR), \
ihse@44733 451 ZIP := $(JAVADOC_ZIP_FILE), \
ihse@44733 452 EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
ihse@44733 453 $(JDK_SPECS_TARGETS), \
ihse@44725 454 ))
neugens@37034 455
ihse@44725 456 ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
erikj@39384 457
erikj@39384 458 ################################################################################
erikj@39384 459
ihse@45103 460 docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS) $(JDK_API_CUSTOM_TARGETS)
mchung@44397 461
ihse@44726 462 docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
ihse@44725 463
ihse@45103 464 docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS) $(JAVASE_API_CUSTOM_TARGETS)
ihse@44726 465
ihse@44726 466 docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
ihse@41652 467
ihse@44733 468 docs-jdk-specs: $(JDK_SPECS_TARGETS)
ihse@41652 469
ihse@45229 470 docs-jdk-index: $(JDK_INDEX_TARGETS)
mchung@45105 471
ihse@41652 472 docs-zip: $(ZIP_TARGETS)
ihse@41652 473
ihse@44726 474 all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
mchung@45105 475 docs-javase-api-modulegraph docs-jdk-specs docs-jdk-index docs-zip
ihse@41652 476
ihse@44726 477 .PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
mchung@45105 478 docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs \
mchung@45105 479 docs-jdk-index docs-zip