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 
  25 default: all
  26 
  27 include $(SPEC)
  28 include MakeBase.gmk
  29 include $(JDK_TOPDIR)/make/Tools.gmk
  30 include $(JDK_TOPDIR)/make/ModuleTools.gmk
  31 
  32 ################################################################################
  33 
  34 # List of all possible directories for javadoc to look for sources
  35 # Allow custom to overwrite.
  36 JAVADOC_SOURCE_DIRS = \
  37       $(SUPPORT_OUTPUTDIR)/gensrc/* \
  38       $(addsuffix /*, $(IMPORT_MODULES_SRC)) \
  39       $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
  40       $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_TYPE)/classes \
  41       $(JDK_TOPDIR)/src/*/share/classes \
  42       $(HOTSPOT_TOPDIR)/src/*/share/classes \
  43       $(LANGTOOLS_TOPDIR)/src/*/share/classes \
  44       $(NASHORN_TOPDIR)/src/*/share/classes \
  45       $(CORBA_TOPDIR)/src/*/share/classes \
  46       $(JAXP_TOPDIR)/src/*/share/classes \
  47       $(JAXWS_TOPDIR)/src/*/share/classes \
  48       $(SUPPORT_OUTPUTDIR)/rmic/* \
  49       $(JDK_TOPDIR)/src/*/share/doc/stub \
  50       #
  51 
  52 # Should we use -Xdocrootparent? Allow custom to overwrite.
  53 DOCROOTPARENT_FLAG = TRUE
  54 
  55 # URLs
  56 JAVADOC_BASE_URL := http://docs.oracle.com/javase/$(VERSION_SPECIFICATION)/docs
  57 BUG_SUBMIT_URL := http://bugreport.java.com/bugreport/
  58 
  59 ################################################################################
  60 # Text snippets
  61 
  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     #
 129 
 130 CORE_PACKAGES := $(filter-out $(CORE_EXCLUDED_PACKAGES), \
 131     $(JAVA_PACKAGES) $(JAVAX_PACKAGES) $(ORG_PACKAGES))
 132 
 133 CORE_PACKAGES_LIST_DIR := $(SUPPORT_OUTPUTDIR)/docs/core-packages
 134 CORE_PACKAGES_LIST_FILE := $(CORE_PACKAGES_LIST_DIR)/package-list
 135 
 136 CORE_PACKAGES_VARDEPS_FILE := $(call DependOnVariable, CORE_PACKAGES, \
 137     $(CORE_PACKAGES_LIST_FILE).vardeps)
 138 
 139 $(CORE_PACKAGES_LIST_FILE): $(CORE_PACKAGES_VARDEPS_FILE)
 140         $(call MakeDir, $(@D))
 141         $(eval $(call ListPathsSafely, CORE_PACKAGES, $@))
 142 
 143 ################################################################################
 144 # Support functions for SetupJavadocGeneration
 145 
 146 # Generate the text used in the -bottom argument.
 147 # Note that COPYRIGHT_YEAR is the current year (from spec.gmk)
 148 # Arguments:
 149 # arg 1: first copyright year
 150 # arg 2: copyright url (optional)
 151 # arg 3: free-form text snippet (optional)
 152 define GenerateBottom
 153   <span style="font-size:smaller">$(if $(strip $3), $(strip $3))<br> $(if \
 154       $(strip $2),<a href="$(strip $2)">Copyright</a>,Copyright) \
 155       &copy; $(strip $1), $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
 156       $(COMPANY_ADDRESS). All rights reserved.</span>
 157 endef
 158 
 159 # Speed up finding by filling cache
 160 $(eval $(call FillCacheFind, $(wildcard $(JAVADOC_SOURCE_DIRS))))
 161 
 162 # In order to get a specific ordering it's necessary to specify the total
 163 # ordering of tags as the tags are otherwise ordered in order of definition.
 164 DEFAULT_JAVADOC_TAGS := \
 165     -tag beaninfo:X \
 166     -tag revised:X \
 167     -tag since.unbundled:X \
 168     -tag spec:X \
 169     -tag specdefault:X \
 170     -tag Note:X \
 171     -tag ToDo:X \
 172     -tag 'apiNote:a:API Note:' \
 173     -tag 'implSpec:a:Implementation Requirements:' \
 174     -tag 'implNote:a:Implementation Note:' \
 175     -tag param \
 176     -tag return \
 177     -tag throws \
 178     -taglet build.tools.taglet.ModuleGraph \
 179     -tag since \
 180     -tag version \
 181     -tag serialData \
 182     -tag factory \
 183     -tag see \
 184     -tag 'jvms:a:See <cite>The Java&trade; Virtual Machine Specification</cite>:' \
 185     -tag 'jls:a:See <cite>The Java&trade; Language Specification</cite>:' \
 186     -taglet build.tools.taglet.Incubating \
 187     -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
 188     #
 189 
 190 DEFAULT_JAVADOC_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
 191     -serialwarn -encoding ISO-8859-1 -breakiterator --system none
 192 
 193 #
 194 # TODO: this should be set by the configure option.
 195 #
 196 ifndef ENABLE_MODULE_GRAPH
 197    ENABLE_MODULE_GRAPH=false
 198 endif
 199 
 200 ################################################################################
 201 # Setup make rules for running javadoc.
 202 #
 203 # Parameter 1 is the name of the rule. This name is used as variable prefix,
 204 # and the targets generated are listed in a variable by that name. Note that
 205 # the index.html file will work as a "touch file" for all the magnitude of
 206 # files that are generated by javadoc.
 207 #
 208 # Remaining parameters are named arguments. These include:
 209 #   MODULES - Modules to include
 210 #   PACKAGES - Packages to include
 211 #   IS_CORE - Set to TRUE for the Core API package which needs special treatment
 212 #   API_ROOT - Where to base the documentation (jre or jdk)
 213 #   DEST_DIR - A directory relative to the API root
 214 #   OVERVIEW - Path to a html overview file
 215 #   TITLE - Default title to use for the more specific versions below
 216 #   WINDOW_TITLE - Title to use in -windowtitle. Computed from TITLE if empty.
 217 #   HEADER_TITLE - Title to use in -header. Computed from TITLE if empty.
 218 #   DOC_TITLE - Title to use in -doctitle. Computed from TITLE if empty.
 219 #   FIRST_COPYRIGHT_YEAR - First year this bundle was introduced
 220 #   DISABLED_DOCLINT - Doclint warnings to exclude.
 221 #   DOCLINT_PACKAGES - Optional -Xdoclint/package value
 222 #   SPLIT_INDEX - Enable -splitIndex (split index-all.html if it is too large)
 223 #   BOTTOM_COPYRIGHT_URL - Copyright URL to use in -bottom
 224 #   BOTTOM_TEXT - Extra text to use in -bottom
 225 #   EXTRA_TOP - Additional -top data
 226 #
 227 SetupJavadocGeneration = $(NamedParamsMacroTemplate)
 228 define SetupJavadocGenerationBody
 229   ifeq ($$($1_IS_CORE), TRUE)
 230     $1_JAVA := $$(JAVA)
 231     $1_OUTPUT_DIRNAME := api
 232   else
 233     $1_JAVA := $$(JAVA_SMALL)
 234     $1_OUTPUT_DIRNAME := $$($1_API_ROOT)/api/$$($1_DEST_DIR)
 235 
 236     # Compute a relative path to core root.
 237     # The non-core api javadocs need to be able to access the root of the core
 238     # api directory, so for jdk/api or jre/api to get to the core api/
 239     # directory we would use this
 240     $1_RELATIVE_CORE_DIR := $$(call DirToDotDot, $$($1_OUTPUT_DIRNAME))/api
 241 
 242     # We need to tell javadoc the directory in which to find the core package-list
 243     $1_OPTIONS += -linkoffline $$($1_RELATIVE_CORE_DIR) $$(CORE_PACKAGES_LIST_DIR)
 244 
 245     $1_DEPS += $(CORE_PACKAGES_LIST_FILE)
 246   endif
 247 
 248   $1_OPTIONS += --add-modules $$(call CommaList, $$($1_MODULES))
 249 
 250   ifneq ($$($1_DISABLED_DOCLINT), )
 251     # Create a string like ",-syntax,-html"
 252     $1_DOCLINT_EXCEPTIONS := ,$$(call CommaList, $$(addprefix -, $$($1_DISABLED_DOCLINT)))
 253   endif
 254   $1_OPTIONS += -Xdoclint:all$$($1_DOCLINT_EXCEPTIONS)
 255 
 256   ifneq ($$($1_DOCLINT_PACKAGES), )
 257     $1_OPTIONS += -Xdoclint/package:$$(call CommaList, $$($1_DOCLINT_PACKAGES))
 258   endif
 259 
 260   ifeq ($$($1_DOC_TITLE), )
 261     $1_DOC_TITLE := $$($1_TITLE)
 262   endif
 263   $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
 264 
 265   ifeq ($$($1_WINDOW_TITLE), )
 266     $1_WINDOW_TITLE := $$(strip $$(subst &trade;,, $$($1_TITLE)))
 267   endif
 268   $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)$$(DRAFT_WINDOW_TITLE_MARKER)'
 269 
 270   ifeq ($$($1_HEADER_TITLE), )
 271     $1_HEADER_TITLE := $$(strip $$(subst &trade;,, $$($1_TITLE)))
 272   endif
 273   $1_OPTIONS += -header '<strong>$$($1_HEADER_TITLE)</strong>$$(DRAFT_MARKER)'
 274 
 275   ifneq ($$($1_EXTRA_TOP), )
 276     $1_OPTIONS += -top '$$($1_EXTRA_TOP)'
 277   endif
 278 
 279   ifeq ($$($1_BOTTOM_TEXT), )
 280     $1_BOTTOM_TEXT := $(COMMON_BOTTOM_TEXT)
 281   endif
 282   $1_BOTTOM := $$(call GenerateBottom, $$($1_FIRST_COPYRIGHT_YEAR), \
 283       $$($1_BOTTOM_COPYRIGHT_URL), $$($1_BOTTOM_TEXT))
 284   $1_OPTIONS += -bottom '$$($1_BOTTOM)$$(DRAFT_MARKER)'
 285 
 286   ifneq ($$($1_OVERVIEW), )
 287     $1_OPTIONS += -overview $$($1_OVERVIEW)
 288     $1_DEPS +=  $$($1_OVERVIEW)
 289   endif
 290 
 291   ifneq ($$($1_SPLIT_INDEX), )
 292     $1_OPTIONS += -splitIndex
 293   endif
 294 
 295   ifneq ($$($DOCROOTPARENT_FLAG), )
 296     $1_OPTIONS += -Xdocrootparent $(JAVADOC_BASE_URL)
 297   endif
 298 
 299   $1_VARDEPS := $$($1_OPTIONS) $$($1_PACKAGES)
 300   $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
 301        $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
 302 
 303   # Do not store debug level options in VARDEPS.
 304   ifneq ($$(LOG_LEVEL), trace)
 305     $1_OPTIONS += -quiet
 306   else
 307     $1_OPTIONS += -verbose
 308   endif
 309 
 310   $1_PACKAGE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach p, \
 311       $$(subst .,/,$$(strip $$($1_PACKAGES))), \
 312       $$(addsuffix /$$p, $$(wildcard $$(JAVADOC_SOURCE_DIRS))))))
 313 
 314   # If there are many packages, use an @-file...
 315   ifneq ($$(word 17, $$($1_PACKAGES)), )
 316     $1_PACKAGES_FILE := $$(SUPPORT_OUTPUTDIR)/docs/$1.packages
 317     $1_PACKAGES_ARG := @$$($1_PACKAGES_FILE)
 318   else
 319     $1_PACKAGES_ARG := $$($1_PACKAGES)
 320   endif
 321 
 322   # The index.html which is a marker for all the output from javadoc.
 323   $1_INDEX_FILE := $$(JAVADOC_OUTPUTDIR)/$$($1_OUTPUT_DIRNAME)/index.html
 324 
 325   # Rule for actually running javadoc
 326   $$($1_INDEX_FILE): $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) $$($1_PACKAGE_DEPS) $$($1_DEPS)
 327         $$(call LogWarn, Generating Javadoc from $$(words $$($1_PACKAGES)) package(s) for $$($1_OUTPUT_DIRNAME))
 328         $$(call MakeDir, $$(@D))
 329         ifneq ($$($1_PACKAGES_FILE), )
 330           $$(eval $$(call ListPathsSafely, $1_PACKAGES, $$($1_PACKAGES_FILE)))
 331         endif
 332         $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1.javadoc, \
 333             $$($1_JAVA) -Djava.awt.headless=true -DenableModuleGraph=$(ENABLE_MODULE_GRAPH) \
 334                 $(NEW_JAVADOC) -d $$(@D) \
 335                 $$(DEFAULT_JAVADOC_TAGS) $$(DEFAULT_JAVADOC_OPTIONS) \
 336                 --module-source-path $$(call PathList, $$(JAVADOC_SOURCE_DIRS)) \
 337                 $$($1_OPTIONS) $$($1_PACKAGES_ARG))
 338 
 339   # The output returned will be the index.html file
 340   $1 := $$($1_INDEX_FILE)
 341 endef
 342 
 343 ################################################################################
 344 
 345 $(eval $(call SetupJavadocGeneration, coredocs, \
 346     MODULES := java.se.ee, \
 347     PACKAGES := $(CORE_PACKAGES), \
 348     IS_CORE := TRUE, \
 349     OVERVIEW := $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html, \
 350     WINDOW_TITLE := Java Platform SE $(VERSION_SPECIFICATION), \
 351     HEADER_TITLE := Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;$(VERSION_SPECIFICATION), \
 352     DOC_TITLE := Java&trade; Platform$(COMMA) Standard Edition \
 353       $(VERSION_SPECIFICATION)<br>API Specification, \
 354     FIRST_COPYRIGHT_YEAR := 1993, \
 355     DISABLED_DOCLINT := accessibility html missing syntax, \
 356     DOCLINT_PACKAGES := -org.omg.* jdk.internal.logging.*, \
 357     SPLIT_INDEX := TRUE, \
 358     BOTTOM_COPYRIGHT_URL := $(CORE_BOTTOM_COPYRIGHT_URL), \
 359     BOTTOM_TEXT := $(CORE_BOTTOM_TEXT), \
 360     EXTRA_TOP := $(EARLYACCESS_TOP), \
 361 ))
 362 
 363 TARGETS += $(coredocs)
 364 
 365 ################################################################################
 366 
 367 $(eval $(call SetupJavadocGeneration, docletapi, \
 368     MODULES := jdk.javadoc, \
 369     PACKAGES := \
 370         jdk.javadoc.doclet, \
 371     API_ROOT := jdk, \
 372     DEST_DIR := javadoc/doclet, \
 373     TITLE := Doclet API, \
 374     FIRST_COPYRIGHT_YEAR := 1993, \
 375 ))
 376 
 377 TARGETS += $(docletapi)
 378 
 379 ################################################################################
 380 
 381 $(eval $(call SetupJavadocGeneration, old-docletapi, \
 382     MODULES := jdk.javadoc, \
 383     PACKAGES := com.sun.javadoc, \
 384     API_ROOT := jdk, \
 385     DEST_DIR := javadoc/old/doclet, \
 386     TITLE := Doclet API, \
 387     FIRST_COPYRIGHT_YEAR := 1993, \
 388 ))
 389 
 390 TARGETS += $(old-docletapi)
 391 
 392 ################################################################################
 393 
 394 $(eval $(call SetupJavadocGeneration, tagletapi, \
 395     MODULES := jdk.javadoc, \
 396     PACKAGES := com.sun.tools.doclets, \
 397     API_ROOT := jdk, \
 398     DEST_DIR := javadoc/old/taglet, \
 399     TITLE := Taglet API, \
 400     FIRST_COPYRIGHT_YEAR := 1993, \
 401 ))
 402 
 403 TARGETS += $(tagletapi)
 404 
 405 ################################################################################
 406 
 407 $(eval $(call SetupJavadocGeneration, domapi, \
 408     MODULES := \
 409         java.xml \
 410         jdk.xml.dom, \
 411     PACKAGES := \
 412         org.w3c.dom \
 413         org.w3c.dom.bootstrap \
 414         org.w3c.dom.ls \
 415         org.w3c.dom.ranges \
 416         org.w3c.dom.traversal \
 417         org.w3c.dom.html \
 418         org.w3c.dom.stylesheets \
 419         org.w3c.dom.css \
 420         org.w3c.dom.events \
 421         org.w3c.dom.views, \
 422     API_ROOT := jre, \
 423     DEST_DIR := plugin/dom, \
 424     TITLE := Common DOM API, \
 425     FIRST_COPYRIGHT_YEAR := 2005, \
 426     DISABLED_DOCLINT := accessibility html missing, \
 427     SPLIT_INDEX := TRUE, \
 428 ))
 429 
 430 TARGETS += $(domapi)
 431 
 432 ################################################################################
 433 
 434 $(eval $(call SetupJavadocGeneration, jdi, \
 435     MODULES := jdk.jdi, \
 436     PACKAGES := \
 437         com.sun.jdi \
 438         com.sun.jdi.event \
 439         com.sun.jdi.request \
 440         com.sun.jdi.connect \
 441         com.sun.jdi.connect.spi, \
 442     API_ROOT := jdk, \
 443     DEST_DIR := jpda/jdi, \
 444     OVERVIEW := $(JDK_TOPDIR)/src/jdk.jdi/share/classes/jdi-overview.html, \
 445     TITLE := Java&trade; Debug Interface, \
 446     FIRST_COPYRIGHT_YEAR := 1999, \
 447     DISABLED_DOCLINT := accessibility missing syntax, \
 448     SPLIT_INDEX := TRUE, \
 449 ))
 450 
 451 TARGETS += $(jdi)
 452 
 453 ################################################################################
 454 
 455 $(eval $(call SetupJavadocGeneration, jaas, \
 456     MODULES := jdk.security.auth, \
 457     PACKAGES := \
 458         com.sun.security.auth \
 459         com.sun.security.auth.callback \
 460         com.sun.security.auth.login \
 461         com.sun.security.auth.module, \
 462     API_ROOT := jre, \
 463     DEST_DIR := security/jaas/spec, \
 464     OVERVIEW := $(JDK_TOPDIR)/src/jdk.security.auth/share/classes/jaas-overview.html, \
 465     TITLE := Java&trade; Authentication and Authorization Service, \
 466     FIRST_COPYRIGHT_YEAR := 1998, \
 467     DISABLED_DOCLINT := missing, \
 468 ))
 469 
 470 TARGETS += $(jaas)
 471 
 472 ################################################################################
 473 
 474 $(eval $(call SetupJavadocGeneration, jgss, \
 475     MODULES := jdk.security.jgss, \
 476     PACKAGES := com.sun.security.jgss, \
 477     API_ROOT := jre, \
 478     DEST_DIR := security/jgss/spec, \
 479     OVERVIEW := $(JDK_TOPDIR)/src/java.security.jgss/share/classes/jgss-overview.html, \
 480     TITLE := Java&trade; GSS-API Utilities, \
 481     FIRST_COPYRIGHT_YEAR := 2000, \
 482 ))
 483 
 484 TARGETS += $(jgss)
 485 
 486 ################################################################################
 487 
 488 $(eval $(call SetupJavadocGeneration, smartcardio, \
 489     MODULES := java.smartcardio, \
 490     PACKAGES := javax.smartcardio, \
 491     API_ROOT := jre, \
 492     DEST_DIR := security/smartcardio/spec, \
 493     TITLE := Java&trade; Smart Card I/O, \
 494     FIRST_COPYRIGHT_YEAR := 2005, \
 495 ))
 496 
 497 TARGETS += $(smartcardio)
 498 
 499 ################################################################################
 500 
 501 $(eval $(call SetupJavadocGeneration, httpserver, \
 502     MODULES := jdk.httpserver, \
 503     PACKAGES := \
 504         com.sun.net.httpserver \
 505         com.sun.net.httpserver.spi, \
 506     API_ROOT := jre, \
 507     DEST_DIR := net/httpserver/spec, \
 508     TITLE := Java&trade; HTTP Server, \
 509     FIRST_COPYRIGHT_YEAR := 2005, \
 510     DISABLED_DOCLINT := accessibility missing syntax, \
 511 ))
 512 
 513 TARGETS += $(httpserver)
 514 
 515 ################################################################################
 516 
 517 $(eval $(call SetupJavadocGeneration, httpclient, \
 518     MODULES := jdk.incubator.httpclient, \
 519     PACKAGES := \
 520         jdk.incubator.http, \
 521     API_ROOT := jre, \
 522     DEST_DIR := incubator/httpclient/spec, \
 523     TITLE := Java&trade; HTTP Client API (incubator module), \
 524     FIRST_COPYRIGHT_YEAR := 2015, \
 525     DISABLED_DOCLINT := accessibility missing syntax, \
 526 ))
 527 
 528 TARGETS += $(httpclient)
 529 
 530 ################################################################################
 531 
 532 $(eval $(call SetupJavadocGeneration, jsobject, \
 533     MODULES := jdk.jsobject, \
 534     PACKAGES := netscape.javascript, \
 535     API_ROOT := jre, \
 536     DEST_DIR := plugin/jsobject, \
 537     FIRST_COPYRIGHT_YEAR := 1993, \
 538     TITLE := Java&trade; JSObject Doc, \
 539 ))
 540 
 541 TARGETS += $(jsobject)
 542 
 543 ################################################################################
 544 
 545 $(eval $(call SetupJavadocGeneration, mgmt, \
 546     MODULES := jdk.management, \
 547     PACKAGES := com.sun.management, \
 548     API_ROOT := jre, \
 549     DEST_DIR := management/extension, \
 550     OVERVIEW := $(JDK_TOPDIR)/src/java.management/share/classes/mgmt-overview.html, \
 551     TITLE := Monitoring and Management Interface for the Java&trade; Platform, \
 552     FIRST_COPYRIGHT_YEAR := 2003, \
 553     DISABLED_DOCLINT := accessibility missing reference, \
 554 ))
 555 
 556 TARGETS += $(mgmt)
 557 
 558 ################################################################################
 559 
 560 $(eval $(call SetupJavadocGeneration, attach, \
 561     MODULES := jdk.attach, \
 562     PACKAGES := \
 563         com.sun.tools.attach \
 564         com.sun.tools.attach.spi, \
 565     API_ROOT := jdk, \
 566     DEST_DIR := attach/spec, \
 567     TITLE := Attach API, \
 568     FIRST_COPYRIGHT_YEAR := 2005, \
 569     DISABLED_DOCLINT := reference, \
 570 ))
 571 
 572 TARGETS += $(attach)
 573 
 574 ################################################################################
 575 
 576 $(eval $(call SetupJavadocGeneration, jconsole, \
 577     MODULES := jdk.jconsole, \
 578     PACKAGES := com.sun.tools.jconsole, \
 579     API_ROOT := jdk, \
 580     DEST_DIR := jconsole/spec, \
 581     TITLE := JConsole API, \
 582     FIRST_COPYRIGHT_YEAR := 2006, \
 583 ))
 584 
 585 TARGETS += $(jconsole)
 586 
 587 ################################################################################
 588 
 589 $(eval $(call SetupJavadocGeneration, jshellapi, \
 590     MODULES := jdk.jshell, \
 591     PACKAGES := \
 592         jdk.jshell \
 593         jdk.jshell.spi \
 594         jdk.jshell.execution \
 595         jdk.jshell.tool, \
 596     API_ROOT := jdk, \
 597     DEST_DIR := jshell, \
 598     TITLE := JShell API, \
 599     FIRST_COPYRIGHT_YEAR := 2015, \
 600     SPLIT_INDEX := TRUE, \
 601 ))
 602 
 603 TARGETS += $(jshellapi)
 604 
 605 ################################################################################
 606 
 607 $(eval $(call SetupJavadocGeneration, treeapi, \
 608     MODULES := jdk.compiler, \
 609     PACKAGES := \
 610         com.sun.source.doctree \
 611         com.sun.source.tree \
 612         com.sun.source.util, \
 613     API_ROOT := jdk, \
 614     DEST_DIR := javac/tree, \
 615     TITLE := Compiler Tree API, \
 616     FIRST_COPYRIGHT_YEAR := 2005, \
 617     SPLIT_INDEX := TRUE, \
 618 ))
 619 
 620 TARGETS += $(treeapi)
 621 
 622 ################################################################################
 623 
 624 $(eval $(call SetupJavadocGeneration, nashornapi, \
 625     MODULES := jdk.scripting.nashorn, \
 626     PACKAGES := \
 627         jdk.nashorn.api.scripting \
 628         jdk.nashorn.api.tree, \
 629     API_ROOT := jdk, \
 630     DEST_DIR := nashorn, \
 631     TITLE := Nashorn API, \
 632     FIRST_COPYRIGHT_YEAR := 2014, \
 633     SPLIT_INDEX := TRUE, \
 634 ))
 635 
 636 TARGETS += $(nashornapi)
 637 
 638 ################################################################################
 639 
 640 $(eval $(call SetupJavadocGeneration, dynalinkapi, \
 641     MODULES := jdk.dynalink, \
 642     PACKAGES := \
 643         jdk.dynalink \
 644         jdk.dynalink.beans \
 645         jdk.dynalink.linker \
 646         jdk.dynalink.linker.support \
 647         jdk.dynalink.support, \
 648     API_ROOT := jdk, \
 649     DEST_DIR := dynalink, \
 650     TITLE := Dynalink API, \
 651     FIRST_COPYRIGHT_YEAR := 2015, \
 652 ))
 653 
 654 TARGETS += $(dynalinkapi)
 655 
 656 ################################################################################
 657 
 658 $(eval $(call SetupJavadocGeneration, sctp, \
 659     MODULES := jdk.sctp, \
 660     PACKAGES := com.sun.nio.sctp, \
 661     API_ROOT := jre, \
 662     DEST_DIR := nio/sctp/spec, \
 663     TITLE := SCTP API, \
 664     FIRST_COPYRIGHT_YEAR := 2009, \
 665 ))
 666 
 667 TARGETS += $(sctp)
 668 
 669 ################################################################################
 670 
 671 $(eval $(call SetupJavadocGeneration, jaccess, \
 672     MODULES := jdk.accessibility, \
 673     PACKAGES := com.sun.java.accessibility.util, \
 674     API_ROOT := jre, \
 675     DEST_DIR := accessibility/jaccess/spec, \
 676     TITLE := JACCESS API, \
 677     FIRST_COPYRIGHT_YEAR := 2002, \
 678 ))
 679 
 680 TARGETS += $(jaccess)
 681 
 682 ################################################################################
 683 
 684 $(eval $(call SetupJavadocGeneration, jdknet, \
 685     MODULES := jdk.net, \
 686     PACKAGES := jdk.net, \
 687     API_ROOT := jre, \
 688     DEST_DIR := net/socketoptions/spec, \
 689     TITLE := jdk.net API, \
 690     FIRST_COPYRIGHT_YEAR := 2014, \
 691     DISABLED_DOCLINT := missing, \
 692 ))
 693 
 694 TARGETS += $(jdknet)
 695 
 696 ################################################################################
 697 # Copy JDWP html file
 698 
 699 JDWP_HTML := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
 700 
 701 $(eval $(call SetupCopyFiles, COPY_JDWP_HTML, \
 702     FILES := $(JDWP_HTML), \
 703     DEST := $(JAVADOC_OUTPUTDIR)/platform/jpda/jdwp, \
 704 ))
 705 
 706 COPY_TARGETS += $(COPY_JDWP_HTML)
 707 
 708 ################################################################################
 709 # Copy JVMTI html file
 710 
 711 # Pick jvmti.html from any jvm variant, they are all the same.
 712 JVMTI_HTML := $(firstword \
 713     $(wildcard $(HOTSPOT_OUTPUTDIR)/variant-*/gensrc/jvmtifiles/jvmti.html))
 714 
 715 $(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
 716     FILES := $(JVMTI_HTML), \
 717     DEST := $(JAVADOC_OUTPUTDIR)/platform/jvmti, \
 718 ))
 719 
 720 COPY_TARGETS += $(COPY_JVMTI_HTML)
 721 
 722 ################################################################################
 723 # Optional target which bundles all generated javadocs into a zip archive.
 724 
 725 JAVADOC_ARCHIVE_NAME := jdk-$(VERSION_STRING)-docs.zip
 726 JAVADOC_ARCHIVE_ASSEMBLY_DIR := $(SUPPORT_OUTPUTDIR)/docs/zip-docs
 727 JAVADOC_ARCHIVE_DIR := $(OUTPUT_ROOT)/bundles
 728 JAVADOC_ARCHIVE := $(JAVADOC_ARCHIVE_DIR)/$(JAVADOC_ARCHIVE_NAME)
 729 
 730 $(JAVADOC_ARCHIVE): $(TARGETS) $(COPY_TARGETS)
 731         $(call LogInfo, Compressing javadoc to single $(JAVADOC_ARCHIVE_NAME))
 732         $(MKDIR) -p $(JAVADOC_ARCHIVE_DIR)
 733         $(RM) -r $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
 734         $(MKDIR) -p $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
 735         all_roots=`$(FIND) $(JAVADOC_OUTPUTDIR) | $(GREP) index.html | grep -v old/doclet`; \
 736         pushd $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); \
 737         for index_file in $${all_roots} ; do \
 738           target_dir=`dirname $${index_file}`; \
 739           name=`$(ECHO) $${target_dir} | $(SED) "s;/spec;;" | $(SED) "s;.*/;;"`; \
 740           $(LN) -s $${target_dir}  $${name}; \
 741         done; \
 742         $(ZIPEXE) -q -r $(JAVADOC_ARCHIVE) * ; \
 743         popd ;
 744 
 745 ZIP_TARGETS += $(JAVADOC_ARCHIVE)
 746 
 747 ################################################################################
 748 # generate .dot files for module graphs
 749 
 750 JAVADOC_MODULE_GRAPHS_DIR := $(SUPPORT_OUTPUTDIR)/docs/module-graphs
 751 JAVADOC_MODULE_GRAPHS := $(JAVADOC_MODULE_GRAPHS_DIR)/java.se.dot
 752 JAVADOC_MODULE_GRAPHS_PROPS := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
 753 
 754 $(JAVADOC_MODULE_GRAPHS): $(BUILD_JIGSAW_TOOLS) $(JAVADOC_MODULE_GRAPHS_PROPS)
 755         $(MKDIR) -p $(@D)
 756         $(TOOL_GENGRAPHS) --spec --output $(JAVADOC_MODULE_GRAPHS_DIR) \
 757             --dot-attributes $(JAVADOC_MODULE_GRAPHS_PROPS)
 758 
 759 MODULE_GRAPH_TARGETS += $(JAVADOC_MODULE_GRAPHS)
 760 
 761 ################################################################################
 762 
 763 # Hook to include the corresponding custom file, if present.
 764 $(eval $(call IncludeCustomExtension, , Javadoc.gmk))
 765 
 766 ################################################################################
 767 
 768 docs-module-graphs: $(MODULE_GRAPH_TARGETS) 
 769 
 770 docs-javadoc: $(TARGETS)
 771 
 772 docs-copy: $(COPY_TARGETS)
 773 
 774 docs-zip: $(ZIP_TARGETS)
 775 
 776 all: docs-module-graphs docs-javadoc docs-copy docs-zip
 777 
 778 .PHONY: default all docs-module-graphs docs-javadoc docs-copy docs-zip