Docs.gmk revision 2651:2c25fc241032
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# Index page text titles/snippets
173
174JDK_INDEX_TITLE := $(JAVA_PLATFORM), $(JDK_LONG_NAME) Specification $(DRAFT_MARKER_TITLE)
175
176################################################################################
177# Functions
178
179# Helper function for creating a png file from a dot file generated by the
180# GenGraphs tool.
181# param 1: SetupJavadocGeneration namespace ($1)
182# param 2: module name
183#
184define setup_gengraph_dot_to_png
185  $1_$2_DOT_SRC :=  $$($1_GENGRAPHS_DIR)/$2.dot
186  $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png
187
188    # For each module needing a graph, create a png file from the dot file
189    # generated by the GenGraphs tool and store it in the target dir.
190    $$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
191	$$(call MakeDir, $$(@D))
192	$$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
193	    $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
194
195  $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
196endef
197
198# Helper function to create the overview.html file to use with the -overview
199# javadoc option.
200# Returns the filename as $1_OVERVIEW.
201#
202# param 1: SetupJavadocGeneration namespace ($1)
203define create_overview_file
204  $1_OVERVIEW_TEXT := \
205      <!DOCTYPE html> \
206      <html><head></head><body> \
207      <p>This document is the API specification for $$($1_FULL_NAME).</p> \
208      #
209  ifneq ($$($1_GROUPS),)
210    $1_OVERVIEW_TEXT += \
211        <p>For an overview of the full specification, grouped by usage, see the <a href="../index.html">$$(JAVA_PLATFORM), $$($1_LONG_NAME) Specification</a>.</p> \
212        <dl> \
213        #
214    $1_OVERVIEW_TEXT += $$(foreach g, $$($1_GROUPS), \
215        <dt><a href="\#$$g">$$($$g_GROUP_NAME)</a></dt> \
216        <dd>$$($$g_GROUP_DESCRIPTION)</dt> \
217    )
218    $1_OVERVIEW_TEXT += \
219        </dl> \
220        #
221  endif
222  ifeq ($$(IS_DRAFT), true)
223    $1_OVERVIEW_TEXT += \
224        <p><strong>$$(DRAFT_TEXT)</strong></p> \
225        #
226  endif
227  $1_OVERVIEW_TEXT += \
228      </body></html> \
229      #
230
231  $1_OVERVIEW := $$(SUPPORT_OUTPUTDIR)/docs/$1-overview.html
232
233  $1_OVERVIEW_VARDEPS_FILE := $$(call DependOnVariable, $1_OVERVIEW_TEXT, \
234      $$($1_OVERVIEW).vardeps)
235
236  $$($1_OVERVIEW): $$($1_OVERVIEW_VARDEPS_FILE)
237	$$(call LogInfo, Creating overview.html for $1)
238	$$(call MakeDir, $$(@D))
239	$$(PRINTF) > $$@ '$$($1_OVERVIEW_TEXT)'
240endef
241
242################################################################################
243# Setup make rules to create an API documentation collection, using javadoc and
244# other tools if needed.
245#
246# Parameter 1 is the name of the rule. This name is used as variable prefix.
247# Targets generated are returned as $1_JAVADOC_TARGETS and
248# $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
249# file" for all the magnitude of files that are generated by javadoc.
250#
251# Remaining parameters are named arguments. These include:
252#   MODULES - Modules to generate javadoc for
253#   GROUPS - Name of the groups to divide the modules into, if any
254#   SHORT_NAME - The short name of this documentation collection
255#   LONG_NAME - The long name of this documentation collection
256#   TARGET_DIR - Where to store the output
257#
258SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
259define SetupApiDocsGenerationBody
260
261  # Figure out all modules, both specified and transitive indirect exports, that
262  # will be processed by javadoc.
263  $1_INDIRECT_EXPORTS := $$(call FindTransitiveIndirectDepsForModules, $$($1_MODULES))
264  $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_INDIRECT_EXPORTS))
265
266  ifeq ($$(ENABLE_FULL_DOCS), true)
267    # Tell the ModuleGraph taglet to generate html links to soon-to-be-created
268    # png files with module graphs.
269    $1_JAVA_ARGS += -DenableModuleGraph=true
270  endif
271
272  # Always include tags and basic options
273  $1_OPTIONS := $$(JAVADOC_TAGS) $$(JAVADOC_OPTIONS)
274
275  $1_OPTIONS += --module-source-path $$(MODULES_SOURCE_PATH)
276  $1_OPTIONS += --module $$(call CommaList, $$($1_MODULES))
277
278  # Create a string like "-Xdoclint:all,-syntax,-html,..."
279  $1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
280      $$(JAVADOC_DISABLED_DOCLINT)))
281
282  $1_FULL_NAME := $$(JAVA_PLATFORM), $$($1_LONG_NAME) \
283      $$(DRAFT_MARKER_TITLE)
284  $1_DOC_TITLE := $$($1_FULL_NAME)<br>API Specification
285  $1_WINDOW_TITLE := $$(subst &trade;,,$$(JAVA_PLATFORM) $$($1_SHORT_NAME)) \
286    $$(DRAFT_MARKER_TITLE)
287  $1_HEADER_TITLE := <strong>$$(JAVA_PLATFORM)<br>$$($1_SHORT_NAME)</strong> \
288      $$(DRAFT_MARKER_STR)
289
290  $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
291  $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)'
292  $1_OPTIONS += -header '$$($1_HEADER_TITLE)'
293  $1_OPTIONS += -bottom '$$(JAVADOC_BOTTOM)'
294  ifeq ($$(IS_DRAFT), true)
295    $1_OPTIONS += -top '$$(JAVADOC_TOP)'
296  endif
297
298  # Do not store debug level options in VARDEPS.
299  ifneq ($$(LOG_LEVEL), trace)
300    $1_LOG_OPTION += -quiet
301  else
302    $1_LOG_OPTION += -verbose
303  endif
304
305  # Generate the overview.html file. This will return the filename in
306  # $1_OVERVIEW.
307  $$(eval $$(call create_overview_file,$1))
308  $1_OPTIONS += -overview $$($1_OVERVIEW)
309
310  $$(foreach g, $$($1_GROUPS), \
311    $$(eval $1_OPTIONS += -group "$$($$g_GROUP_NAME)" "$$($$g_GROUP_MODULES)") \
312  )
313
314  $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
315      $$($1_ALL_MODULES)
316  $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
317      $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
318
319  # Get a list of all files in all the source dirs for all included modules
320  $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
321      $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
322
323  # Javadoc creates a lot of files but use index.html as a marker
324  $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
325      $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
326	$$(call LogWarn, Generating $1 javadoc for \
327	    $$(words $$($1_ALL_MODULES)) modules)
328	$$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
329	$$(call MakeDir, $$($1_TARGET_DIR))
330	$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
331	    $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
332	        $$(NEW_JAVADOC) -d $$($1_TARGET_DIR) \
333	        $$(JAVADOC_TAGS) $$($1_OPTIONS) $$($1_LOG_OPTION))
334
335  $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
336
337  ifeq ($$(ENABLE_FULL_DOCS), true)
338    # We have asked ModuleGraph to generate links to png files. Now we must
339    # produce the png files.
340
341    # Locate which modules has the @moduleGraph tag in their module-info.java
342    $1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
343      $$(if $$(shell $$(GREP) -e @moduleGraph \
344          $$(wildcard $$(addsuffix /module-info.java, \
345          $$(call FindModuleSrcDirs, $$m)))), \
346        $$m) \
347    ))
348
349    # First we run the GenGraph tool. It will query the module structure of the
350    # running JVM and output .dot files for all existing modules.
351    GENGRAPHS_PROPS := \
352        $$(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
353
354    $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
355    $1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
356
357    $$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
358	$$(call LogInfo, Running gengraphs for $1 documentation)
359	$$(call MakeDir, $$($1_GENGRAPHS_DIR))
360	$$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
361	    $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
362	    --dot-attributes $$(GENGRAPHS_PROPS) && \
363	    $$(TOUCH) $$($1_GENGRAPHS_MARKER))
364
365    # For each module needing a graph, create a png file from the dot file
366    # generated by the GenGraphs tool and store it in the target dir.
367    # They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
368    $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
369      $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
370    )
371  endif
372endef
373
374################################################################################
375# Setup generation of the JDK API documentation (javadoc + modulegraph)
376
377# Define the groups of the JDK API documentation
378JavaSE_GROUP_NAME := Java SE
379JavaSE_GROUP_MODULES := $(call ColonList, $(sort java.se.ee \
380    $(call FindTransitiveIndirectDepsForModules, java.se.ee)))
381JavaSE_GROUP_DESCRIPTION := \
382    The Java Platform, Standard Edition ("Java SE") APIs define the core Java \
383    platform for general-purpose computing. These APIs are in modules with \
384    names starting with the string "java.". \
385    #
386JDK_GROUPS += JavaSE
387
388JDK_GROUP_NAME := JDK
389JDK_GROUP_MODULES := jdk.*
390JDK_GROUP_DESCRIPTION := \
391    The Java Development Kit ("JDK") APIs define an implementation of the Java \
392    SE Platform which may include platform-specific details. These APIs are in \
393    modules with names starting with the string "jdk.". \
394    #
395JDK_GROUPS += JDK
396
397# If we are importing JavaFX, we need a JavaFX group. In an ideal world, this
398# would have been abstracted away to a more proper generic handling of imported
399# modules.
400ifneq ($(findstring javafx., $(IMPORTED_MODULES)), )
401  JavaFX_GROUP_NAME := JavaFX
402  JavaFX_GROUP_MODULES := javafx.*
403  JavaFX_GROUP_DESCRIPTION := \
404      The JavaFX APIs define a set of user interface (UI) controls, graphics, \
405      media, and web packages for developing rich client applications. These \
406      APIs are in modules with names starting with the string "javafx.". \
407      #
408  JDK_GROUPS += JavaFX
409endif
410
411# All modules to have docs generated by docs-jdk-api target
412JDK_MODULES := $(sort $(DOCS_MODULES))
413
414$(eval $(call SetupApiDocsGeneration, JDK_API, \
415    MODULES := $(JDK_MODULES), \
416    GROUPS := $(JDK_GROUPS), \
417    SHORT_NAME := $(JDK_SHORT_NAME), \
418    LONG_NAME := $(JDK_LONG_NAME), \
419    TARGET_DIR := $(DOCS_OUTPUTDIR)/api, \
420))
421
422# Targets generated are returned in JDK_API_JAVADOC_TARGETS and
423# JDK_API_MODULEGRAPH_TARGETS.
424
425################################################################################
426# Setup generation of the Java SE API documentation (javadoc + modulegraph)
427
428# The Java SE module scope is just java.se.ee and it's transitive indirect
429# exports.
430JAVASE_MODULES := java.se.ee
431
432$(eval $(call SetupApiDocsGeneration, JAVASE_API, \
433    MODULES := $(JAVASE_MODULES), \
434    SHORT_NAME := $(JAVASE_SHORT_NAME), \
435    LONG_NAME := $(JAVASE_LONG_NAME), \
436    TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
437))
438
439# Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
440# JAVASE_API_MODULEGRAPH_TARGETS.
441
442################################################################################
443
444JDK_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
445JDK_INDEX_TOOLS_DIR := $(TOOLS_CLASSES_DIR)/build/tools/docs
446
447$(JDK_INDEX_HTML): $(BUILD_JIGSAW_TOOLS) \
448    $(JDK_INDEX_TOOLS_DIR)/docs-bundle-page.html  \
449    $(JDK_INDEX_TOOLS_DIR)/docs-module-groups.properties
450	$(call LogInfo, Generating docs bundle index page)
451	$(MKDIR) -p $(@D)
452	$(TOOL_GEN_DOCS_BUNDLE_PAGE) --title '$(JDK_INDEX_TITLE)' \
453		--output $@
454
455JDK_INDEX_TARGETS := $(JDK_INDEX_HTML)
456
457# Copy the global resources
458GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/
459$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
460    SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
461    FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
462    DEST := $(DOCS_OUTPUTDIR), \
463))
464JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
465
466################################################################################
467# Copy JDK specs files
468
469# For all html documentation in $module/share/specs directories, copy it
470# unmodified
471
472ALL_MODULES := $(call FindAllModules)
473COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
474
475$(foreach m, $(ALL_MODULES), \
476  $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
477  $(foreach d, $(SPECS_$m), \
478    $(if $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
479      $(eval $(call SetupCopyFiles, COPY_$m, \
480          SRC := $d, \
481          FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
482          DEST := $(DOCS_OUTPUTDIR)/specs/, \
483      )) \
484      $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
485    ) \
486  ) \
487)
488
489ifeq ($(ENABLE_FULL_DOCS), true)
490  # For all markdown files in $module/share/specs directories, convert them to
491  # html.
492
493  GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
494
495  $(foreach m, $(ALL_MODULES), \
496    $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
497    $(foreach d, $(SPECS_$m), \
498      $(if $(filter %.md, $(call CacheFind, $d)), \
499        $(eval $(call SetupProcessMarkdown, CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d), \
500            SRC := $d, \
501            FILES := $(filter %.md, $(call CacheFind, $d)), \
502            DEST := $(DOCS_OUTPUTDIR)/specs/, \
503            CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
504        )) \
505      ) \
506      $(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d))) \
507    ) \
508  )
509endif
510
511# Special treatment for generated documentation
512
513JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
514$(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
515    FILES := $(JDWP_PROTOCOL), \
516    DEST := $(DOCS_OUTPUTDIR)/specs/jdwp, \
517))
518JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
519
520# Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
521JVMTI_HTML := $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
522$(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
523    FILES := $(JVMTI_HTML), \
524    DEST := $(DOCS_OUTPUTDIR)/specs, \
525))
526JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
527
528################################################################################
529# Optional target which bundles all generated javadocs into a zip archive.
530
531JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
532JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
533
534$(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
535    SRC := $(DOCS_OUTPUTDIR), \
536    ZIP := $(JAVADOC_ZIP_FILE), \
537    EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
538        $(JDK_SPECS_TARGETS), \
539))
540
541ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
542
543################################################################################
544
545docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS) $(JDK_API_CUSTOM_TARGETS)
546
547docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
548
549docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS) $(JAVASE_API_CUSTOM_TARGETS)
550
551docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
552
553docs-jdk-specs: $(JDK_SPECS_TARGETS)
554
555docs-jdk-index: $(JDK_INDEX_TARGETS)
556
557docs-zip: $(ZIP_TARGETS)
558
559all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
560    docs-javase-api-modulegraph docs-jdk-specs docs-jdk-index docs-zip
561
562.PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
563    docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs \
564    docs-jdk-index docs-zip
565