annotate make/Javadoc.gmk @ 44829:d9f6608f924e

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