make/Javadoc.gmk
changeset 46218 3850de6acd8e
parent 46202 6221728aa15e
parent 44990 db3606f423a3
equal deleted inserted replaced
46217:191008ef907f 46218:3850de6acd8e
    24 
    24 
    25 default: all
    25 default: all
    26 
    26 
    27 include $(SPEC)
    27 include $(SPEC)
    28 include MakeBase.gmk
    28 include MakeBase.gmk
       
    29 include Modules.gmk
       
    30 include ProcessMarkdown.gmk
       
    31 include ZipArchive.gmk
    29 include $(JDK_TOPDIR)/make/Tools.gmk
    32 include $(JDK_TOPDIR)/make/Tools.gmk
    30 include $(JDK_TOPDIR)/make/ModuleTools.gmk
    33 include $(JDK_TOPDIR)/make/ModuleTools.gmk
    31 
    34 
    32 ################################################################################
    35 # This is needed to properly setup DOCS_MODULES.
    33 
    36 $(eval $(call ReadImportMetaData))
    34 # List of all possible directories for javadoc to look for sources
    37 
    35 # Allow custom to overwrite.
    38 ################################################################################
    36 JAVADOC_SOURCE_DIRS = \
    39 
    37       $(SUPPORT_OUTPUTDIR)/gensrc/* \
    40 # Hook to include the corresponding custom file, if present.
    38       $(addsuffix /*, $(IMPORT_MODULES_SRC)) \
    41 $(eval $(call IncludeCustomExtension, , Javadoc.gmk))
    39       $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
    42 
    40       $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_TYPE)/classes \
    43 ################################################################################
    41       $(JDK_TOPDIR)/src/*/share/classes \
    44 # Javadoc settings
    42       $(HOTSPOT_TOPDIR)/src/*/share/classes \
    45 
    43       $(LANGTOOLS_TOPDIR)/src/*/share/classes \
    46 # On top of the sources that was used to compile the JDK, we need some
    44       $(NASHORN_TOPDIR)/src/*/share/classes \
    47 # extra java.rmi sources that are used just for javadoc.
    45       $(CORBA_TOPDIR)/src/*/share/classes \
    48 MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
    46       $(JAXP_TOPDIR)/src/*/share/classes \
    49     $(SUPPORT_OUTPUTDIR)/rmic/* $(JDK_TOPDIR)/src/*/share/doc/stub)
    47       $(JAXWS_TOPDIR)/src/*/share/classes \
       
    48       $(SUPPORT_OUTPUTDIR)/rmic/* \
       
    49       $(JDK_TOPDIR)/src/*/share/doc/stub \
       
    50       #
       
    51 
    50 
    52 # Should we use -Xdocrootparent? Allow custom to overwrite.
    51 # Should we use -Xdocrootparent? Allow custom to overwrite.
    53 DOCROOTPARENT_FLAG = TRUE
    52 DOCROOTPARENT_FLAG ?= TRUE
    54 
    53 
    55 # URLs
    54 # URLs
    56 JAVADOC_BASE_URL := http://docs.oracle.com/javase/$(VERSION_SPECIFICATION)/docs
    55 JAVADOC_BASE_URL := http://www.oracle.com/pls/topic/lookup?ctx=javase9&id=homepage
    57 BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
    56 BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
    58 
    57 COPYRIGHT_URL := {@docroot}/../legal/cpyr.html
    59 ################################################################################
    58 LICENSE_URL := http://www.oracle.com/technetwork/java/javase/terms/license/java9speclicense.html
    60 # Text snippets
    59 REDISTRIBUTION_URL := http://www.oracle.com/technetwork/java/redist-137594.html
    61 
    60 
    62 FULL_COMPANY_NAME := Oracle and/or its affiliates
       
    63 COMPANY_ADDRESS := 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA
       
    64 BUG_SUBMIT_LINE := <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a>
       
    65 
       
    66 COMMON_BOTTOM_TEXT := $(BUG_SUBMIT_LINE)<br> Java is a trademark or registered \
       
    67     trademark of $(FULL_COMPANY_NAME) in the US and other countries.
       
    68 
       
    69 CORE_BOTTOM_COPYRIGHT_URL := {@docroot}/../legal/cpyr.html
       
    70 CORE_BOTTOM_TEXT := \
       
    71     $(BUG_SUBMIT_LINE) \
       
    72     <br>For further API reference and developer documentation, see \
       
    73     <a href="$(JAVADOC_BASE_URL)/index.html" target="_blank">Java SE \
       
    74     Documentation</a>. That documentation contains more detailed, \
       
    75     developer-targeted descriptions, with conceptual overviews, definitions of \
       
    76     terms, workarounds, and working code examples.
       
    77 
       
    78 ifeq ($(VERSION_IS_GA), true)
       
    79   DRAFT_MARKER :=
       
    80   DRAFT_WINDOW_TITLE_MARKER :=
       
    81   EARLYACCESS_TOP :=
       
    82 else
       
    83   # We need a draft format when not building the GA version.
       
    84   DRAFT_MARKER := <br><strong>DRAFT&nbsp;$(VERSION_STRING)</strong>
       
    85   ifeq ($(VERSION_BUILD), 0)
       
    86     DRAFT_WINDOW_TITLE_MARKER := $(SPACE)[ad-hoc build]
       
    87   else
       
    88     DRAFT_WINDOW_TITLE_MARKER := $(SPACE)[build $(VERSION_BUILD)]
       
    89   endif
       
    90   EARLYACCESS_TOP := \
       
    91       <div style="background-color: $(HASH)EEEEEE"><div style="padding: 6px; \
       
    92       margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: \
       
    93       6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, \
       
    94       sans-serif; font-weight: normal;">Please note that the specifications \
       
    95       and other information contained herein are not final and are subject to \
       
    96       change. The information is being made available to you solely for \
       
    97       purpose of evaluation.</div></div>
       
    98 endif
       
    99 
       
   100 ################################################################################
       
   101 # Special treatment for the core package list. All separate "small" javadoc
       
   102 # invocation needs to be able to see the core package list.
       
   103 
       
   104 ALL_PKG_DIRS := $(dir $(filter %.java, $(call CacheFind, \
       
   105     $(wildcard $(JAVADOC_SOURCE_DIRS)))))
       
   106 ALL_SRC_PREFIXES := $(addsuffix /%, $(wildcard $(JAVADOC_SOURCE_DIRS)))
       
   107 ALL_PKG_DIRNAMES := $(foreach prefix, $(ALL_SRC_PREFIXES), \
       
   108     $(patsubst $(prefix),%, $(filter $(prefix), $(ALL_PKG_DIRS))))
       
   109 ALL_PACKAGES := $(sort $(subst /,., $(patsubst %/, %, $(ALL_PKG_DIRNAMES))))
       
   110 
       
   111 # Core packages are all packages beginning with java, javax or org, except a few
       
   112 # excludes.
       
   113 JAVA_PACKAGES := $(filter java.%, $(ALL_PACKAGES))
       
   114 JAVAX_PACKAGES := $(filter javax.%, $(ALL_PACKAGES))
       
   115 ORG_PACKAGES := $(filter org.%, $(ALL_PACKAGES))
       
   116 
       
   117 # Allow custom makefile to add more excluded packages
       
   118 CORE_EXCLUDED_PACKAGES += \
       
   119     java.awt.dnd.peer \
       
   120     java.awt.peer \
       
   121     javax.smartcardio \
       
   122     org.jcp.xml.dsig.internal% \
       
   123     org.w3c.dom.css \
       
   124     org.w3c.dom.html \
       
   125     org.w3c.dom.stylesheets \
       
   126     org.w3c.dom.xpath \
       
   127     org.graalvm.compiler.% \
       
   128     org.graalvm.util% \
       
   129     #
       
   130 
       
   131 CORE_PACKAGES := $(filter-out $(CORE_EXCLUDED_PACKAGES), \
       
   132     $(JAVA_PACKAGES) $(JAVAX_PACKAGES) $(ORG_PACKAGES))
       
   133 
       
   134 CORE_PACKAGES_LIST_DIR := $(SUPPORT_OUTPUTDIR)/docs/core-packages
       
   135 CORE_PACKAGES_LIST_FILE := $(CORE_PACKAGES_LIST_DIR)/package-list
       
   136 
       
   137 CORE_PACKAGES_VARDEPS_FILE := $(call DependOnVariable, CORE_PACKAGES, \
       
   138     $(CORE_PACKAGES_LIST_FILE).vardeps)
       
   139 
       
   140 $(CORE_PACKAGES_LIST_FILE): $(CORE_PACKAGES_VARDEPS_FILE)
       
   141 	$(call MakeDir, $(@D))
       
   142 	$(eval $(call ListPathsSafely, CORE_PACKAGES, $@))
       
   143 
       
   144 ################################################################################
       
   145 # Support functions for SetupJavadocGeneration
       
   146 
       
   147 # Generate the text used in the -bottom argument.
       
   148 # Note that COPYRIGHT_YEAR is the current year (from spec.gmk)
       
   149 # Arguments:
       
   150 # arg 1: first copyright year
       
   151 # arg 2: copyright url (optional)
       
   152 # arg 3: free-form text snippet (optional)
       
   153 define GenerateBottom
       
   154   <span style="font-size:smaller">$(if $(strip $3), $(strip $3))<br> $(if \
       
   155       $(strip $2),<a href="$(strip $2)">Copyright</a>,Copyright) \
       
   156       &copy; $(strip $1), $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
       
   157       $(COMPANY_ADDRESS). All rights reserved.</span>
       
   158 endef
       
   159 
       
   160 # Speed up finding by filling cache
       
   161 $(eval $(call FillCacheFind, $(wildcard $(JAVADOC_SOURCE_DIRS))))
       
   162 
    61 
   163 # In order to get a specific ordering it's necessary to specify the total
    62 # In order to get a specific ordering it's necessary to specify the total
   164 # ordering of tags as the tags are otherwise ordered in order of definition.
    63 # ordering of tags as the tags are otherwise ordered in order of definition.
   165 DEFAULT_JAVADOC_TAGS := \
    64 JAVADOC_TAGS := \
   166     -tag beaninfo:X \
    65     -tag beaninfo:X \
   167     -tag revised:X \
    66     -tag revised:X \
   168     -tag since.unbundled:X \
    67     -tag since.unbundled:X \
   169     -tag spec:X \
    68     -tag spec:X \
   170     -tag specdefault:X \
    69     -tag specdefault:X \
   182     -tag serialData \
    81     -tag serialData \
   183     -tag factory \
    82     -tag factory \
   184     -tag see \
    83     -tag see \
   185     -tag 'jvms:a:See <cite>The Java&trade; Virtual Machine Specification</cite>:' \
    84     -tag 'jvms:a:See <cite>The Java&trade; Virtual Machine Specification</cite>:' \
   186     -tag 'jls:a:See <cite>The Java&trade; Language Specification</cite>:' \
    85     -tag 'jls:a:See <cite>The Java&trade; Language Specification</cite>:' \
       
    86     -taglet build.tools.taglet.ExtLink \
   187     -taglet build.tools.taglet.Incubating \
    87     -taglet build.tools.taglet.Incubating \
   188     -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
    88     -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
       
    89     $(CUSTOM_JAVADOC_TAGS) \
   189     #
    90     #
   190 
    91 
   191 DEFAULT_JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
    92 # Which doclint checks to ignore
   192     -serialwarn -encoding ISO-8859-1 -breakiterator --system none
    93 JAVADOC_DISABLED_DOCLINT := accessibility html missing syntax reference
   193 
    94 
   194 #
    95 # The initial set of options for javadoc
   195 # TODO: this should be set by the configure option.
    96 JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
   196 #
    97     -serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
   197 ifndef ENABLE_MODULE_GRAPH
    98     -html5 -javafx --expand-requires transitive
   198    ENABLE_MODULE_GRAPH=false
    99 
       
   100 # Should we add DRAFT stamps to the generated javadoc?
       
   101 ifeq ($(VERSION_IS_GA), true)
       
   102   IS_DRAFT := false
       
   103 else
       
   104   IS_DRAFT := true
   199 endif
   105 endif
   200 
   106 
   201 ################################################################################
   107 ################################################################################
   202 # Setup make rules for running javadoc.
   108 # General text snippets
   203 #
   109 
   204 # Parameter 1 is the name of the rule. This name is used as variable prefix,
   110 FULL_COMPANY_NAME := Oracle and/or its affiliates
   205 # and the targets generated are listed in a variable by that name. Note that
   111 COMPANY_ADDRESS := 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA
   206 # the index.html file will work as a "touch file" for all the magnitude of
   112 
   207 # files that are generated by javadoc.
   113 ifeq ($(IS_DRAFT), true)
       
   114   DRAFT_MARKER_STR := <br><strong>DRAFT $(VERSION_STRING)</strong>
       
   115   ifeq ($(VERSION_BUILD), 0)
       
   116     DRAFT_MARKER_TITLE := [ad-hoc build]
       
   117   else
       
   118     DRAFT_MARKER_TITLE := [build $(VERSION_BUILD)]
       
   119   endif
       
   120 endif
       
   121 
       
   122 JAVADOC_WINDOW_TITLE := Java Platform SE $(VERSION_SPECIFICATION) \
       
   123     $(DRAFT_MARKER_TITLE)
       
   124 
       
   125 JAVADOC_HEADER_TITLE := $(subst $(SPACE),&nbsp;,$(strip \
       
   126     <strong>Java&trade; Platform<br>Standard Ed. \
       
   127     $(VERSION_SPECIFICATION)</strong>$(DRAFT_MARKER_STR)))
       
   128 
       
   129 JAVADOC_BOTTOM := \
       
   130     <span style="font-size:smaller"> \
       
   131     <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a><br> \
       
   132     For further API reference and developer documentation, see \
       
   133     <a href="$(JAVADOC_BASE_URL)/index.html" target="_blank">Java SE \
       
   134     Documentation</a>. That documentation contains more detailed, \
       
   135     developer-targeted descriptions, with conceptual overviews, definitions \
       
   136     of terms, workarounds, and working code examples.<br> \
       
   137     Java is a trademark or registered trademark of $(FULL_COMPANY_NAME) in \
       
   138     the US and other countries.<br> \
       
   139     <a href="$(COPYRIGHT_URL)">Copyright</a> \
       
   140     &copy; 1993, $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
       
   141     $(COMPANY_ADDRESS). All rights reserved. \
       
   142     Use is subject to <a href="$(LICENSE_URL)">license terms</a>. Also see the \
       
   143     <a href="$(REDISTRIBUTION_URL)">documentation redistribution policy</a>. \
       
   144     $(DRAFT_MARKER_STR)</span>
       
   145 
       
   146 JAVADOC_TOP := \
       
   147     <div style="background-color: $(HASH)EEEEEE"><div style="padding: 6px; \
       
   148     margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: \
       
   149     6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, \
       
   150     sans-serif; font-weight: normal;">Please note that the specifications \
       
   151     and other information contained herein are not final and are subject to \
       
   152     change. The information is being made available to you solely for \
       
   153     purpose of evaluation.</div></div>
       
   154 
       
   155 ################################################################################
       
   156 # JDK javadoc titles/text snippets
       
   157 
       
   158 JDK_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition Development Kit \
       
   159     (JDK&trade;) $(VERSION_SPECIFICATION)<br>API Specification
       
   160 
       
   161 ################################################################################
       
   162 # Java SE javadoc titles/text snippets
       
   163 
       
   164 JAVASE_JAVADOC_DOC_TITLE := Java&trade; Platform, Standard Edition \
       
   165     $(VERSION_SPECIFICATION)<br>API Specification
       
   166 
       
   167 ################################################################################
       
   168 # Functions
       
   169 
       
   170 # Helper function for creating a png file from a dot file generated by the
       
   171 # GenGraphs tool.
       
   172 # param 1: SetupJavadocGeneration namespace ($1)
       
   173 # param 2: module name
       
   174 #
       
   175 define setup_gengraph_dot_to_png
       
   176   $1_$2_DOT_SRC :=  $$($1_GENGRAPHS_DIR)/$2.dot
       
   177   $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2-graph.png
       
   178 
       
   179     # For each module needing a graph, create a png file from the dot file
       
   180     # generated by the GenGraphs tool and store it in the target dir.
       
   181     $$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
       
   182 	$$(call MakeDir, $$(@D))
       
   183 	$$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
       
   184 	    $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
       
   185 
       
   186   $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
       
   187 endef
       
   188 
       
   189 ################################################################################
       
   190 # Setup make rules for creating the API documentation, using javadoc and other
       
   191 # tools if needed.
       
   192 #
       
   193 # Parameter 1 is the name of the rule. This name is used as variable prefix.
       
   194 # Targets generated are returned as $1_JAVADOC_TARGETS and
       
   195 # $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
       
   196 # file" for all the magnitude of files that are generated by javadoc.
   208 #
   197 #
   209 # Remaining parameters are named arguments. These include:
   198 # Remaining parameters are named arguments. These include:
   210 #   MODULES - Modules to include
   199 #   MODULES - Modules to generate javadoc for
   211 #   PACKAGES - Packages to include
   200 #   NAME - The name of the javadoc compilation, to be presented to the user
   212 #   IS_CORE - Set to TRUE for the Core API package which needs special treatment
   201 #   TARGET_DIR - Where to store the output
   213 #   API_ROOT - Where to base the documentation (jre or jdk)
   202 #   OVERVIEW - Path to an html overview file
   214 #   DEST_DIR - A directory relative to the API root
   203 #   DOC_TITLE - Title to use in -doctitle.
   215 #   OVERVIEW - Path to a html overview file
   204 #   WINDOW_TITLE - Title to use in -windowtitle.
   216 #   TITLE - Default title to use for the more specific versions below
   205 #   HEADER_TITLE - Title to use in -header.
   217 #   WINDOW_TITLE - Title to use in -windowtitle. Computed from TITLE if empty.
   206 #   BOTTOM_TEXT - Text to use in -bottom.
   218 #   HEADER_TITLE - Title to use in -header. Computed from TITLE if empty.
   207 #   TOP_TEXT - Text to use in -top.
   219 #   DOC_TITLE - Title to use in -doctitle. Computed from TITLE if empty.
   208 #
   220 #   FIRST_COPYRIGHT_YEAR - First year this bundle was introduced
   209 SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
   221 #   DISABLED_DOCLINT - Doclint warnings to exclude.
   210 define SetupApiDocsGenerationBody
   222 #   DOCLINT_PACKAGES - Optional -Xdoclint/package value
   211 
   223 #   SPLIT_INDEX - Enable -splitIndex (split index-all.html if it is too large)
   212   # Figure out all modules, both specified and transitive, that will be processed
   224 #   BOTTOM_COPYRIGHT_URL - Copyright URL to use in -bottom
   213   # by javadoc.
   225 #   BOTTOM_TEXT - Extra text to use in -bottom
   214   $1_TRANSITIVE_MODULES := $$(call FindTransitiveDepsForModules, $$($1_MODULES))
   226 #   EXTRA_TOP - Additional -top data
   215   $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_TRANSITIVE_MODULES))
   227 #
   216 
   228 SetupJavadocGeneration = $(NamedParamsMacroTemplate)
   217   ifeq ($$(ENABLE_FULL_DOCS), true)
   229 define SetupJavadocGenerationBody
   218     # Tell the ModuleGraph taglet to generate html links to soon-to-be-created
   230   ifeq ($$($1_IS_CORE), TRUE)
   219     # png files with module graphs.
   231     $1_JAVA := $$(JAVA)
   220     $1_JAVA_ARGS += -DenableModuleGraph=true
   232     $1_OUTPUT_DIRNAME := api
   221   endif
   233   else
   222 
   234     $1_JAVA := $$(JAVA_SMALL)
   223   # Always include tags and basic options
   235     $1_OUTPUT_DIRNAME := $$($1_API_ROOT)/api/$$($1_DEST_DIR)
   224   $1_OPTIONS := $$(JAVADOC_TAGS) $$(JAVADOC_OPTIONS)
   236 
   225 
   237     # Compute a relative path to core root.
   226   $1_OPTIONS += -overview $$($1_OVERVIEW)
   238     # The non-core api javadocs need to be able to access the root of the core
   227   $1_OPTIONS += --module-source-path $$(MODULES_SOURCE_PATH)
   239     # api directory, so for jdk/api or jre/api to get to the core api/
   228   $1_OPTIONS += --module $$(call CommaList, $$($1_MODULES))
   240     # directory we would use this
   229 
   241     $1_RELATIVE_CORE_DIR := $$(call DirToDotDot, $$($1_OUTPUT_DIRNAME))/api
   230   # Create a string like "-Xdoclint:all,-syntax,-html,..."
   242 
   231   $1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
   243     # We need to tell javadoc the directory in which to find the core package-list
   232       $$(JAVADOC_DISABLED_DOCLINT)))
   244     $1_OPTIONS += -linkoffline $$($1_RELATIVE_CORE_DIR) $$(CORE_PACKAGES_LIST_DIR)
   233 
   245 
   234   ifeq ($$($$DOCROOTPARENT_FLAG), TRUE)
   246     $1_DEPS += $(CORE_PACKAGES_LIST_FILE)
   235     $1_OPTIONS += -Xdocrootparent $$(JAVADOC_BASE_URL)
   247   endif
   236   endif
   248 
   237 
   249   $1_OPTIONS += --add-modules $$(call CommaList, $$($1_MODULES))
       
   250 
       
   251   ifneq ($$($1_DISABLED_DOCLINT), )
       
   252     # Create a string like ",-syntax,-html"
       
   253     $1_DOCLINT_EXCEPTIONS := ,$$(call CommaList, $$(addprefix -, $$($1_DISABLED_DOCLINT)))
       
   254   endif
       
   255   $1_OPTIONS += -Xdoclint:all$$($1_DOCLINT_EXCEPTIONS)
       
   256 
       
   257   ifneq ($$($1_DOCLINT_PACKAGES), )
       
   258     $1_OPTIONS += -Xdoclint/package:$$(call CommaList, $$($1_DOCLINT_PACKAGES))
       
   259   endif
       
   260 
       
   261   ifeq ($$($1_DOC_TITLE), )
       
   262     $1_DOC_TITLE := $$($1_TITLE)
       
   263   endif
       
   264   $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
   238   $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
   265 
   239   $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)'
   266   ifeq ($$($1_WINDOW_TITLE), )
   240   $1_OPTIONS += -header '$$($1_HEADER_TITLE)'
   267     $1_WINDOW_TITLE := $$(strip $$(subst &trade;,, $$($1_TITLE)))
   241   $1_OPTIONS += -bottom '$$($1_BOTTOM_TEXT)'
   268   endif
   242   ifeq ($$(IS_DRAFT), true)
   269   $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)$$(DRAFT_WINDOW_TITLE_MARKER)'
   243     $1_OPTIONS += -top '$$($1_TOP_TEXT)'
   270 
   244   endif
   271   ifeq ($$($1_HEADER_TITLE), )
       
   272     $1_HEADER_TITLE := $$(strip $$(subst &trade;,, $$($1_TITLE)))
       
   273   endif
       
   274   $1_OPTIONS += -header '<strong>$$($1_HEADER_TITLE)</strong>$$(DRAFT_MARKER)'
       
   275 
       
   276   ifneq ($$($1_EXTRA_TOP), )
       
   277     $1_OPTIONS += -top '$$($1_EXTRA_TOP)'
       
   278   endif
       
   279 
       
   280   ifeq ($$($1_BOTTOM_TEXT), )
       
   281     $1_BOTTOM_TEXT := $(COMMON_BOTTOM_TEXT)
       
   282   endif
       
   283   $1_BOTTOM := $$(call GenerateBottom, $$($1_FIRST_COPYRIGHT_YEAR), \
       
   284       $$($1_BOTTOM_COPYRIGHT_URL), $$($1_BOTTOM_TEXT))
       
   285   $1_OPTIONS += -bottom '$$($1_BOTTOM)$$(DRAFT_MARKER)'
       
   286 
       
   287   ifneq ($$($1_OVERVIEW), )
       
   288     $1_OPTIONS += -overview $$($1_OVERVIEW)
       
   289     $1_DEPS +=  $$($1_OVERVIEW)
       
   290   endif
       
   291 
       
   292   ifneq ($$($1_SPLIT_INDEX), )
       
   293     $1_OPTIONS += -splitIndex
       
   294   endif
       
   295 
       
   296   ifneq ($$($DOCROOTPARENT_FLAG), )
       
   297     $1_OPTIONS += -Xdocrootparent $(JAVADOC_BASE_URL)
       
   298   endif
       
   299 
       
   300   $1_VARDEPS := $$($1_OPTIONS) $$($1_PACKAGES)
       
   301   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
       
   302        $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
       
   303 
   245 
   304   # Do not store debug level options in VARDEPS.
   246   # Do not store debug level options in VARDEPS.
   305   ifneq ($$(LOG_LEVEL), trace)
   247   ifneq ($$(LOG_LEVEL), trace)
   306     $1_OPTIONS += -quiet
   248     $1_LOG_OPTION += -quiet
   307   else
   249   else
   308     $1_OPTIONS += -verbose
   250     $1_LOG_OPTION += -verbose
   309   endif
   251   endif
   310 
   252 
   311   $1_PACKAGE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach p, \
   253   $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
   312       $$(subst .,/,$$(strip $$($1_PACKAGES))), \
   254       $$($1_ALL_MODULES)
   313       $$(addsuffix /$$p, $$(wildcard $$(JAVADOC_SOURCE_DIRS))))))
   255   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
   314 
   256       $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
   315   # If there are many packages, use an @-file...
   257 
   316   ifneq ($$(word 17, $$($1_PACKAGES)), )
   258   # Get a list of all files in all the source dirs for all included modules
   317     $1_PACKAGES_FILE := $$(SUPPORT_OUTPUTDIR)/docs/$1.packages
   259   $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
   318     $1_PACKAGES_ARG := @$$($1_PACKAGES_FILE)
   260       $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
   319   else
   261 
   320     $1_PACKAGES_ARG := $$($1_PACKAGES)
   262   # Javadoc creates a lot of files but use index.html as a marker
   321   endif
   263   $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
   322 
   264       $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
   323   # The index.html which is a marker for all the output from javadoc.
   265 	$$(call LogWarn, Generating $$($1_NAME) API javadoc for \
   324   $1_INDEX_FILE := $$(JAVADOC_OUTPUTDIR)/$$($1_OUTPUT_DIRNAME)/index.html
   266 	    $$(words $$($1_ALL_MODULES)) modules)
   325 
   267 	$$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
   326   # Rule for actually running javadoc
   268 	$$(call MakeDir, $$($1_TARGET_DIR))
   327   $$($1_INDEX_FILE): $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) $$($1_PACKAGE_DEPS) $$($1_DEPS)
   269 	$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
   328 	$$(call LogWarn, Generating Javadoc from $$(words $$($1_PACKAGES)) package(s) for $$($1_OUTPUT_DIRNAME))
   270 	    $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
   329 	$$(call MakeDir, $$(@D))
   271 	        $$(NEW_JAVADOC) -d $$($1_TARGET_DIR) \
   330         ifneq ($$($1_PACKAGES_FILE), )
   272 	        $$(JAVADOC_TAGS) $$($1_OPTIONS) $$($1_LOG_OPTION))
   331 	  $$(eval $$(call ListPathsSafely, $1_PACKAGES, $$($1_PACKAGES_FILE)))
   273 
   332         endif
   274   $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
   333 	$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1.javadoc, \
   275 
   334 	    $$($1_JAVA) -Djava.awt.headless=true -DenableModuleGraph=$(ENABLE_MODULE_GRAPH) \
   276   ifeq ($$(ENABLE_FULL_DOCS), true)
   335 		$(NEW_JAVADOC) -d $$(@D) \
   277     # We have asked ModuleGraph to generate links to png files. Now we must
   336 	        $$(DEFAULT_JAVADOC_TAGS) $$(DEFAULT_JAVADOC_OPTIONS) \
   278     # produce the png files.
   337 	        --module-source-path $$(call PathList, $$(JAVADOC_SOURCE_DIRS)) \
   279 
   338 	        $$($1_OPTIONS) $$($1_PACKAGES_ARG))
   280     # Locate which modules has the @moduleGraph tag in their module-info.java
   339 
   281     $1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
   340   # The output returned will be the index.html file
   282       $$(if $$(shell $$(GREP) -e @moduleGraph \
   341   $1 := $$($1_INDEX_FILE)
   283           $$(wildcard $$(addsuffix /module-info.java, \
       
   284           $$(call FindModuleSrcDirs, $$m)))), \
       
   285         $$m) \
       
   286     ))
       
   287 
       
   288     # First we run the GenGraph tool. It will query the module structure of the
       
   289     # running JVM and output .dot files for all existing modules.
       
   290     GENGRAPHS_PROPS := \
       
   291         $$(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
       
   292 
       
   293     $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
       
   294     $1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
       
   295 
       
   296     $$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
       
   297 	$$(call LogInfo, Running gengraphs for $$($1_NAME) API documentation)
       
   298 	$$(call MakeDir, $$($1_GENGRAPHS_DIR))
       
   299 	$$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
       
   300 	    $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
       
   301 	    --dot-attributes $$(GENGRAPHS_PROPS) && \
       
   302 	    $$(TOUCH) $$($1_GENGRAPHS_MARKER))
       
   303 
       
   304     # For each module needing a graph, create a png file from the dot file
       
   305     # generated by the GenGraphs tool and store it in the target dir.
       
   306     # They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
       
   307     $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
       
   308       $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
       
   309     )
       
   310   endif
   342 endef
   311 endef
   343 
   312 
   344 ################################################################################
   313 ################################################################################
   345 
   314 # Setup generation of the JDK API documentation (javadoc + modulegraph)
   346 $(eval $(call SetupJavadocGeneration, coredocs, \
   315 
   347     MODULES := java.se.ee, \
   316 # All modules to have docs generated by docs-jdk-api target
   348     PACKAGES := $(CORE_PACKAGES), \
   317 JDK_JAVADOC_MODULES := $(sort $(DOCS_MODULES))
   349     IS_CORE := TRUE, \
   318 
   350     OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html, \
   319 JDK_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
   351     WINDOW_TITLE := Java Platform SE $(VERSION_SPECIFICATION), \
   320 
   352     HEADER_TITLE := Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;$(VERSION_SPECIFICATION), \
   321 $(eval $(call SetupApiDocsGeneration, JDK_API, \
   353     DOC_TITLE := Java&trade; Platform$(COMMA) Standard Edition \
   322     MODULES := $(JDK_JAVADOC_MODULES), \
   354       $(VERSION_SPECIFICATION)<br>API Specification, \
   323     NAME := JDK, \
   355     FIRST_COPYRIGHT_YEAR := 1993, \
   324     TARGET_DIR := $(JAVADOC_OUTPUTDIR)/api, \
   356     DISABLED_DOCLINT := accessibility html missing syntax, \
   325     OVERVIEW := $(JDK_JAVADOC_OVERVIEW), \
   357     DOCLINT_PACKAGES := -org.omg.* jdk.internal.logging.*, \
   326     DOC_TITLE := $(JDK_JAVADOC_DOC_TITLE), \
   358     SPLIT_INDEX := TRUE, \
   327     WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
   359     BOTTOM_COPYRIGHT_URL := $(CORE_BOTTOM_COPYRIGHT_URL), \
   328     HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
   360     BOTTOM_TEXT := $(CORE_BOTTOM_TEXT), \
   329     BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
   361     EXTRA_TOP := $(EARLYACCESS_TOP), \
   330     TOP_TEXT := $(JAVADOC_TOP), \
   362 ))
   331 ))
   363 
   332 
   364 TARGETS += $(coredocs)
   333 # Targets generated are returned in JDK_API_JAVADOC_TARGETS and
   365 
   334 # JDK_API_MODULEGRAPH_TARGETS.
   366 ################################################################################
   335 
   367 
   336 ################################################################################
   368 $(eval $(call SetupJavadocGeneration, docletapi, \
   337 # Setup generation of the Java SE API documentation (javadoc + modulegraph)
   369     MODULES := jdk.javadoc, \
   338 
   370     PACKAGES := \
   339 # The Java SE module scope is just java.se.ee and it's transitive modules.
   371         jdk.javadoc.doclet, \
   340 JAVASE_JAVADOC_MODULES := java.se.ee
   372     API_ROOT := jdk, \
   341 
   373     DEST_DIR := javadoc/doclet, \
   342 JAVASE_JAVADOC_OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html
   374     TITLE := Doclet API, \
   343 
   375     FIRST_COPYRIGHT_YEAR := 1993, \
   344 $(eval $(call SetupApiDocsGeneration, JAVASE_API, \
   376 ))
   345     MODULES := $(JAVASE_JAVADOC_MODULES), \
   377 
   346     NAME := Java SE, \
   378 TARGETS += $(docletapi)
   347     TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
   379 
   348     OVERVIEW := $(JAVASE_JAVADOC_OVERVIEW), \
   380 ################################################################################
   349     DOC_TITLE := $(JAVASE_JAVADOC_DOC_TITLE), \
   381 
   350     WINDOW_TITLE := $(JAVADOC_WINDOW_TITLE), \
   382 $(eval $(call SetupJavadocGeneration, old-docletapi, \
   351     HEADER_TITLE := $(JAVADOC_HEADER_TITLE), \
   383     MODULES := jdk.javadoc, \
   352     BOTTOM_TEXT := $(JAVADOC_BOTTOM), \
   384     PACKAGES := com.sun.javadoc, \
   353     TOP_TEXT := $(JAVADOC_TOP), \
   385     API_ROOT := jdk, \
   354 ))
   386     DEST_DIR := javadoc/old/doclet, \
   355 
   387     TITLE := Doclet API, \
   356 # Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
   388     FIRST_COPYRIGHT_YEAR := 1993, \
   357 # JAVASE_API_MODULEGRAPH_TARGETS.
   389 ))
   358 
   390 
   359 ################################################################################
   391 TARGETS += $(old-docletapi)
   360 # Copy JDK specs files
   392 
   361 
   393 ################################################################################
   362 # For all html documentation in $module/share/specs directories, copy it
   394 
   363 # unmodified
   395 $(eval $(call SetupJavadocGeneration, tagletapi, \
   364 
   396     MODULES := jdk.javadoc, \
   365 ALL_MODULES := $(call FindAllModules)
   397     PACKAGES := com.sun.tools.doclets, \
   366 COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
   398     API_ROOT := jdk, \
   367 
   399     DEST_DIR := javadoc/old/taglet, \
   368 $(foreach m, $(ALL_MODULES), \
   400     TITLE := Taglet API, \
   369   $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
   401     FIRST_COPYRIGHT_YEAR := 1993, \
   370   $(if $(SPECS_$m), \
   402 ))
   371     $(eval $(call SetupCopyFiles, COPY_$m, \
   403 
   372         SRC := $(SPECS_$m), \
   404 TARGETS += $(tagletapi)
   373         FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $(SPECS_$m))), \
   405 
   374         DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
   406 ################################################################################
   375     )) \
   407 
   376     $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
   408 $(eval $(call SetupJavadocGeneration, domapi, \
   377   ) \
   409     MODULES := \
   378 )
   410         java.xml \
   379 
   411         jdk.xml.dom, \
   380 # Copy the global resources
   412     PACKAGES := \
   381 GLOBAL_SPECS_RESOURCES_DIR := $(JDK_TOPDIR)/make/data/docs-resources/specs
   413         org.w3c.dom \
   382 $(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
   414         org.w3c.dom.bootstrap \
   383     SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
   415         org.w3c.dom.ls \
   384     FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
   416         org.w3c.dom.ranges \
   385     DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
   417         org.w3c.dom.traversal \
   386 ))
   418         org.w3c.dom.html \
   387 JDK_SPECS_TARGETS += $(COPY_GLOBAL_RESOURCES)
   419         org.w3c.dom.stylesheets \
   388 
   420         org.w3c.dom.css \
   389 ifeq ($(ENABLE_FULL_DOCS), true)
   421         org.w3c.dom.events \
   390   # For all markdown files in $module/share/specs directories, convert them to
   422         org.w3c.dom.views, \
   391   # html.
   423     API_ROOT := jre, \
   392 
   424     DEST_DIR := plugin/dom, \
   393   GLOBAL_SPECS_DEFAULT_CSS_FILE := $(JAVADOC_OUTPUTDIR)/specs/resources/jdk-default.css
   425     TITLE := Common DOM API, \
   394 
   426     FIRST_COPYRIGHT_YEAR := 2005, \
   395   $(foreach m, $(ALL_MODULES), \
   427     DISABLED_DOCLINT := accessibility html missing, \
   396     $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
   428     SPLIT_INDEX := TRUE, \
   397     $(foreach d, $(SPECS_$m), \
   429 ))
   398       $(if $(filter %.md, $(call CacheFind, $d)), \
   430 
   399         $(eval $(call SetupProcessMarkdown, CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d), \
   431 TARGETS += $(domapi)
   400             SRC := $d, \
   432 
   401             FILES := $(filter %.md, $(call CacheFind, $d)), \
   433 ################################################################################
   402             DEST := $(JAVADOC_OUTPUTDIR)/specs/, \
   434 
   403             CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
   435 $(eval $(call SetupJavadocGeneration, jdi, \
   404         )) \
   436     MODULES := jdk.jdi, \
   405       ) \
   437     PACKAGES := \
   406       $(eval JDK_SPECS_TARGETS += $(CONVERT_MARKDOWN_$m_$(patsubst $(TOPDIR)/%,%,$d))) \
   438         com.sun.jdi \
   407     ) \
   439         com.sun.jdi.event \
   408   )
   440         com.sun.jdi.request \
   409 endif
   441         com.sun.jdi.connect \
   410 
   442         com.sun.jdi.connect.spi, \
   411 # Special treatment for generated documentation
   443     API_ROOT := jdk, \
   412 
   444     DEST_DIR := jpda/jdi, \
   413 JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
   445     OVERVIEW := $(JDK_TOPDIR)/src/jdk.jdi/share/classes/jdi-overview.html, \
   414 $(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
   446     TITLE := Java&trade; Debug Interface, \
   415     FILES := $(JDWP_PROTOCOL), \
   447     FIRST_COPYRIGHT_YEAR := 1999, \
   416     DEST := $(JAVADOC_OUTPUTDIR)/specs/jdwp, \
   448     DISABLED_DOCLINT := accessibility missing syntax, \
   417 ))
   449     SPLIT_INDEX := TRUE, \
   418 JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
   450 ))
   419 
   451 
   420 # Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
   452 TARGETS += $(jdi)
   421 JVMTI_HTML := $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
   453 
       
   454 ################################################################################
       
   455 
       
   456 $(eval $(call SetupJavadocGeneration, jaas, \
       
   457     MODULES := jdk.security.auth, \
       
   458     PACKAGES := \
       
   459         com.sun.security.auth \
       
   460         com.sun.security.auth.callback \
       
   461         com.sun.security.auth.login \
       
   462         com.sun.security.auth.module, \
       
   463     API_ROOT := jre, \
       
   464     DEST_DIR := security/jaas/spec, \
       
   465     OVERVIEW := $(JDK_TOPDIR)/src/jdk.security.auth/share/classes/jaas-overview.html, \
       
   466     TITLE := Java&trade; Authentication and Authorization Service, \
       
   467     FIRST_COPYRIGHT_YEAR := 1998, \
       
   468     DISABLED_DOCLINT := missing, \
       
   469 ))
       
   470 
       
   471 TARGETS += $(jaas)
       
   472 
       
   473 ################################################################################
       
   474 
       
   475 $(eval $(call SetupJavadocGeneration, jgss, \
       
   476     MODULES := jdk.security.jgss, \
       
   477     PACKAGES := com.sun.security.jgss, \
       
   478     API_ROOT := jre, \
       
   479     DEST_DIR := security/jgss/spec, \
       
   480     OVERVIEW := $(JDK_TOPDIR)/src/java.security.jgss/share/classes/jgss-overview.html, \
       
   481     TITLE := Java&trade; GSS-API Utilities, \
       
   482     FIRST_COPYRIGHT_YEAR := 2000, \
       
   483 ))
       
   484 
       
   485 TARGETS += $(jgss)
       
   486 
       
   487 ################################################################################
       
   488 
       
   489 $(eval $(call SetupJavadocGeneration, smartcardio, \
       
   490     MODULES := java.smartcardio, \
       
   491     PACKAGES := javax.smartcardio, \
       
   492     API_ROOT := jre, \
       
   493     DEST_DIR := security/smartcardio/spec, \
       
   494     TITLE := Java&trade; Smart Card I/O, \
       
   495     FIRST_COPYRIGHT_YEAR := 2005, \
       
   496 ))
       
   497 
       
   498 TARGETS += $(smartcardio)
       
   499 
       
   500 ################################################################################
       
   501 
       
   502 $(eval $(call SetupJavadocGeneration, httpserver, \
       
   503     MODULES := jdk.httpserver, \
       
   504     PACKAGES := \
       
   505         com.sun.net.httpserver \
       
   506         com.sun.net.httpserver.spi, \
       
   507     API_ROOT := jre, \
       
   508     DEST_DIR := net/httpserver/spec, \
       
   509     TITLE := Java&trade; HTTP Server, \
       
   510     FIRST_COPYRIGHT_YEAR := 2005, \
       
   511     DISABLED_DOCLINT := accessibility missing syntax, \
       
   512 ))
       
   513 
       
   514 TARGETS += $(httpserver)
       
   515 
       
   516 ################################################################################
       
   517 
       
   518 $(eval $(call SetupJavadocGeneration, httpclient, \
       
   519     MODULES := jdk.incubator.httpclient, \
       
   520     PACKAGES := \
       
   521         jdk.incubator.http, \
       
   522     API_ROOT := jre, \
       
   523     DEST_DIR := incubator/httpclient/spec, \
       
   524     TITLE := Java&trade; HTTP Client API (incubator module), \
       
   525     FIRST_COPYRIGHT_YEAR := 2015, \
       
   526     DISABLED_DOCLINT := accessibility missing syntax, \
       
   527 ))
       
   528 
       
   529 TARGETS += $(httpclient)
       
   530 
       
   531 ################################################################################
       
   532 
       
   533 $(eval $(call SetupJavadocGeneration, jsobject, \
       
   534     MODULES := jdk.jsobject, \
       
   535     PACKAGES := netscape.javascript, \
       
   536     API_ROOT := jre, \
       
   537     DEST_DIR := plugin/jsobject, \
       
   538     FIRST_COPYRIGHT_YEAR := 1993, \
       
   539     TITLE := Java&trade; JSObject Doc, \
       
   540 ))
       
   541 
       
   542 TARGETS += $(jsobject)
       
   543 
       
   544 ################################################################################
       
   545 
       
   546 $(eval $(call SetupJavadocGeneration, mgmt, \
       
   547     MODULES := jdk.management, \
       
   548     PACKAGES := com.sun.management, \
       
   549     API_ROOT := jre, \
       
   550     DEST_DIR := management/extension, \
       
   551     OVERVIEW := $(JDK_TOPDIR)/src/java.management/share/classes/mgmt-overview.html, \
       
   552     TITLE := Monitoring and Management Interface for the Java&trade; Platform, \
       
   553     FIRST_COPYRIGHT_YEAR := 2003, \
       
   554     DISABLED_DOCLINT := accessibility missing reference, \
       
   555 ))
       
   556 
       
   557 TARGETS += $(mgmt)
       
   558 
       
   559 ################################################################################
       
   560 
       
   561 $(eval $(call SetupJavadocGeneration, attach, \
       
   562     MODULES := jdk.attach, \
       
   563     PACKAGES := \
       
   564         com.sun.tools.attach \
       
   565         com.sun.tools.attach.spi, \
       
   566     API_ROOT := jdk, \
       
   567     DEST_DIR := attach/spec, \
       
   568     TITLE := Attach API, \
       
   569     FIRST_COPYRIGHT_YEAR := 2005, \
       
   570     DISABLED_DOCLINT := reference, \
       
   571 ))
       
   572 
       
   573 TARGETS += $(attach)
       
   574 
       
   575 ################################################################################
       
   576 
       
   577 $(eval $(call SetupJavadocGeneration, jconsole, \
       
   578     MODULES := jdk.jconsole, \
       
   579     PACKAGES := com.sun.tools.jconsole, \
       
   580     API_ROOT := jdk, \
       
   581     DEST_DIR := jconsole/spec, \
       
   582     TITLE := JConsole API, \
       
   583     FIRST_COPYRIGHT_YEAR := 2006, \
       
   584 ))
       
   585 
       
   586 TARGETS += $(jconsole)
       
   587 
       
   588 ################################################################################
       
   589 
       
   590 $(eval $(call SetupJavadocGeneration, jshellapi, \
       
   591     MODULES := jdk.jshell, \
       
   592     PACKAGES := \
       
   593         jdk.jshell \
       
   594         jdk.jshell.spi \
       
   595         jdk.jshell.execution \
       
   596         jdk.jshell.tool, \
       
   597     API_ROOT := jdk, \
       
   598     DEST_DIR := jshell, \
       
   599     TITLE := JShell API, \
       
   600     FIRST_COPYRIGHT_YEAR := 2015, \
       
   601     SPLIT_INDEX := TRUE, \
       
   602 ))
       
   603 
       
   604 TARGETS += $(jshellapi)
       
   605 
       
   606 ################################################################################
       
   607 
       
   608 $(eval $(call SetupJavadocGeneration, treeapi, \
       
   609     MODULES := jdk.compiler, \
       
   610     PACKAGES := \
       
   611         com.sun.source.doctree \
       
   612         com.sun.source.tree \
       
   613         com.sun.source.util, \
       
   614     API_ROOT := jdk, \
       
   615     DEST_DIR := javac/tree, \
       
   616     TITLE := Compiler Tree API, \
       
   617     FIRST_COPYRIGHT_YEAR := 2005, \
       
   618     SPLIT_INDEX := TRUE, \
       
   619 ))
       
   620 
       
   621 TARGETS += $(treeapi)
       
   622 
       
   623 ################################################################################
       
   624 
       
   625 $(eval $(call SetupJavadocGeneration, nashornapi, \
       
   626     MODULES := jdk.scripting.nashorn, \
       
   627     PACKAGES := \
       
   628         jdk.nashorn.api.scripting \
       
   629         jdk.nashorn.api.tree, \
       
   630     API_ROOT := jdk, \
       
   631     DEST_DIR := nashorn, \
       
   632     TITLE := Nashorn API, \
       
   633     FIRST_COPYRIGHT_YEAR := 2014, \
       
   634     SPLIT_INDEX := TRUE, \
       
   635 ))
       
   636 
       
   637 TARGETS += $(nashornapi)
       
   638 
       
   639 ################################################################################
       
   640 
       
   641 $(eval $(call SetupJavadocGeneration, dynalinkapi, \
       
   642     MODULES := jdk.dynalink, \
       
   643     PACKAGES := \
       
   644         jdk.dynalink \
       
   645         jdk.dynalink.beans \
       
   646         jdk.dynalink.linker \
       
   647         jdk.dynalink.linker.support \
       
   648         jdk.dynalink.support, \
       
   649     API_ROOT := jdk, \
       
   650     DEST_DIR := dynalink, \
       
   651     TITLE := Dynalink API, \
       
   652     FIRST_COPYRIGHT_YEAR := 2015, \
       
   653 ))
       
   654 
       
   655 TARGETS += $(dynalinkapi)
       
   656 
       
   657 ################################################################################
       
   658 
       
   659 $(eval $(call SetupJavadocGeneration, sctp, \
       
   660     MODULES := jdk.sctp, \
       
   661     PACKAGES := com.sun.nio.sctp, \
       
   662     API_ROOT := jre, \
       
   663     DEST_DIR := nio/sctp/spec, \
       
   664     TITLE := SCTP API, \
       
   665     FIRST_COPYRIGHT_YEAR := 2009, \
       
   666 ))
       
   667 
       
   668 TARGETS += $(sctp)
       
   669 
       
   670 ################################################################################
       
   671 
       
   672 $(eval $(call SetupJavadocGeneration, jaccess, \
       
   673     MODULES := jdk.accessibility, \
       
   674     PACKAGES := com.sun.java.accessibility.util, \
       
   675     API_ROOT := jre, \
       
   676     DEST_DIR := accessibility/jaccess/spec, \
       
   677     TITLE := JACCESS API, \
       
   678     FIRST_COPYRIGHT_YEAR := 2002, \
       
   679 ))
       
   680 
       
   681 TARGETS += $(jaccess)
       
   682 
       
   683 ################################################################################
       
   684 
       
   685 $(eval $(call SetupJavadocGeneration, jdknet, \
       
   686     MODULES := jdk.net, \
       
   687     PACKAGES := jdk.net, \
       
   688     API_ROOT := jre, \
       
   689     DEST_DIR := net/socketoptions/spec, \
       
   690     TITLE := jdk.net API, \
       
   691     FIRST_COPYRIGHT_YEAR := 2014, \
       
   692     DISABLED_DOCLINT := missing, \
       
   693 ))
       
   694 
       
   695 TARGETS += $(jdknet)
       
   696 
       
   697 ################################################################################
       
   698 # Copy JDWP html file
       
   699 
       
   700 JDWP_HTML := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
       
   701 
       
   702 $(eval $(call SetupCopyFiles, COPY_JDWP_HTML, \
       
   703     FILES := $(JDWP_HTML), \
       
   704     DEST := $(JAVADOC_OUTPUTDIR)/platform/jpda/jdwp, \
       
   705 ))
       
   706 
       
   707 COPY_TARGETS += $(COPY_JDWP_HTML)
       
   708 
       
   709 ################################################################################
       
   710 # Copy JVMTI html file
       
   711 
       
   712 # Pick jvmti.html from any jvm variant, they are all the same.
       
   713 JVMTI_HTML := $(firstword \
       
   714     $(wildcard $(HOTSPOT_OUTPUTDIR)/variant-*/gensrc/jvmtifiles/jvmti.html))
       
   715 
       
   716 $(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
   422 $(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
   717     FILES := $(JVMTI_HTML), \
   423     FILES := $(JVMTI_HTML), \
   718     DEST := $(JAVADOC_OUTPUTDIR)/platform/jvmti, \
   424     DEST := $(JAVADOC_OUTPUTDIR)/specs, \
   719 ))
   425 ))
   720 
   426 JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
   721 COPY_TARGETS += $(COPY_JVMTI_HTML)
       
   722 
   427 
   723 ################################################################################
   428 ################################################################################
   724 # Optional target which bundles all generated javadocs into a zip archive.
   429 # Optional target which bundles all generated javadocs into a zip archive.
   725 
   430 
   726 JAVADOC_ARCHIVE_NAME := jdk-$(VERSION_STRING)-docs.zip
   431 JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
   727 JAVADOC_ARCHIVE_ASSEMBLY_DIR := $(SUPPORT_OUTPUTDIR)/docs/zip-docs
   432 JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
   728 JAVADOC_ARCHIVE_DIR := $(OUTPUT_ROOT)/bundles
   433 
   729 JAVADOC_ARCHIVE := $(JAVADOC_ARCHIVE_DIR)/$(JAVADOC_ARCHIVE_NAME)
   434 $(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
   730 
   435     SRC := $(JAVADOC_OUTPUTDIR), \
   731 $(JAVADOC_ARCHIVE): $(TARGETS) $(COPY_TARGETS)
   436     ZIP := $(JAVADOC_ZIP_FILE), \
   732 	$(call LogInfo, Compressing javadoc to single $(JAVADOC_ARCHIVE_NAME))
   437     EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
   733 	$(MKDIR) -p $(JAVADOC_ARCHIVE_DIR)
   438         $(JDK_SPECS_TARGETS), \
   734 	$(RM) -r $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
   439 ))
   735 	$(MKDIR) -p $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
   440 
   736 	all_roots=`$(FIND) $(JAVADOC_OUTPUTDIR) | $(GREP) index.html | grep -v old/doclet`; \
   441 ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
   737 	pushd $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); \
   442 
   738 	for index_file in $${all_roots} ; do \
   443 ################################################################################
   739 	  target_dir=`dirname $${index_file}`; \
   444 
   740 	  name=`$(ECHO) $${target_dir} | $(SED) "s;/spec;;" | $(SED) "s;.*/;;"`; \
   445 docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS)
   741 	  $(LN) -s $${target_dir}  $${name}; \
   446 
   742 	done; \
   447 docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
   743 	$(ZIPEXE) -q -r $(JAVADOC_ARCHIVE) * ; \
   448 
   744 	popd ;
   449 docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS)
   745 
   450 
   746 ZIP_TARGETS += $(JAVADOC_ARCHIVE)
   451 docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
   747 
   452 
   748 ################################################################################
   453 docs-jdk-specs: $(JDK_SPECS_TARGETS)
   749 # generate .dot files for module graphs
       
   750 
       
   751 JAVADOC_MODULE_GRAPHS_DIR := $(SUPPORT_OUTPUTDIR)/docs/module-graphs
       
   752 JAVADOC_MODULE_GRAPHS := $(JAVADOC_MODULE_GRAPHS_DIR)/java.se.dot
       
   753 JAVADOC_MODULE_GRAPHS_PROPS := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
       
   754 
       
   755 $(JAVADOC_MODULE_GRAPHS): $(BUILD_JIGSAW_TOOLS) $(JAVADOC_MODULE_GRAPHS_PROPS)
       
   756 	$(MKDIR) -p $(@D)
       
   757 	$(TOOL_GENGRAPHS) --spec --output $(JAVADOC_MODULE_GRAPHS_DIR) \
       
   758 	    --dot-attributes $(JAVADOC_MODULE_GRAPHS_PROPS)
       
   759 
       
   760 MODULE_GRAPH_TARGETS += $(JAVADOC_MODULE_GRAPHS)
       
   761 
       
   762 ################################################################################
       
   763 
       
   764 # Hook to include the corresponding custom file, if present.
       
   765 $(eval $(call IncludeCustomExtension, , Javadoc.gmk))
       
   766 
       
   767 ################################################################################
       
   768 
       
   769 docs-module-graphs: $(MODULE_GRAPH_TARGETS) 
       
   770 
       
   771 docs-javadoc: $(TARGETS)
       
   772 
       
   773 docs-copy: $(COPY_TARGETS)
       
   774 
   454 
   775 docs-zip: $(ZIP_TARGETS)
   455 docs-zip: $(ZIP_TARGETS)
   776 
   456 
   777 all: docs-module-graphs docs-javadoc docs-copy docs-zip
   457 all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
   778 
   458     docs-javase-api-modulegraph docs-jdk-specs docs-zip
   779 .PHONY: default all docs-module-graphs docs-javadoc docs-copy docs-zip
   459 
       
   460 .PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
       
   461     docs-javase-api-javadoc docs-javase-api-modulegraph docs-jdk-specs docs-zip