annotate make/Javadoc.gmk @ 44725:8747b14eb49c

8172312: Update docs target and image for new combined docs Reviewed-by: erikj, mchung Contributed-by: Magnus Ihse Bursie <magnus.ihse.bursie@oracle.com>, Mandy Chung <mandy.chung@oracle.com>
author ihse
date Wed, 19 Apr 2017 10:24:42 +0200
parents f932d6b9f7fe
children 04aa2c065f5c
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@44725 38 # Javadoc settings
ohair@13697 39
ihse@44725 40 # All modules to have docs generated by docs-javadoc target
ihse@44725 41 JAVADOC_MODULES := $(sort $(DOCS_MODULES))
ihse@44725 42
ihse@44725 43 # On top of the sources that was used to compile the JDK, we need some
ihse@44725 44 # extra java.rmi sources that are used just for javadoc.
ihse@44725 45 JAVADOC_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
ihse@44725 46 $(SUPPORT_OUTPUTDIR)/rmic/* $(JDK_TOPDIR)/src/*/share/doc/stub)
alanb@36506 47
ihse@41652 48 # Should we use -Xdocrootparent? Allow custom to overwrite.
ihse@41652 49 DOCROOTPARENT_FLAG = TRUE
neugens@37034 50
ihse@41652 51 # URLs
ihse@41652 52 JAVADOC_BASE_URL := http://docs.oracle.com/javase/$(VERSION_SPECIFICATION)/docs
ihse@41652 53 BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
ihse@44725 54 COPYRIGHT_URL := {@docroot}/../legal/cpyr.html
ihse@41652 55
ihse@42135 56 # In order to get a specific ordering it's necessary to specify the total
ihse@42135 57 # ordering of tags as the tags are otherwise ordered in order of definition.
ihse@44725 58 JAVADOC_TAGS := \
ihse@42135 59 -tag beaninfo:X \
ihse@42135 60 -tag revised:X \
ihse@42135 61 -tag since.unbundled:X \
ihse@42135 62 -tag spec:X \
ihse@42135 63 -tag specdefault:X \
ihse@42135 64 -tag Note:X \
ihse@42135 65 -tag ToDo:X \
ihse@42135 66 -tag 'apiNote:a:API Note:' \
ihse@42135 67 -tag 'implSpec:a:Implementation Requirements:' \
ihse@42135 68 -tag 'implNote:a:Implementation Note:' \
ihse@42135 69 -tag param \
ihse@42135 70 -tag return \
ihse@42135 71 -tag throws \
mchung@44397 72 -taglet build.tools.taglet.ModuleGraph \
ihse@42135 73 -tag since \
ihse@42135 74 -tag version \
ihse@42135 75 -tag serialData \
ihse@42135 76 -tag factory \
ihse@42135 77 -tag see \
ihse@42135 78 -tag 'jvms:a:See <cite>The Java&trade; Virtual Machine Specification</cite>:' \
ihse@42135 79 -tag 'jls:a:See <cite>The Java&trade; Language Specification</cite>:' \
chegar@43285 80 -taglet build.tools.taglet.Incubating \
chegar@43285 81 -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
ihse@42135 82 #
ihse@42135 83
ihse@44725 84 # Which doclint checks to ignore
ihse@44725 85 JAVADOC_DISABLED_DOCLINT := accessibility html missing syntax reference
ihse@44725 86
ihse@44725 87 # The initial set of options for javadoc
ihse@44725 88 JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
ihse@44725 89 -serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
ihse@44725 90 --expand-requires transitive
ihse@41652 91
mchung@44397 92 #
mchung@44397 93 # TODO: this should be set by the configure option.
mchung@44397 94 #
mchung@44397 95 ifndef ENABLE_MODULE_GRAPH
mchung@44397 96 ENABLE_MODULE_GRAPH=false
mchung@44397 97 endif
mchung@44397 98
ihse@44725 99 # Should we add DRAFT stamps to the generated javadoc?
ihse@44725 100 ifeq ($(VERSION_IS_GA), true)
ihse@44725 101 IS_DRAFT := false
ihse@44725 102 else
ihse@44725 103 IS_DRAFT := true
ihse@44725 104 endif
ohair@13697 105
ihse@41652 106 ################################################################################
ihse@44725 107 # General text snippets
alanb@36506 108
ihse@44725 109 FULL_COMPANY_NAME := Oracle and/or its affiliates
ihse@44725 110 COMPANY_ADDRESS := 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA
ohair@13697 111
ihse@44725 112 ifeq ($(IS_DRAFT), true)
ihse@44725 113 DRAFT_MARKER_STR := <br><strong>DRAFT $(VERSION_STRING)</strong>
ihse@44725 114 ifeq ($(VERSION_BUILD), 0)
ihse@44725 115 DRAFT_MARKER_TITLE := [ad-hoc build]
ihse@44725 116 else
ihse@44725 117 DRAFT_MARKER_TITLE := [build $(VERSION_BUILD)]
ihse@44725 118 endif
ihse@44725 119 endif
ihse@44725 120
ohair@13697 121
ihse@41652 122 ################################################################################
ihse@44725 123 # JDK javadoc titles/text snippets
ohair@13697 124
ihse@44725 125 JAVADOC_WINDOW_TITLE := Java Platform SE $(VERSION_SPECIFICATION) \
ihse@44725 126 $(DRAFT_MARKER_TITLE)
ohair@13697 127
ihse@44725 128 JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition Development Kit \
ihse@44725 129 (JDK&trade;) $(VERSION_SPECIFICATION)<br>API Specification
ihse@44725 130
ihse@44725 131 JAVADOC_HEADER_TITLE := $(subst $(SPACE),&nbsp;,$(strip \
ihse@44725 132 <strong>Java&trade; Platform<br>Standard Ed. \
ihse@44725 133 $(VERSION_SPECIFICATION)</strong>$(DRAFT_MARKER_STR)))
ihse@44725 134
ihse@44725 135 JAVADOC_BOTTOM := \
ihse@44725 136 <span style="font-size:smaller"> \
ihse@44725 137 <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a><br> \
ihse@44725 138 For further API reference and developer documentation, see \
ihse@44725 139 <a href="$(JAVADOC_BASE_URL)/index.html" target="_blank">Java SE \
ihse@44725 140 Documentation</a>. That documentation contains more detailed, \
ihse@44725 141 developer-targeted descriptions, with conceptual overviews, definitions \
ihse@44725 142 of terms, workarounds, and working code examples.<br> \
ihse@44725 143 Java is a trademark or registered trademark of $(FULL_COMPANY_NAME) in \
ihse@44725 144 the US and other countries.<br> \
ihse@44725 145 <a href="$(COPYRIGHT_URL)">Copyright</a> \
ihse@44725 146 &copy; 1993, $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
ihse@44725 147 $(COMPANY_ADDRESS). All rights reserved.$(DRAFT_MARKER_STR)</span>
ihse@44725 148
ihse@44725 149 JAVADOC_TOP := \
ihse@44725 150 <div style="background-color: $(HASH)EEEEEE"><div style="padding: 6px; \
ihse@44725 151 margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: \
ihse@44725 152 6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, \
ihse@44725 153 sans-serif; font-weight: normal;">Please note that the specifications \
ihse@44725 154 and other information contained herein are not final and are subject to \
ihse@44725 155 change. The information is being made available to you solely for \
ihse@44725 156 purpose of evaluation.</div></div>
ksrini@35367 157
ihse@41652 158 ################################################################################
ihse@44725 159 # Java SE Reference javadoc titles/text snippets
ksrini@35367 160
ihse@44725 161 REFERENCE_DOC_TITLE := Java&trade; Platform, Standard Edition \
ihse@44725 162 $(VERSION_SPECIFICATION)<br>API Specification
ksrini@35367 163
ihse@41652 164 ################################################################################
ihse@44725 165 # Setup call to JDK javadoc based on above settings
alanb@36506 166
ihse@44725 167 # Create a string like "-Xdoclint:all,-syntax,-html,..."
ihse@44725 168 JAVADOC_OPTIONS += -Xdoclint:all,$(call CommaList, $(addprefix -, \
ihse@44725 169 $(JAVADOC_DISABLED_DOCLINT)))
ksrini@35367 170
ihse@44725 171 ifneq ($($DOCROOTPARENT_FLAG), )
ihse@44725 172 JAVADOC_OPTIONS += -Xdocrootparent $(JAVADOC_BASE_URL)
ihse@44725 173 endif
ihse@44725 174
ihse@44725 175 JAVADOC_TITLE_OPTIONS += -doctitle '$(JAVADOC_DOC_TITLE)'
ihse@44725 176 JAVADOC_TITLE_OPTIONS += -windowtitle '$(JAVADOC_WINDOW_TITLE)'
ihse@44725 177 JAVADOC_TITLE_OPTIONS += -header '$(JAVADOC_HEADER_TITLE)'
ihse@44725 178 JAVADOC_TITLE_OPTIONS += -bottom '$(JAVADOC_BOTTOM)'
ihse@44725 179 ifeq ($(IS_DRAFT), true)
ihse@44725 180 JAVADOC_TITLE_OPTIONS += -top '$(JAVADOC_TOP)'
ihse@44725 181 endif
ihse@44725 182
ihse@44725 183 # Do not store debug level options in VARDEPS.
ihse@44725 184 ifneq ($(LOG_LEVEL), trace)
ihse@44725 185 JAVADOC_LOG_OPTION += -quiet
ihse@44725 186 else
ihse@44725 187 JAVADOC_LOG_OPTION += -verbose
ihse@44725 188 endif
ihse@44725 189
ihse@44725 190 JAVADOC_VARDEPS := $(JAVADOC_OPTIONS) $(JAVADOC_TITLE_OPTIONS) $(JAVADOC_TAGS) \
ihse@44725 191 $(JAVADOC_MODULES) $(JAVADOC_SOURCE_PATH)
ihse@44725 192 JAVADOC_VARDEPS_FILE := $(call DependOnVariable, JAVADOC_VARDEPS, \
ihse@44725 193 $(SUPPORT_OUTPUTDIR)/docs/javadoc.vardeps)
ihse@44725 194
ihse@44725 195 # Get a list of all files in all the source dirs for all included modules
ihse@44725 196 JAVADOC_SOURCE_DEPS := $(call CacheFind, $(wildcard \
ihse@44725 197 $(foreach module, $(JAVADOC_MODULES), $(call FindModuleSrcDirs, $(module)))))
ihse@44725 198
ihse@44725 199 JAVADOC_TARGET_DIR := $(JAVADOC_OUTPUTDIR)/api
ihse@44725 200 JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
ihse@44725 201
ihse@44725 202 # Javadoc creates a lot of files but use index.html as a marker
ihse@44725 203 $(JAVADOC_TARGET_DIR)/index.html: $(BUILD_TOOLS_JDK) $(JAVADOC_VARDEPS_FILE) \
ihse@44725 204 $(JAVADOC_SOURCE_DEPS) $(JAVADOC_OVERVIEW)
ihse@44725 205 $(call LogWarn, Generating Javadoc for $(words $(JAVADOC_MODULES)) modules)
ihse@44725 206 $(call LogInfo, Javadoc modules: $(JAVADOC_MODULES))
ihse@44725 207 $(call MakeDir, $(JAVADOC_TARGET_DIR))
ihse@44725 208 $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/docs/javadoc, \
ihse@44725 209 $(JAVA) -Djava.awt.headless=true \
ihse@44725 210 -DenableModuleGraph=$(ENABLE_MODULE_GRAPH) \
ihse@44725 211 $(NEW_JAVADOC) -d $(JAVADOC_TARGET_DIR) \
ihse@44725 212 $(JAVADOC_TAGS) $(JAVADOC_OPTIONS) $(JAVADOC_LOG_OPTION) \
ihse@44725 213 $(JAVADOC_TITLE_OPTIONS) -overview $(JAVADOC_OVERVIEW) \
ihse@44725 214 --module-source-path $(JAVADOC_SOURCE_PATH) \
ihse@44725 215 --module $(call CommaList, $(JAVADOC_MODULES)))
ihse@44725 216
ihse@44725 217 JAVADOC_TARGETS += $(JAVADOC_TARGET_DIR)/index.html
ksrini@35367 218
ihse@41652 219 ################################################################################
ihse@44725 220 # Setup call to Java SE Reference javadoc based on above settings
ksrini@35367 221
ihse@44725 222 REFERENCE_TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api
ihse@44725 223 REFERENCE_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
ksrini@35367 224
ihse@44725 225 REFERENCE_TITLE_OPTIONS += -doctitle '$(REFERENCE_DOC_TITLE)'
ihse@44725 226 REFERENCE_TITLE_OPTIONS += -windowtitle '$(JAVADOC_WINDOW_TITLE)'
ihse@44725 227 REFERENCE_TITLE_OPTIONS += -header '$(JAVADOC_HEADER_TITLE)'
ihse@44725 228 REFERENCE_TITLE_OPTIONS += -bottom '$(JAVADOC_BOTTOM)'
ihse@44725 229 ifeq ($(IS_DRAFT), true)
ihse@44725 230 REFERENCE_TITLE_OPTIONS += -top '$(JAVADOC_TOP)'
ihse@44725 231 endif
ihse@44725 232
ihse@44725 233 REFERENCE_VARDEPS := $(JAVADOC_OPTIONS) $(REFERENCE_TITLE_OPTIONS) $(JAVADOC_TAGS) \
ihse@44725 234 $(JAVADOC_MODULES) $(JAVADOC_SOURCE_PATH)
ihse@44725 235 REFERENCE_VARDEPS_FILE := $(call DependOnVariable, REFERENCE_VARDEPS, \
ihse@44725 236 $(SUPPORT_OUTPUTDIR)/docs/reference.vardeps)
ihse@44725 237
ihse@44725 238 # Javadoc creates a lot of files but use index.html as a marker.
ihse@44725 239 $(REFERENCE_TARGET_DIR)/index.html: $(BUILD_TOOLS_JDK) $(REFERENCE_VARDEPS_FILE) \
ihse@44725 240 $(JAVADOC_SOURCE_DEPS) $(REFERENCE_OVERVIEW)
ihse@44725 241 $(call LogWarn, Generating reference Javadoc for Java SE)
ihse@44725 242 $(call MakeDir, $(REFERENCE_TARGET_DIR))
ihse@44725 243 $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/docs/reference, \
ihse@44725 244 $(JAVA) -Djava.awt.headless=true \
ihse@44725 245 -DenableModuleGraph=$(ENABLE_MODULE_GRAPH) \
ihse@44725 246 $(NEW_JAVADOC) -d $(REFERENCE_TARGET_DIR) \
ihse@44725 247 $(JAVADOC_TAGS) $(JAVADOC_OPTIONS) $(JAVADOC_LOG_OPTION) \
ihse@44725 248 $(REFERENCE_TITLE_OPTIONS) -overview $(REFERENCE_OVERVIEW) \
ihse@44725 249 --module-source-path $(JAVADOC_SOURCE_PATH) \
ihse@44725 250 --module java.se.ee)
ihse@44725 251
ihse@44725 252 REFERENCE_TARGETS += $(REFERENCE_TARGET_DIR)/index.html
ohair@13697 253
ihse@41652 254 ################################################################################
ihse@44725 255 # Copy targets
ihse@41652 256
ihse@41652 257 JDWP_HTML := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
ihse@41652 258
ihse@41652 259 $(eval $(call SetupCopyFiles, COPY_JDWP_HTML, \
ihse@41652 260 FILES := $(JDWP_HTML), \
ihse@41652 261 DEST := $(JAVADOC_OUTPUTDIR)/platform/jpda/jdwp, \
ihse@41652 262 ))
ihse@41652 263
ihse@41652 264 COPY_TARGETS += $(COPY_JDWP_HTML)
ihse@41652 265
erikj@41260 266 # Pick jvmti.html from any jvm variant, they are all the same.
erikj@41260 267 JVMTI_HTML := $(firstword \
erikj@41260 268 $(wildcard $(HOTSPOT_OUTPUTDIR)/variant-*/gensrc/jvmtifiles/jvmti.html))
ohair@13697 269
erikj@41260 270 $(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
erikj@41260 271 FILES := $(JVMTI_HTML), \
ihse@41652 272 DEST := $(JAVADOC_OUTPUTDIR)/platform/jvmti, \
erikj@41260 273 ))
ohair@13697 274
ihse@41652 275 COPY_TARGETS += $(COPY_JVMTI_HTML)
ohair@13697 276
ihse@41652 277 ################################################################################
ihse@41652 278 # Optional target which bundles all generated javadocs into a zip archive.
neugens@37034 279
ihse@44725 280 JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
ihse@44725 281 JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
ihse@41652 282
ihse@44725 283 $(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
ihse@44725 284 SRC := $(JAVADOC_OUTPUTDIR), \
ihse@44725 285 ZIP := $(JAVADOC_ZIP_FILE), \
ihse@44725 286 EXTRA_DEPS := $(JAVADOC_TARGETS) $(COPY_TARGETS), \
ihse@44725 287 ))
neugens@37034 288
ihse@44725 289 ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
erikj@39384 290
erikj@39384 291 ################################################################################
mchung@44397 292 # generate .dot files for module graphs
mchung@44397 293
mchung@44397 294 JAVADOC_MODULE_GRAPHS_DIR := $(SUPPORT_OUTPUTDIR)/docs/module-graphs
mchung@44397 295 JAVADOC_MODULE_GRAPHS := $(JAVADOC_MODULE_GRAPHS_DIR)/java.se.dot
mchung@44397 296 JAVADOC_MODULE_GRAPHS_PROPS := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
mchung@44397 297
mchung@44397 298 $(JAVADOC_MODULE_GRAPHS): $(BUILD_JIGSAW_TOOLS) $(JAVADOC_MODULE_GRAPHS_PROPS)
mchung@44397 299 $(MKDIR) -p $(@D)
mchung@44397 300 $(TOOL_GENGRAPHS) --spec --output $(JAVADOC_MODULE_GRAPHS_DIR) \
mchung@44397 301 --dot-attributes $(JAVADOC_MODULE_GRAPHS_PROPS)
mchung@44397 302
mchung@44397 303 MODULE_GRAPH_TARGETS += $(JAVADOC_MODULE_GRAPHS)
mchung@44397 304
mchung@44397 305 ################################################################################
erikj@39384 306
ihse@41652 307 # Hook to include the corresponding custom file, if present.
ihse@41652 308 $(eval $(call IncludeCustomExtension, , Javadoc.gmk))
ihse@41652 309
ihse@41652 310 ################################################################################
ihse@41652 311
ihse@44725 312 docs-module-graphs: $(MODULE_GRAPH_TARGETS)
mchung@44397 313
ihse@44725 314 docs-javadoc: $(JAVADOC_TARGETS)
ihse@44725 315
ihse@44725 316 docs-reference: $(REFERENCE_TARGETS)
ihse@41652 317
ihse@41652 318 docs-copy: $(COPY_TARGETS)
ihse@41652 319
ihse@41652 320 docs-zip: $(ZIP_TARGETS)
ihse@41652 321
ihse@44725 322 all: docs-module-graphs docs-javadoc docs-reference docs-copy docs-zip
ihse@41652 323
ihse@44725 324 .PHONY: default all docs-module-graphs docs-javadoc docs-reference docs-copy docs-zip