annotate make/Javadoc.gmk @ 44989:a9bd528e3014

8179658: SetupProcessMarkdown creates long file names Reviewed-by: tbell, erikj
author ihse
date Mon, 08 May 2017 08:46:00 +0200
parents 18fa47ab765d
children db3606f423a3
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@44827 41 $(eval $(call IncludeCustomExtension, , Javadoc.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 # Should we use -Xdocrootparent? Allow custom to overwrite.
ihse@44827 52 DOCROOTPARENT_FLAG ?= TRUE
neugens@37034 53
ihse@41652 54 # URLs
ihse@44988 55 JAVADOC_BASE_URL := http://www.oracle.com/pls/topic/lookup?ctx=javase9&id=homepage
ihse@41652 56 BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
ihse@44725 57 COPYRIGHT_URL := {@docroot}/../legal/cpyr.html
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@44725 130 <a href="$(JAVADOC_BASE_URL)/index.html" 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@44725 138 $(COMPANY_ADDRESS). All rights reserved.$(DRAFT_MARKER_STR)</span>
ihse@44725 139
ihse@44725 140 JAVADOC_TOP := \
ihse@44725 141 <div style="background-color: $(HASH)EEEEEE"><div style="padding: 6px; \
ihse@44725 142 margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: \
ihse@44725 143 6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, \
ihse@44725 144 sans-serif; font-weight: normal;">Please note that the specifications \
ihse@44725 145 and other information contained herein are not final and are subject to \
ihse@44725 146 change. The information is being made available to you solely for \
ihse@44725 147 purpose of evaluation.</div></div>
ksrini@35367 148
ihse@41652 149 ################################################################################
ihse@44726 150 # JDK javadoc titles/text snippets
ksrini@35367 151
ihse@44726 152 JDK_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition Development Kit \
ihse@44726 153 (JDK&trade;) $(VERSION_SPECIFICATION)<br>API Specification
ihse@44726 154
ihse@44726 155 ################################################################################
ihse@44726 156 # Java SE javadoc titles/text snippets
ihse@44726 157
ihse@44726 158 JAVASE_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition \
ihse@44725 159 $(VERSION_SPECIFICATION)<br>API Specification
ksrini@35367 160
ihse@41652 161 ################################################################################
ihse@44726 162 # Functions
alanb@36506 163
ihse@44726 164 # Helper function for creating a png file from a dot file generated by the
ihse@44726 165 # GenGraphs tool.
ihse@44726 166 # param 1: SetupJavadocGeneration namespace ($1)
ihse@44726 167 # param 2: module name
ihse@44726 168 #
ihse@44726 169 define setup_gengraph_dot_to_png
ihse@44726 170 $1_$2_DOT_SRC := $$($1_GENGRAPHS_DIR)/$2.dot
ihse@44726 171 $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png
ksrini@35367 172
ihse@44726 173 # For each module needing a graph, create a png file from the dot file
ihse@44726 174 # generated by the GenGraphs tool and store it in the target dir.
ihse@44726 175 $$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
ihse@44726 176 $$(call MakeDir, $$(@D))
ihse@44726 177 $$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
ihse@44726 178 $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
ihse@44725 179
ihse@44726 180 $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
ihse@44726 181 endef
ksrini@35367 182
ihse@41652 183 ################################################################################
ihse@44726 184 # Setup make rules for creating the API documentation, using javadoc and other
ihse@44726 185 # tools if needed.
ihse@44726 186 #
ihse@44726 187 # Parameter 1 is the name of the rule. This name is used as variable prefix.
ihse@44726 188 # Targets generated are returned as $1_JAVADOC_TARGETS and
ihse@44726 189 # $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
ihse@44726 190 # file" for all the magnitude of files that are generated by javadoc.
ihse@44726 191 #
ihse@44726 192 # Remaining parameters are named arguments. These include:
ihse@44726 193 # MODULES - Modules to generate javadoc for
ihse@44726 194 # NAME - The name of the javadoc compilation, to be presented to the user
ihse@44726 195 # TARGET_DIR - Where to store the output
ihse@44726 196 # OVERVIEW - Path to an html overview file
ihse@44726 197 # DOC_TITLE - Title to use in -doctitle.
ihse@44726 198 # WINDOW_TITLE - Title to use in -windowtitle.
ihse@44726 199 # HEADER_TITLE - Title to use in -header.
ihse@44726 200 # BOTTOM_TEXT - Text to use in -bottom.
ihse@44726 201 # TOP_TEXT - Text to use in -top.
ihse@44726 202 #
ihse@44726 203 SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
ihse@44726 204 define SetupApiDocsGenerationBody
ksrini@35367 205
ihse@44726 206 # Figure out all modules, both specified and transitive, that will be processed
ihse@44726 207 # by javadoc.
ihse@44726 208 $1_TRANSITIVE_MODULES := $$(call FindTransitiveDepsForModules, $$($1_MODULES))
ihse@44726 209 $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_TRANSITIVE_MODULES))
ksrini@35367 210
ihse@44726 211 ifeq ($$(ENABLE_FULL_DOCS), true)
ihse@44726 212 # Tell the ModuleGraph taglet to generate html links to soon-to-be-created
ihse@44726 213 # png files with module graphs.
ihse@44726 214 $1_JAVA_ARGS += -DenableModuleGraph=true
ihse@44726 215 endif
ihse@44725 216
ihse@44726 217 # Always include tags and basic options
ihse@44726 218 $1_OPTIONS := $$(JAVADOC_TAGS) $$(JAVADOC_OPTIONS)
ihse@44725 219
ihse@44726 220 $1_OPTIONS += -overview $$($1_OVERVIEW)
ihse@44726 221 $1_OPTIONS += --module-source-path $$(MODULES_SOURCE_PATH)
ihse@44726 222 $1_OPTIONS += --module $$(call CommaList, $$($1_MODULES))
ihse@44725 223
ihse@44726 224 # Create a string like "-Xdoclint:all,-syntax,-html,..."
ihse@44726 225 $1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
ihse@44726 226 $$(JAVADOC_DISABLED_DOCLINT)))
ihse@44726 227
ihse@44827 228 ifeq ($$($$DOCROOTPARENT_FLAG), TRUE)
ihse@44726 229 $1_OPTIONS += -Xdocrootparent $$(JAVADOC_BASE_URL)
ihse@44726 230 endif
ihse@44726 231
ihse@44726 232 $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
ihse@44726 233 $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)'
ihse@44726 234 $1_OPTIONS += -header '$$($1_HEADER_TITLE)'
ihse@44726 235 $1_OPTIONS += -bottom '$$($1_BOTTOM_TEXT)'
ihse@44726 236 ifeq ($$(IS_DRAFT), true)
ihse@44726 237 $1_OPTIONS += -top '$$($1_TOP_TEXT)'
ihse@44726 238 endif
ihse@44726 239
ihse@44726 240 # Do not store debug level options in VARDEPS.
ihse@44726 241 ifneq ($$(LOG_LEVEL), trace)
ihse@44726 242 $1_LOG_OPTION += -quiet
ihse@44726 243 else
ihse@44726 244 $1_LOG_OPTION += -verbose
ihse@44726 245 endif
ihse@44726 246
ihse@44726 247 $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
ihse@44726 248 $$($1_ALL_MODULES)
ihse@44726 249 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
ihse@44726 250 $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
ihse@44726 251
ihse@44726 252 # Get a list of all files in all the source dirs for all included modules
ihse@44726 253 $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
ihse@44726 254 $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
ihse@44726 255
ihse@44726 256 # Javadoc creates a lot of files but use index.html as a marker
ihse@44726 257 $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
ihse@44726 258 $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
ihse@44726 259 $$(call LogWarn, Generating $$($1_NAME) API javadoc for \
ihse@44726 260 $$(words $$($1_ALL_MODULES)) modules)
ihse@44726 261 $$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
ihse@44726 262 $$(call MakeDir, $$($1_TARGET_DIR))
ihse@44726 263 $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
ihse@44726 264 $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
ihse@44726 265 $$(NEW_JAVADOC) -d $$($1_TARGET_DIR) \
ihse@44726 266 $$(JAVADOC_TAGS) $$($1_OPTIONS) $$($1_LOG_OPTION))
ihse@44726 267
ihse@44726 268 $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
ihse@44726 269
ihse@44726 270 ifeq ($$(ENABLE_FULL_DOCS), true)
ihse@44726 271 # We have asked ModuleGraph to generate links to png files. Now we must
ihse@44726 272 # produce the png files.
ihse@44726 273
ihse@44726 274 # Locate which modules has the @moduleGraph tag in their module-info.java
ihse@44726 275 $1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
ihse@44726 276 $$(if $$(shell $$(GREP) -e @moduleGraph \
ihse@44726 277 $$(wildcard $$(addsuffix /module-info.java, \
ihse@44726 278 $$(call FindModuleSrcDirs, $$m)))), \
ihse@44726 279 $$m) \
ihse@44726 280 ))
ihse@44726 281
ihse@44726 282 # First we run the GenGraph tool. It will query the module structure of the
ihse@44726 283 # running JVM and output .dot files for all existing modules.
ihse@44726 284 GENGRAPHS_PROPS := \
ihse@44726 285 $$(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
ihse@44726 286
ihse@44726 287 $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
ihse@44726 288 $1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
ihse@44726 289
ihse@44726 290 $$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
ihse@44726 291 $$(call LogInfo, Running gengraphs for $$($1_NAME) API documentation)
ihse@44726 292 $$(call MakeDir, $$($1_GENGRAPHS_DIR))
ihse@44726 293 $$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
ihse@44726 294 $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
ihse@44726 295 --dot-attributes $$(GENGRAPHS_PROPS) && \
ihse@44726 296 $$(TOUCH) $$($1_GENGRAPHS_MARKER))
ihse@44726 297
ihse@44726 298 # For each module needing a graph, create a png file from the dot file
ihse@44726 299 # generated by the GenGraphs tool and store it in the target dir.
ihse@44726 300 # They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
ihse@44726 301 $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
ihse@44726 302 $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
ihse@44726 303 )
ihse@44726 304 endif
ihse@44726 305 endef
ihse@44726 306
ihse@44726 307 ################################################################################
ihse@44726 308 # Setup generation of the JDK API documentation (javadoc + modulegraph)
ihse@44726 309
ihse@44726 310 # All modules to have docs generated by docs-jdk-api target
ihse@44726 311 JDK_JAVADOC_MODULES := $(sort $(DOCS_MODULES))
ihse@44726 312
ihse@44726 313 JDK_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
ihse@44726 314
ihse@44726 315 $(eval $(call SetupApiDocsGeneration, JDK_API, \
ihse@44726 316 MODULES := $(JDK_JAVADOC_MODULES), \
ihse@44726 317 NAME := JDK, \
ihse@44726 318 TARGET_DIR := $(JAVADOC_OUTPUTDIR)/api, \
ihse@44726 319 OVERVIEW := $(JDK_JAVADOC_OVERVIEW), \
ihse@44726 320 DOC_TITLE := $(JDK_JAVADOC_DOC_TITLE), \
ihse@44726 321 WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
ihse@44726 322 HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
ihse@44726 323 BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
ihse@44726 324 TOP_TEXT := $(JAVADOC_TOP), \
ihse@44726 325 ))
ihse@44726 326
ihse@44726 327 # Targets generated are returned in JDK_API_JAVADOC_TARGETS and
ihse@44726 328 # JDK_API_MODULEGRAPH_TARGETS.
ihse@44726 329
ihse@44726 330 ################################################################################
ihse@44726 331 # Setup generation of the Java SE API documentation (javadoc + modulegraph)
ihse@44726 332
ihse@44726 333 # The Java SE module scope is just java.se.ee and it's transitive modules.
ihse@44726 334 JAVASE_JAVADOC_MODULES := java.se.ee
ihse@44726 335
ihse@44726 336 JAVASE_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
ihse@44726 337
ihse@44726 338 $(eval $(call SetupApiDocsGeneration, JAVASE_API, \
ihse@44726 339 MODULES := $(JAVASE_JAVADOC_MODULES), \
ihse@44726 340 NAME := Java SE, \
ihse@44726 341 TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
ihse@44726 342 OVERVIEW := $(JAVASE_JAVADOC_OVERVIEW), \
ihse@44726 343 DOC_TITLE := $(JAVASE_JAVADOC_DOC_TITLE), \
ihse@44726 344 WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
ihse@44726 345 HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
ihse@44726 346 BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
ihse@44726 347 TOP_TEXT := $(JAVADOC_TOP), \
ihse@44726 348 ))
ihse@44726 349
ihse@44726 350 # Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
ihse@44726 351 # JAVASE_API_MODULEGRAPH_TARGETS.
ohair@13697 352
ihse@41652 353 ################################################################################
ihse@44733 354 # Copy JDK specs files
ihse@41652 355
ihse@44733 356 # For all html documentation in $module/share/specs directories, copy it
ihse@44733 357 # unmodified
ihse@41652 358
ihse@44733 359 ALL_MODULES := $(call FindAllModules)
ihse@44983 360 COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
ihse@44733 361
ihse@44733 362 $(foreach m, $(ALL_MODULES), \
ihse@44733 363 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
ihse@44733 364 $(if $(SPECS_$m), \
ihse@44733 365 $(eval $(call SetupCopyFiles, COPY_$m, \
ihse@44733 366 SRC := $(SPECS_$m), \
ihse@44733 367 FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $(SPECS_$m))), \
ihse@44733 368 DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
ihse@44733 369 )) \
ihse@44733 370 $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
ihse@44733 371 ) \
ihse@44733 372 )
ihse@44733 373
ihse@44983 374 # Copy the global resources
ihse@44983 375 GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/specs
ihse@44983 376 $(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
ihse@44983 377 SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
ihse@44983 378 FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
ihse@44983 379 DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
ihse@44983 380 ))
ihse@44983 381 JDK_SPECS_TARGETS += $(COPY_GLOBAL_RESOURCES)
ihse@44983 382
ihse@44734 383 ifeq ($(ENABLE_FULL_DOCS), true)
ihse@44734 384 # For all markdown files in $module/share/specs directories, convert them to
ihse@44734 385 # html.
ihse@44734 386
ihse@44983 387 GLOBAL_SPECS_DEFAULT_CSS_FILE := $(JAVADOC_OUTPUTDIR)/specs/resources/jdk-default.css
ihse@44734 388
ihse@44734 389 $(foreach m, $(ALL_MODULES), \
ihse@44734 390 $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
ihse@44983 391 $(foreach d, $(SPECS_$m), \
ihse@44983 392 $(if $(filter %.md, $(call CacheFind, $d)), \
ihse@44989 393 $(eval $(call SetupProcessMarkdown, CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d), \
ihse@44983 394 SRC := $d, \
ihse@44983 395 FILES := $(filter %.md, $(call CacheFind, $d)), \
ihse@44983 396 DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
ihse@44983 397 CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
ihse@44983 398 )) \
ihse@44983 399 ) \
ihse@44989 400 $(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d))) \
ihse@44734 401 ) \
ihse@44734 402 )
ihse@44734 403 endif
ihse@44734 404
ihse@44733 405 # Special treatment for generated documentation
ihse@44733 406
ihse@44733 407 JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
ihse@44733 408 $(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
ihse@44733 409 FILES := $(JDWP_PROTOCOL), \
ihse@44733 410 DEST := $(JAVADOC_OUTPUTDIR)/specs/jdwp, \
ihse@41652 411 ))
ihse@44733 412 JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
ihse@41652 413
ihse@44733 414 # Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
ihse@44733 415 JVMTI_HTML := $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
erikj@41260 416 $(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
erikj@41260 417 FILES := $(JVMTI_HTML), \
ihse@44733 418 DEST := $(JAVADOC_OUTPUTDIR)/specs, \
erikj@41260 419 ))
ihse@44733 420 JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
ohair@13697 421
ihse@41652 422 ################################################################################
ihse@41652 423 # Optional target which bundles all generated javadocs into a zip archive.
neugens@37034 424
ihse@44725 425 JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
ihse@44725 426 JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
ihse@41652 427
ihse@44725 428 $(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
ihse@44733 429 SRC := $(JAVADOC_OUTPUTDIR), \
ihse@44733 430 ZIP := $(JAVADOC_ZIP_FILE), \
ihse@44733 431 EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
ihse@44733 432 $(JDK_SPECS_TARGETS), \
ihse@44725 433 ))
neugens@37034 434
ihse@44725 435 ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
erikj@39384 436
erikj@39384 437 ################################################################################
erikj@39384 438
ihse@44726 439 docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS)
mchung@44397 440
ihse@44726 441 docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
ihse@44725 442
ihse@44726 443 docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS)
ihse@44726 444
ihse@44726 445 docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
ihse@41652 446
ihse@44733 447 docs-jdk-specs: $(JDK_SPECS_TARGETS)
ihse@41652 448
ihse@41652 449 docs-zip: $(ZIP_TARGETS)
ihse@41652 450
ihse@44726 451 all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
ihse@44733 452 docs-javase-api-modulegraph docs-jdk-specs docs-zip
ihse@41652 453
ihse@44726 454 .PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
ihse@44733 455 docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs docs-zip