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