make/Docs.gmk
author ihse
Tue, 30 Oct 2018 09:24:42 +0100
branchihse-manpages-branch
changeset 57006 44fe6d5e9c73
parent 57004 f43f68ae83ed
child 57008 cbd4d5fe2015
permissions -rw-r--r--
For man pages: Depend also on js filter, and css file copy.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48759
ffa68af7da87 8195795: Organize output files by module/package, not just package
jjg
parents: 47459
diff changeset
     1
# Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     2
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     3
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     4
# This code is free software; you can redistribute it and/or modify it
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     5
# under the terms of the GNU General Public License version 2 only, as
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     6
# published by the Free Software Foundation.  Oracle designates this
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     7
# particular file as subject to the "Classpath" exception as provided
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     8
# by Oracle in the LICENSE file that accompanied this code.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     9
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    14
# accompanied this code).
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    15
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    19
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    22
# questions.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    23
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    24
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
    25
default: all
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
    26
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    27
include $(SPEC)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    28
include MakeBase.gmk
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
    29
include Modules.gmk
44983
4e216c0475ee 8179453: Add a proper SetupProcessMarkdown
ihse
parents: 44829
diff changeset
    30
include ProcessMarkdown.gmk
56977
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
    31
include TextFileProcessing.gmk
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
    32
include ZipArchive.gmk
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 46241
diff changeset
    33
include $(TOPDIR)/make/ToolsJdk.gmk
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 46241
diff changeset
    34
include $(TOPDIR)/make/ModuleTools.gmk
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    35
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
    36
# This is needed to properly setup DOCS_MODULES.
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
    37
$(eval $(call ReadImportMetaData))
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
    38
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
    39
################################################################################
44827
56c57aa67d0c 8178042: Allow custom taglets
ihse
parents: 44826
diff changeset
    40
# Hook to include the corresponding custom file, if present.
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47253
diff changeset
    41
$(eval $(call IncludeCustomExtension, Docs.gmk))
44827
56c57aa67d0c 8178042: Allow custom taglets
ihse
parents: 44826
diff changeset
    42
56c57aa67d0c 8178042: Allow custom taglets
ihse
parents: 44826
diff changeset
    43
################################################################################
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    44
# This file generates all documentation for OpenJDK.
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    45
#
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    46
# We will generate API documentation for two different selections of the source
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    47
# code: "Java SE", which contains just the modules covered by the top-level
48841
0937e5f799df 8190378: Removal of CORBA and Java EE modules
lancea
parents: 48759
diff changeset
    48
# module java.se and "JDK", which covers all of Java SE and also all
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    49
# other available modules that should be documented, including imported modules,
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    50
# if any.
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    51
#
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    52
# We will also generate separate, free-standing specifications from either
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    53
# markdown or existing html files.
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    54
#
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    55
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
    56
################################################################################
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
    57
# Javadoc settings
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    58
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
    59
# On top of the sources that was used to compile the JDK, we need some
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
    60
# extra java.rmi sources that are used just for javadoc.
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
    61
MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 46241
diff changeset
    62
    $(SUPPORT_OUTPUTDIR)/rmic/* $(TOPDIR)/src/*/share/doc/stub)
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35817
diff changeset
    63
56891
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
    64
# Should we enable man pages? Allow custom to overwrite.
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
    65
ENABLE_MAN_PAGES ?= true
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
    66
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
    67
# URLs
52318
124af9276e44 8213102: Oracle Unilinks are [301 Moved Permanently] to https://docs.oracle.com
jjg
parents: 52296
diff changeset
    68
JAVADOC_BASE_URL := https://docs.oracle.com/pls/topic/lookup?ctx=javase$(VERSION_NUMBER)&id=homepage
52296
26207007d234 8212994: Links to Oracle websites should use "https:"
iris
parents: 52204
diff changeset
    69
BUG_SUBMIT_URL := https://bugreport.java.com/bugreport/
45613
3d1c96cd5479 8179556: Add specs copyright file
ihse
parents: 45610
diff changeset
    70
COPYRIGHT_URL := {@docroot}/../legal/copyright.html
52296
26207007d234 8212994: Links to Oracle websites should use "https:"
iris
parents: 52204
diff changeset
    71
LICENSE_URL := https://www.oracle.com/technetwork/java/javase/terms/license/java$(VERSION_NUMBER)speclicense.html
26207007d234 8212994: Links to Oracle websites should use "https:"
iris
parents: 52204
diff changeset
    72
REDISTRIBUTION_URL := https://www.oracle.com/technetwork/java/redist-137594.html
44990
db3606f423a3 8140268: Generate link to specification license for JavaDoc API documentation
ihse
parents: 44989
diff changeset
    73
42135
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    74
# In order to get a specific ordering it's necessary to specify the total
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    75
# ordering of tags as the tags are otherwise ordered in order of definition.
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
    76
JAVADOC_TAGS := \
42135
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    77
    -tag beaninfo:X \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    78
    -tag revised:X \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    79
    -tag since.unbundled:X \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    80
    -tag spec:X \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    81
    -tag specdefault:X \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    82
    -tag Note:X \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    83
    -tag ToDo:X \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    84
    -tag 'apiNote:a:API Note:' \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    85
    -tag 'implSpec:a:Implementation Requirements:' \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    86
    -tag 'implNote:a:Implementation Note:' \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    87
    -tag param \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    88
    -tag return \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    89
    -tag throws \
44397
f932d6b9f7fe 8173303: Add module-subgraph images to main platform documentation
mchung
parents: 44071
diff changeset
    90
    -taglet build.tools.taglet.ModuleGraph \
42135
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    91
    -tag since \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    92
    -tag serialData \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    93
    -tag factory \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    94
    -tag see \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    95
    -tag 'jvms:a:See <cite>The Java&trade; Virtual Machine Specification</cite>:' \
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
    96
    -tag 'jls:a:See <cite>The Java&trade; Language Specification</cite>:' \
44826
7a887996ee84 8178725: provide way to link to external documentation
ksrini
parents: 44734
diff changeset
    97
    -taglet build.tools.taglet.ExtLink \
43285
223c3eea12e4 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents: 43171
diff changeset
    98
    -taglet build.tools.taglet.Incubating \
223c3eea12e4 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents: 43171
diff changeset
    99
    -tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
44827
56c57aa67d0c 8178042: Allow custom taglets
ihse
parents: 44826
diff changeset
   100
    $(CUSTOM_JAVADOC_TAGS) \
42135
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
   101
    #
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
   102
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   103
# The reference tags must stay stable to allow for comparisons across the
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   104
# development cycle. If JAVADOC_TAGS needs to change, make sure that
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   105
# REFERENCE_TAGS remains unchanged, by copying and hardcoding, if necessary.
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   106
REFERENCE_TAGS := $(JAVADOC_TAGS)
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   107
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   108
# Which doclint checks to ignore
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   109
JAVADOC_DISABLED_DOCLINT := accessibility html missing syntax reference
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   110
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   111
# The initial set of options for javadoc
46087
2937d486bb2e 8185752: update javadoc options in make/Docs.gmk
jjg
parents: 45775
diff changeset
   112
JAVADOC_OPTIONS := -use -keywords -notimestamp \
2937d486bb2e 8185752: update javadoc options in make/Docs.gmk
jjg
parents: 45775
diff changeset
   113
    -serialwarn -encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
49428
ce86061aff12 8199705: Docs.gmk needs to be updated to remove the -html5 option
bpatel
parents: 49075
diff changeset
   114
    -splitIndex --system none -javafx --expand-requires transitive \
47429
aa31c0a9ebca 8189706: javadoc for the JDK APIs should summarize overridden methods with no specification changes
ksrini
parents: 47314
diff changeset
   115
    --override-methods=summary
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   116
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   117
# The reference options must stay stable to allow for comparisons across the
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   118
# development cycle.
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   119
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   120
    -serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   121
    -html5 -javafx --expand-requires transitive
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   122
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   123
# Should we add DRAFT stamps to the generated javadoc?
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   124
ifeq ($(VERSION_IS_GA), true)
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   125
  IS_DRAFT := false
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   126
else
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   127
  IS_DRAFT := true
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   128
endif
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   129
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   130
################################################################################
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   131
# General text snippets
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   132
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   133
FULL_COMPANY_NAME := Oracle and/or its affiliates
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   134
COMPANY_ADDRESS := 500 Oracle Parkway, Redwood Shores, CA 94065 USA
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
   135
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   136
JAVA_PLATFORM := Java Platform
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   137
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   138
ifeq ($(IS_DRAFT), true)
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   139
  DRAFT_MARKER_STR := <br><strong>DRAFT $(VERSION_STRING)</strong>
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   140
  ifeq ($(VERSION_BUILD), 0)
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   141
    DRAFT_MARKER_TITLE := [ad-hoc build]
43047
28be7f773e4e 8172562: Changing log level on Javadoc causes total rebuild
ihse
parents: 43044
diff changeset
   142
  else
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   143
    DRAFT_MARKER_TITLE := [build $(VERSION_BUILD)]
43047
28be7f773e4e 8172562: Changing log level on Javadoc causes total rebuild
ihse
parents: 43044
diff changeset
   144
  endif
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   145
  DRAFT_TEXT := This specification is not final and is subject to change. \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   146
      Use is subject to <a href="$(LICENSE_URL)">license terms</a>.
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   147
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   148
  # Workaround stylesheet bug
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   149
  HEADER_STYLE := style="margin-top: 9px;"
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   150
else
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   151
  HEADER_STYLE := style="margin-top: 14px;"
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   152
endif
42135
484c28d7fd1b 8170077: Properly parallelize javadoc generation
ihse
parents: 42134
diff changeset
   153
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   154
JAVADOC_BOTTOM := \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   155
    <a href="$(BUG_SUBMIT_URL)">Report a bug or suggest an enhancement</a><br> \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   156
    For further API reference and developer documentation see the \
45108
8ad1bd49f4bc 8180328: Bad links in footer of all javadoc-generated pages
ihse
parents: 45105
diff changeset
   157
    <a href="$(JAVADOC_BASE_URL)" target="_blank">Java SE \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   158
    Documentation</a>, which contains more detailed, \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   159
    developer-targeted descriptions with conceptual overviews, definitions \
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   160
    of terms, workarounds, and working code examples.<br> \
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   161
    Java is a trademark or registered trademark of $(FULL_COMPANY_NAME) in \
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   162
    the US and other countries.<br> \
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   163
    <a href="$(COPYRIGHT_URL)">Copyright</a> \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   164
    &copy; 1993, $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME), \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   165
    $(COMPANY_ADDRESS).<br>All rights reserved. \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   166
    Use is subject to <a href="$(LICENSE_URL)">license terms</a> and the \
44990
db3606f423a3 8140268: Generate link to specification license for JavaDoc API documentation
ihse
parents: 44989
diff changeset
   167
    <a href="$(REDISTRIBUTION_URL)">documentation redistribution policy</a>. \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   168
    $(DRAFT_MARKER_STR) <!-- Version $(VERSION_STRING) -->
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   169
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   170
JAVADOC_TOP := \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   171
    <div style="padding: 6px; text-align: center; font-size: 80%; \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   172
    font-family: DejaVu Sans, Arial, Helvetica, sans-serif; \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   173
    font-weight: normal;">$(DRAFT_TEXT)</div>
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   174
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   175
JDK_INDEX_CONTENT := \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   176
    <!DOCTYPE html> \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   177
    <html lang="en"> \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   178
    <head> \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   179
    <meta http-equiv="refresh" content="0;url=api/index.html"> \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   180
    </head> \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   181
    </html>
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   182
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   183
################################################################################
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   184
# JDK javadoc titles/text snippets
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   185
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   186
JDK_SHORT_NAME := Java SE $(VERSION_SPECIFICATION) &amp; JDK $(VERSION_SPECIFICATION)
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   187
JDK_LONG_NAME := Java<sup>&reg;</sup> Platform, Standard Edition \
45775
e333a1979702 8183251: Meta "keywords" tag malformed in overview-summary.html and related pages
mr
parents: 45617
diff changeset
   188
    &amp;&nbsp;Java&nbsp;Development&nbsp;Kit
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   189
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   190
################################################################################
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   191
# Java SE javadoc titles/text snippets
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   192
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   193
JAVASE_SHORT_NAME := Java SE $(VERSION_SPECIFICATION)
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   194
JAVASE_LONG_NAME := Java<sup>&reg;</sup> Platform, Standard Edition
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   195
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   196
################################################################################
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   197
# Functions
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
   198
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   199
# Helper function for creating a png file from a dot file generated by the
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   200
# GenGraphs tool.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   201
# param 1: SetupJavadocGeneration namespace ($1)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   202
# param 2: module name
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   203
#
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   204
define setup_gengraph_dot_to_png
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   205
  $1_$2_DOT_SRC :=  $$($1_GENGRAPHS_DIR)/$2.dot
48759
ffa68af7da87 8195795: Organize output files by module/package, not just package
jjg
parents: 47459
diff changeset
   206
  $1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2/module-graph.png
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   207
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   208
    # For each module needing a graph, create a png file from the dot file
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   209
    # generated by the GenGraphs tool and store it in the target dir.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   210
    $$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   211
	$$(call MakeDir, $$(@D))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   212
	$$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   213
	    $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC))
42427
2c48c5ffb581 8170648: Move java.net.http package out of Java SE to incubator namespace
michaelm
parents: 42290
diff changeset
   214
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   215
  $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   216
endef
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   217
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   218
# Helper function to create the overview.html file to use with the -overview
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   219
# javadoc option.
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   220
# Returns the filename as $1_OVERVIEW.
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   221
#
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   222
# param 1: SetupJavadocGeneration namespace ($1)
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   223
define create_overview_file
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   224
  $1_OVERVIEW_TEXT := \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   225
      <!DOCTYPE html> \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   226
      <html><head></head><body> \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   227
      #
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   228
  ifneq ($$($1_GROUPS),)
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   229
    $1_OVERVIEW_TEXT += \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   230
      <p>This document is divided into \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   231
      $$(subst 2,two,$$(subst 3,three,$$(words $$($1_GROUPS)))) sections:</p> \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   232
      <blockquote><dl> \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   233
      #
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   234
    $1_OVERVIEW_TEXT += $$(foreach g, $$($1_GROUPS), \
52204
cf3fafc740bb 8211879: Broken links in API overview
pmuthuswamy
parents: 51575
diff changeset
   235
        <dt style="margin-top: 8px;">$$($$g_GROUP_NAME)</dt> \
45775
e333a1979702 8183251: Meta "keywords" tag malformed in overview-summary.html and related pages
mr
parents: 45617
diff changeset
   236
        <dd style="margin-top: 8px;">$$($$g_GROUP_DESCRIPTION)</dd> \
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   237
    )
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   238
    $1_OVERVIEW_TEXT += \
45775
e333a1979702 8183251: Meta "keywords" tag malformed in overview-summary.html and related pages
mr
parents: 45617
diff changeset
   239
        </dl></blockquote> \
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   240
        #
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   241
  endif
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   242
  $1_OVERVIEW_TEXT += \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   243
      </body></html> \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   244
      #
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   245
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   246
  $1_OVERVIEW := $$(SUPPORT_OUTPUTDIR)/docs/$1-overview.html
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   247
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   248
  $1_OVERVIEW_VARDEPS_FILE := $$(call DependOnVariable, $1_OVERVIEW_TEXT, \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   249
      $$($1_OVERVIEW).vardeps)
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   250
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   251
  $$($1_OVERVIEW): $$($1_OVERVIEW_VARDEPS_FILE)
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   252
	$$(call LogInfo, Creating overview.html for $1)
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   253
	$$(call MakeDir, $$(@D))
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   254
	$$(PRINTF) > $$@ '$$($1_OVERVIEW_TEXT)'
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   255
endef
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   256
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   257
################################################################################
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   258
# Setup make rules to create an API documentation collection, using javadoc and
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   259
# other tools if needed.
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   260
#
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   261
# Parameter 1 is the name of the rule. This name is used as variable prefix.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   262
# Targets generated are returned as $1_JAVADOC_TARGETS and
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   263
# $1_MODULEGRAPH_TARGETS. Note that the index.html file will work as a "touch
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   264
# file" for all the magnitude of files that are generated by javadoc.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   265
#
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   266
# Remaining parameters are named arguments. These include:
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   267
#   MODULES - Modules to generate javadoc for
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   268
#   GROUPS - Name of the groups to divide the modules into, if any
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   269
#   SHORT_NAME - The short name of this documentation collection
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   270
#   LONG_NAME - The long name of this documentation collection
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   271
#   TARGET_DIR - Where to store the output
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   272
#
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   273
SetupApiDocsGeneration = $(NamedParamsMacroTemplate)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   274
define SetupApiDocsGenerationBody
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   275
45233
538af025db97 8180480: Use "requires transitive" relationship when determining modules for javadoc
ihse
parents: 45229
diff changeset
   276
  # Figure out all modules, both specified and transitive indirect exports, that
538af025db97 8180480: Use "requires transitive" relationship when determining modules for javadoc
ihse
parents: 45229
diff changeset
   277
  # will be processed by javadoc.
538af025db97 8180480: Use "requires transitive" relationship when determining modules for javadoc
ihse
parents: 45229
diff changeset
   278
  $1_INDIRECT_EXPORTS := $$(call FindTransitiveIndirectDepsForModules, $$($1_MODULES))
538af025db97 8180480: Use "requires transitive" relationship when determining modules for javadoc
ihse
parents: 45229
diff changeset
   279
  $1_ALL_MODULES := $$(sort $$($1_MODULES) $$($1_INDIRECT_EXPORTS))
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   280
50969
3f879ff34084 8206184: docs-reference build fails due to extlink.spec.version property not set
mchung
parents: 50782
diff changeset
   281
  $1_JAVA_ARGS := -Dextlink.spec.version=$$(VERSION_SPECIFICATION)
3f879ff34084 8206184: docs-reference build fails due to extlink.spec.version property not set
mchung
parents: 50782
diff changeset
   282
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   283
  ifeq ($$(ENABLE_FULL_DOCS), true)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   284
    # Tell the ModuleGraph taglet to generate html links to soon-to-be-created
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   285
    # png files with module graphs.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   286
    $1_JAVA_ARGS += -DenableModuleGraph=true
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   287
  endif
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   288
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   289
  # Start with basic options and tags
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   290
  ifeq ($$($1_OPTIONS), )
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   291
    $1_OPTIONS := $$(JAVADOC_OPTIONS)
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   292
  endif
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   293
  ifeq ($$($1_TAGS), )
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   294
    $1_TAGS := $$(JAVADOC_TAGS)
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   295
  endif
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   296
  $1_OPTIONS += $$($1_TAGS)
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   297
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   298
  $1_OPTIONS += --module-source-path $$(MODULES_SOURCE_PATH)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   299
  $1_OPTIONS += --module $$(call CommaList, $$($1_MODULES))
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   300
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   301
  # Create a string like "-Xdoclint:all,-syntax,-html,..."
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   302
  $1_OPTIONS += -Xdoclint:all,$$(call CommaList, $$(addprefix -, \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   303
      $$(JAVADOC_DISABLED_DOCLINT)))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   304
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   305
  $1_DOC_TITLE := $$($1_LONG_NAME)<br>Version $$(VERSION_SPECIFICATION) API \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   306
      Specification
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   307
  $1_WINDOW_TITLE := $$(subst &amp;,&,$$($1_SHORT_NAME)) $$(DRAFT_MARKER_TITLE)
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   308
  $1_HEADER_TITLE := <div $$(HEADER_STYLE)><strong>$$($1_SHORT_NAME)</strong> \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   309
      $$(DRAFT_MARKER_STR)</div>
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   310
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   311
  $1_OPTIONS += -doctitle '$$($1_DOC_TITLE)'
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   312
  $1_OPTIONS += -windowtitle '$$($1_WINDOW_TITLE)'
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   313
  $1_OPTIONS += -header '$$($1_HEADER_TITLE)'
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   314
  $1_OPTIONS += -bottom '$$(JAVADOC_BOTTOM)'
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   315
  ifeq ($$(IS_DRAFT), true)
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   316
    $1_OPTIONS += -top '$$(JAVADOC_TOP)'
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   317
  endif
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   318
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   319
  # Do not store debug level options in VARDEPS.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   320
  ifneq ($$(LOG_LEVEL), trace)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   321
    $1_LOG_OPTION += -quiet
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   322
  else
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   323
    $1_LOG_OPTION += -verbose
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   324
  endif
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   325
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   326
  # Generate the overview.html file. This will return the filename in
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   327
  # $1_OVERVIEW.
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   328
  $$(eval $$(call create_overview_file,$1))
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   329
  $1_OPTIONS += -overview $$($1_OVERVIEW)
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   330
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   331
  $$(foreach g, $$($1_GROUPS), \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   332
    $$(eval $1_OPTIONS += -group "$$($$g_GROUP_NAME)" "$$($$g_GROUP_MODULES)") \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   333
  )
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   334
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   335
  ifeq ($$($1_JAVADOC_CMD), )
50969
3f879ff34084 8206184: docs-reference build fails due to extlink.spec.version property not set
mchung
parents: 50782
diff changeset
   336
    $1_JAVADOC_CMD := $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   337
        $$(NEW_JAVADOC)
50969
3f879ff34084 8206184: docs-reference build fails due to extlink.spec.version property not set
mchung
parents: 50782
diff changeset
   338
  else
56971
b45304f16437 Don't copy .1 files anymore.
ihse
parents: 56950
diff changeset
   339
    $1_OPTIONS += $$(addprefix -J, $$($1_JAVA_ARGS))
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   340
  endif
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   341
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   342
  $1_VARDEPS := $$($1_JAVA_ARGS) $$($1_OPTIONS) $$(MODULES_SOURCE_PATH) \
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   343
      $$($1_ALL_MODULES) $$($1_JAVADOC_CMD)
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   344
  $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   345
      $$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   346
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   347
  # Get a list of all files in all the source dirs for all included modules
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   348
  $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   349
      $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   350
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   351
  # Javadoc creates a lot of files but use index.html as a marker
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   352
  $$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   353
      $$($1_SOURCE_DEPS) $$($1_OVERVIEW)
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   354
	$$(call LogWarn, Generating $1 javadoc for \
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   355
	    $$(words $$($1_ALL_MODULES)) modules)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   356
	$$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   357
	$$(call MakeDir, $$($1_TARGET_DIR))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   358
	$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   359
	    $$($1_JAVADOC_CMD) -d $$($1_TARGET_DIR) \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   360
	        $$($1_OPTIONS) $$($1_LOG_OPTION))
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
   361
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   362
  $1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   363
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   364
  ifeq ($$(ENABLE_FULL_DOCS), true)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   365
    # We have asked ModuleGraph to generate links to png files. Now we must
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   366
    # produce the png files.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   367
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   368
    # Locate which modules has the @moduleGraph tag in their module-info.java
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   369
    $1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   370
      $$(if $$(shell $$(GREP) -e @moduleGraph \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   371
          $$(wildcard $$(addsuffix /module-info.java, \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   372
          $$(call FindModuleSrcDirs, $$m)))), \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   373
        $$m) \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   374
    ))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   375
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   376
    # First we run the GenGraph tool. It will query the module structure of the
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   377
    # running JVM and output .dot files for all existing modules.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   378
    GENGRAPHS_PROPS := \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 46241
diff changeset
   379
        $$(TOPDIR)/make/jdk/src/classes/build/tools/jigsaw/javadoc-graphs.properties
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   380
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   381
    $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   382
    $1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   383
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   384
    $$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS)
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   385
	$$(call LogInfo, Running gengraphs for $1 documentation)
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   386
	$$(call MakeDir, $$($1_GENGRAPHS_DIR))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   387
	$$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   388
	    $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   389
	    --dot-attributes $$(GENGRAPHS_PROPS) && \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   390
	    $$(TOUCH) $$($1_GENGRAPHS_MARKER))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   391
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   392
    # For each module needing a graph, create a png file from the dot file
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   393
    # generated by the GenGraphs tool and store it in the target dir.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   394
    # They will depend on $1_GENGRAPHS_MARKER, and will be added to $1.
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   395
    $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   396
      $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   397
    )
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   398
  endif
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   399
endef
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   400
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   401
################################################################################
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   402
# Setup generation of the JDK API documentation (javadoc + modulegraph)
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   403
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   404
# Define the groups of the JDK API documentation
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   405
JavaSE_GROUP_NAME := Java SE
48841
0937e5f799df 8190378: Removal of CORBA and Java EE modules
lancea
parents: 48759
diff changeset
   406
JavaSE_GROUP_MODULES := $(call ColonList, $(sort java.se \
0937e5f799df 8190378: Removal of CORBA and Java EE modules
lancea
parents: 48759
diff changeset
   407
    $(call FindTransitiveIndirectDepsForModules, java.se)))
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   408
JavaSE_GROUP_DESCRIPTION := \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   409
    The Java Platform, Standard Edition (Java SE) APIs define the core Java \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   410
    platform for general-purpose computing. These APIs are in modules whose \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   411
    names start with {@code java}. \
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   412
    #
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   413
JDK_GROUPS += JavaSE
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   414
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   415
JDK_GROUP_NAME := JDK
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   416
JDK_GROUP_MODULES := jdk.*
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   417
JDK_GROUP_DESCRIPTION := \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   418
    The Java Development Kit (JDK) APIs are specific to the JDK and will not \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   419
    necessarily be available in all implementations of the Java SE Platform. \
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   420
    These APIs are in modules whose names start with {@code jdk}. \
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   421
    #
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   422
JDK_GROUPS += JDK
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   423
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   424
# If we are importing JavaFX, we need a JavaFX group. In an ideal world, this
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   425
# would have been abstracted away to a more proper generic handling of imported
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   426
# modules.
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   427
ifneq ($(findstring javafx., $(IMPORTED_MODULES)), )
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   428
  JavaFX_GROUP_NAME := JavaFX
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   429
  JavaFX_GROUP_MODULES := javafx.*
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   430
  JavaFX_GROUP_DESCRIPTION := \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   431
      The JavaFX APIs define a set of user-interface controls, graphics, \
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   432
      media, and web packages for developing rich client applications. These \
45616
88a3b1082777 8182408: Simplify the API-specification overview page
mr
parents: 45613
diff changeset
   433
      APIs are in modules whose names start with {@code javafx}. \
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   434
      #
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   435
  JDK_GROUPS += JavaFX
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   436
endif
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   437
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   438
# All modules to have docs generated by docs-jdk-api target
49916
3c90c742952e 8202382: Filter docs modules
erikj
parents: 49494
diff changeset
   439
JDK_MODULES := $(sort $(filter-out $(MODULES_FILTER), $(DOCS_MODULES)))
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   440
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   441
$(eval $(call SetupApiDocsGeneration, JDK_API, \
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   442
    MODULES := $(JDK_MODULES), \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   443
    GROUPS := $(JDK_GROUPS), \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   444
    SHORT_NAME := $(JDK_SHORT_NAME), \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   445
    LONG_NAME := $(JDK_LONG_NAME), \
45103
85999d3d05f0 8175825: Stop including pubs repo
ihse
parents: 45095
diff changeset
   446
    TARGET_DIR := $(DOCS_OUTPUTDIR)/api, \
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   447
))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   448
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   449
# Targets generated are returned in JDK_API_JAVADOC_TARGETS and
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   450
# JDK_API_MODULEGRAPH_TARGETS.
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
   451
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   452
################################################################################
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   453
# Setup generation of the Java SE API documentation (javadoc + modulegraph)
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   454
48855
0006d97556ba 8197866: Docs.mk still had a reference to java.se.ee
lancea
parents: 48841
diff changeset
   455
# The Java SE module scope is just java.se and its transitive indirect
45233
538af025db97 8180480: Use "requires transitive" relationship when determining modules for javadoc
ihse
parents: 45229
diff changeset
   456
# exports.
48855
0006d97556ba 8197866: Docs.mk still had a reference to java.se.ee
lancea
parents: 48841
diff changeset
   457
JAVASE_MODULES := java.se
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   458
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   459
$(eval $(call SetupApiDocsGeneration, JAVASE_API, \
45323
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   460
    MODULES := $(JAVASE_MODULES), \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   461
    SHORT_NAME := $(JAVASE_SHORT_NAME), \
52500c1d7f1f 8175824: Adapt javadoc generation to different requirements for JDK and JavaSE
ihse
parents: 45233
diff changeset
   462
    LONG_NAME := $(JAVASE_LONG_NAME), \
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   463
    TARGET_DIR := $(IMAGES_OUTPUTDIR)/javase-docs/api, \
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   464
))
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   465
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   466
# Targets generated are returned in JAVASE_API_JAVADOC_TARGETS and
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   467
# JAVASE_API_MODULEGRAPH_TARGETS.
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 35817
diff changeset
   468
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   469
################################################################################
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   470
# Setup generation of the reference Java SE API documentation (javadoc + modulegraph)
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   471
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   472
# The reference javadoc is just the same as javase, but using the BootJDK javadoc
56971
b45304f16437 Don't copy .1 files anymore.
ihse
parents: 56950
diff changeset
   473
# and a stable set of javadoc options.  Typically it is used for generating
50969
3f879ff34084 8206184: docs-reference build fails due to extlink.spec.version property not set
mchung
parents: 50782
diff changeset
   474
# diffs between the reference javadoc and a javadoc bundle of a specific build
3f879ff34084 8206184: docs-reference build fails due to extlink.spec.version property not set
mchung
parents: 50782
diff changeset
   475
# generated in the same way.
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   476
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   477
$(eval $(call SetupApiDocsGeneration, REFERENCE_API, \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   478
    MODULES := $(JAVASE_MODULES), \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   479
    SHORT_NAME := $(JAVASE_SHORT_NAME), \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   480
    LONG_NAME := $(JAVASE_LONG_NAME), \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   481
    TARGET_DIR := $(IMAGES_OUTPUTDIR)/reference-docs/api, \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   482
    JAVADOC_CMD := $(JAVADOC), \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   483
    OPTIONS := $(REFERENCE_OPTIONS), \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   484
    TAGS := $(REFERENCE_TAGS), \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   485
))
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   486
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   487
# Targets generated are returned in REFERENCE_API_JAVADOC_TARGETS and
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   488
# REFERENCE_API_MODULEGRAPH_TARGETS.
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   489
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   490
################################################################################
45105
bf3dae998ca2 8180208: Provide a new docs bundle page
mchung
parents: 45103
diff changeset
   491
45229
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   492
JDK_INDEX_HTML := $(DOCS_OUTPUTDIR)/index.html
45105
bf3dae998ca2 8180208: Provide a new docs bundle page
mchung
parents: 45103
diff changeset
   493
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   494
$(JDK_INDEX_HTML):
45610
e9dbf9eb0100 8182029: Make the top-level docs index.html to a HTML-level redirect to the API overview page
mchung
parents: 45323
diff changeset
   495
	$(ECHO) '$(JDK_INDEX_CONTENT)' > $@
45105
bf3dae998ca2 8180208: Provide a new docs bundle page
mchung
parents: 45103
diff changeset
   496
45613
3d1c96cd5479 8179556: Add specs copyright file
ihse
parents: 45610
diff changeset
   497
JDK_INDEX_TARGETS += $(JDK_INDEX_HTML)
45229
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   498
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   499
# Copy the global resources
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 46241
diff changeset
   500
GLOBAL_SPECS_RESOURCES_DIR := $(TOPDIR)/make/data/docs-resources/
45229
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   501
$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   502
    SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   503
    FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   504
    DEST := $(DOCS_OUTPUTDIR), \
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   505
))
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   506
JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
45105
bf3dae998ca2 8180208: Provide a new docs bundle page
mchung
parents: 45103
diff changeset
   507
45617
1e5b518f5e14 8182492: docs bundle needs legal notices for 3rd party libraries distributed for javadoc search
mchung
parents: 45616
diff changeset
   508
# Copy the legal notices distributed with the docs bundle
1e5b518f5e14 8182492: docs bundle needs legal notices for 3rd party libraries distributed for javadoc search
mchung
parents: 45616
diff changeset
   509
$(eval $(call SetupCopyFiles, COPY_DOCS_LEGAL_NOTICES, \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 46241
diff changeset
   510
    SRC := $(TOPDIR)/src/jdk.javadoc/share/legal, \
51019
3e416c21e763 8206323: Missing some legal notices in docs bundle
erikj
parents: 50969
diff changeset
   511
    FILES := $(wildcard $(TOPDIR)/src/jdk.javadoc/share/legal/*), \
45617
1e5b518f5e14 8182492: docs bundle needs legal notices for 3rd party libraries distributed for javadoc search
mchung
parents: 45616
diff changeset
   512
    DEST := $(DOCS_OUTPUTDIR)/legal, \
1e5b518f5e14 8182492: docs bundle needs legal notices for 3rd party libraries distributed for javadoc search
mchung
parents: 45616
diff changeset
   513
))
1e5b518f5e14 8182492: docs bundle needs legal notices for 3rd party libraries distributed for javadoc search
mchung
parents: 45616
diff changeset
   514
JDK_INDEX_TARGETS += $(COPY_DOCS_LEGAL_NOTICES)
1e5b518f5e14 8182492: docs bundle needs legal notices for 3rd party libraries distributed for javadoc search
mchung
parents: 45616
diff changeset
   515
45105
bf3dae998ca2 8180208: Provide a new docs bundle page
mchung
parents: 45103
diff changeset
   516
################################################################################
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   517
# Copy JDK specs files
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   518
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   519
# For all html documentation in $module/share/specs directories, copy it
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   520
# unmodified
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   521
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   522
ALL_MODULES := $(call FindAllModules)
44983
4e216c0475ee 8179453: Add a proper SetupProcessMarkdown
ihse
parents: 44829
diff changeset
   523
COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
   524
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   525
$(foreach m, $(ALL_MODULES), \
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   526
  $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
45095
704e6f5e9b6d 8178278: Move Standard Algorithm Names document to specs directory
ihse
parents: 44990
diff changeset
   527
  $(foreach d, $(SPECS_$m), \
704e6f5e9b6d 8178278: Move Standard Algorithm Names document to specs directory
ihse
parents: 44990
diff changeset
   528
    $(if $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
704e6f5e9b6d 8178278: Move Standard Algorithm Names document to specs directory
ihse
parents: 44990
diff changeset
   529
      $(eval $(call SetupCopyFiles, COPY_$m, \
704e6f5e9b6d 8178278: Move Standard Algorithm Names document to specs directory
ihse
parents: 44990
diff changeset
   530
          SRC := $d, \
704e6f5e9b6d 8178278: Move Standard Algorithm Names document to specs directory
ihse
parents: 44990
diff changeset
   531
          FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
45103
85999d3d05f0 8175825: Stop including pubs repo
ihse
parents: 45095
diff changeset
   532
          DEST := $(DOCS_OUTPUTDIR)/specs/, \
45095
704e6f5e9b6d 8178278: Move Standard Algorithm Names document to specs directory
ihse
parents: 44990
diff changeset
   533
      )) \
704e6f5e9b6d 8178278: Move Standard Algorithm Names document to specs directory
ihse
parents: 44990
diff changeset
   534
      $(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
704e6f5e9b6d 8178278: Move Standard Algorithm Names document to specs directory
ihse
parents: 44990
diff changeset
   535
    ) \
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   536
  ) \
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   537
)
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   538
44734
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   539
ifeq ($(ENABLE_FULL_DOCS), true)
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   540
  # For all markdown files in $module/share/specs directories, convert them to
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   541
  # html.
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   542
45229
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   543
  GLOBAL_SPECS_DEFAULT_CSS_FILE := $(DOCS_OUTPUTDIR)/resources/jdk-default.css
44734
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   544
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   545
  $(foreach m, $(ALL_MODULES), \
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   546
    $(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
44983
4e216c0475ee 8179453: Add a proper SetupProcessMarkdown
ihse
parents: 44829
diff changeset
   547
    $(foreach d, $(SPECS_$m), \
4e216c0475ee 8179453: Add a proper SetupProcessMarkdown
ihse
parents: 44829
diff changeset
   548
      $(if $(filter %.md, $(call CacheFind, $d)), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 46241
diff changeset
   549
        $(eval $m_$d_NAME := CONVERT_MARKDOWN_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 46241
diff changeset
   550
        $(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
44983
4e216c0475ee 8179453: Add a proper SetupProcessMarkdown
ihse
parents: 44829
diff changeset
   551
            SRC := $d, \
4e216c0475ee 8179453: Add a proper SetupProcessMarkdown
ihse
parents: 44829
diff changeset
   552
            FILES := $(filter %.md, $(call CacheFind, $d)), \
45103
85999d3d05f0 8175825: Stop including pubs repo
ihse
parents: 45095
diff changeset
   553
            DEST := $(DOCS_OUTPUTDIR)/specs/, \
44983
4e216c0475ee 8179453: Add a proper SetupProcessMarkdown
ihse
parents: 44829
diff changeset
   554
            CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
4e216c0475ee 8179453: Add a proper SetupProcessMarkdown
ihse
parents: 44829
diff changeset
   555
        )) \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 46241
diff changeset
   556
        $(eval JDK_SPECS_TARGETS += $($($m_$d_NAME))) \
44983
4e216c0475ee 8179453: Add a proper SetupProcessMarkdown
ihse
parents: 44829
diff changeset
   557
      ) \
44734
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   558
    ) \
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   559
  )
56891
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   560
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   561
  ifeq ($(ENABLE_MAN_PAGES), true)
56977
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   562
    PANDOC_FILTER := $(SUPPORT_OUTPUTDIR)/docs/pandoc-manpage-filter
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   563
    PANDOC_FILTER_SETUP := $(SUPPORT_OUTPUTDIR)/docs/_pandoc_filter_setup.marker
57006
44fe6d5e9c73 For man pages: Depend also on js filter, and css file copy.
ihse
parents: 57004
diff changeset
   564
    PANDOC_FILTER_JAVASCRIPT := $(TOPDIR)/make/scripts/pandoc-manpage-filter.js
56977
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   565
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   566
    # Create a usable instance of the wrapper script that calls the pandoc filter
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   567
    # (which is written in javascript).
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   568
    $(eval $(call SetupTextFileProcessing, CREATE_PANDOC_FILTER, \
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   569
        SOURCE_FILES := $(TOPDIR)/make/scripts/pandoc-manpage-filter.sh.template, \
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   570
        OUTPUT_FILE := $(PANDOC_FILTER), \
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   571
        REPLACEMENTS := \
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   572
            @@BOOT_JDK@@ => $(BOOT_JDK) ; \
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   573
            @@TOPDIR@@ => $(TOPDIR) ; \
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   574
            @@JJS_FLAGS@@ => $(addprefix -J, $(JAVA_FLAGS_SMALL)), \
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   575
    ))
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   576
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   577
    # Created script must be made executable
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   578
    $(PANDOC_FILTER_SETUP): $(CREATE_PANDOC_FILTER)
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   579
	$(CHMOD) a+rx $(PANDOC_FILTER)
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   580
	$(TOUCH) $@
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   581
57001
ffa0fd3138d7 Explain better why we cannot use filter.
ihse
parents: 57000
diff changeset
   582
    # The norm in man pages is to display code literals as bold, but pandoc
ffa0fd3138d7 Explain better why we cannot use filter.
ihse
parents: 57000
diff changeset
   583
    # "correctly" converts these constructs (encoded in markdown using `...`
ffa0fd3138d7 Explain better why we cannot use filter.
ihse
parents: 57000
diff changeset
   584
    # or ```...```) to \f[C]. Ideally, we should use the filter to encapsulate
ffa0fd3138d7 Explain better why we cannot use filter.
ihse
parents: 57000
diff changeset
   585
    # the Code/CodeBlock in Strong. While this works for Code, pandoc cannot
ffa0fd3138d7 Explain better why we cannot use filter.
ihse
parents: 57000
diff changeset
   586
    # correctly render man page output for CodeBlock wrapped in Strong. So we
ffa0fd3138d7 Explain better why we cannot use filter.
ihse
parents: 57000
diff changeset
   587
    # take the easy way out, and post-process the troff output, replacing
ffa0fd3138d7 Explain better why we cannot use filter.
ihse
parents: 57000
diff changeset
   588
    # \f[C] with \f[CB]. This has the added benefit of working correctly on
ffa0fd3138d7 Explain better why we cannot use filter.
ihse
parents: 57000
diff changeset
   589
    # pandoc prior to version 2.0, which cannot properly produced nested
ffa0fd3138d7 Explain better why we cannot use filter.
ihse
parents: 57000
diff changeset
   590
    # formatting in man pages (see https://github.com/jgm/pandoc/issues/3568).
57000
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   591
    #
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   592
    # As of pandoc 2.3, the termination of formatting is still broken
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   593
    # (see https://github.com/jgm/pandoc/issues/4973). We need to replace
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   594
    # \f[] with \f[R].
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   595
    MAN_POST_PROCESS := $(SED) -e 's/\\f\[C\]/\\f\[CB\]/g' \
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   596
        -e 's/\\f\[\]/\\f\[R\]/g'
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   597
56891
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   598
    # We assume all man pages should reside in section 1
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   599
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   600
    # Generate man pages from markdown
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   601
    $(foreach m, $(ALL_MODULES), \
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   602
      $(eval MAN_$m := $(call FindModuleManDirs, $m)) \
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   603
      $(foreach d, $(MAN_$m), \
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   604
        $(if $(filter %.md, $(call CacheFind, $d)), \
56971
b45304f16437 Don't copy .1 files anymore.
ihse
parents: 56950
diff changeset
   605
        $(eval $m_$d_NAME := MAN_TO_TROFF_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
56950
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   606
          $(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
56891
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   607
              SRC := $d, \
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   608
              FILES := $(filter %.md, $(call CacheFind, $d)), \
56950
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   609
              DEST := $(DOCS_OUTPUTDIR)/man/man1, \
56891
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   610
              FORMAT := man, \
57006
44fe6d5e9c73 For man pages: Depend also on js filter, and css file copy.
ihse
parents: 57004
diff changeset
   611
              EXTRA_DEPS := $(PANDOC_FILTER_SETUP) \
44fe6d5e9c73 For man pages: Depend also on js filter, and css file copy.
ihse
parents: 57004
diff changeset
   612
                  $(PANDOC_FILTER_JAVASCRIPT), \
56977
9221e7c3bf36 Add a pandoc filter for man pages written in javascript, to transform man pages.
ihse
parents: 56971
diff changeset
   613
              FILTER := $(PANDOC_FILTER), \
57000
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   614
              POST_PROCESS := $(MAN_POST_PROCESS), \
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   615
              REPLACEMENTS := @@VERSION_SHORT@@ => $(VERSION_SHORT), \
56891
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   616
          )) \
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   617
        ) \
56950
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   618
        $(eval MAN_PAGE_TARGETS += $($($m_$d_NAME))) \
56891
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   619
      ) \
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   620
    )
56950
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   621
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   622
    # Generate html pages ("man spec") from markdown
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   623
    $(foreach m, $(ALL_MODULES), \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   624
      $(eval MAN_$m := $(call FindModuleManDirs, $m)) \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   625
      $(foreach d, $(MAN_$m), \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   626
        $(if $(filter %.md, $(call CacheFind, $d)), \
56971
b45304f16437 Don't copy .1 files anymore.
ihse
parents: 56950
diff changeset
   627
        $(eval $m_$d_NAME := MAN_TO_HTML_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
56950
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   628
          $(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   629
              SRC := $d, \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   630
              FILES := $(filter %.md, $(call CacheFind, $d)), \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   631
              DEST := $(DOCS_OUTPUTDIR)/specs/man, \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   632
              CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
57000
03413eb7301f Use REPLACEMENTS instead of pre-processing.
ihse
parents: 56977
diff changeset
   633
              REPLACEMENTS := @@VERSION_SHORT@@ => $(VERSION_SHORT), \
56950
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   634
          )) \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   635
        ) \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   636
        $(eval MAN_PAGE_TARGETS += $($($m_$d_NAME))) \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   637
      ) \
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   638
    )
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   639
57006
44fe6d5e9c73 For man pages: Depend also on js filter, and css file copy.
ihse
parents: 57004
diff changeset
   640
    # The html version also needs the css file
44fe6d5e9c73 For man pages: Depend also on js filter, and css file copy.
ihse
parents: 57004
diff changeset
   641
    MAN_PAGE_TARGETS += $(COPY_GLOBAL_RESOURCES)
44fe6d5e9c73 For man pages: Depend also on js filter, and css file copy.
ihse
parents: 57004
diff changeset
   642
44fe6d5e9c73 For man pages: Depend also on js filter, and css file copy.
ihse
parents: 57004
diff changeset
   643
    JDK_SPECS_TARGETS += $(MAN_PAGE_TARGETS)
56971
b45304f16437 Don't copy .1 files anymore.
ihse
parents: 56950
diff changeset
   644
56891
78ed9c424877 Revive "Support for generating man pages from markdown." (changeset f00e76e7d53f
ihse
parents: 51575
diff changeset
   645
  endif
44734
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   646
endif
70bbd6884287 8179022: Add serialization spec as markdown
ihse
parents: 44733
diff changeset
   647
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   648
# Special treatment for generated documentation
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   649
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   650
JDWP_PROTOCOL := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   651
$(eval $(call SetupCopyFiles, COPY_JDWP_PROTOCOL, \
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   652
    FILES := $(JDWP_PROTOCOL), \
45103
85999d3d05f0 8175825: Stop including pubs repo
ihse
parents: 45095
diff changeset
   653
    DEST := $(DOCS_OUTPUTDIR)/specs/jdwp, \
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   654
))
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   655
JDK_SPECS_TARGETS += $(COPY_JDWP_PROTOCOL)
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   656
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   657
# Get jvmti.html from the main jvm variant (all variants' jvmti.html are identical).
49928
ae58e24ce81a 8202383: Custom extensions for jvmti doc
erikj
parents: 49916
diff changeset
   658
JVMTI_HTML ?= $(HOTSPOT_OUTPUTDIR)/variant-$(JVM_VARIANT_MAIN)/gensrc/jvmtifiles/jvmti.html
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 41172
diff changeset
   659
$(eval $(call SetupCopyFiles, COPY_JVMTI_HTML, \
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 41172
diff changeset
   660
    FILES := $(JVMTI_HTML), \
45103
85999d3d05f0 8175825: Stop including pubs repo
ihse
parents: 45095
diff changeset
   661
    DEST := $(DOCS_OUTPUTDIR)/specs, \
41260
4f71f07b30d1 8150736: Excessive disk space used by build system
erikj
parents: 41172
diff changeset
   662
))
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   663
JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
   664
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   665
################################################################################
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   666
# Optional target which bundles all generated javadocs into a zip archive.
37034
b63fd4af003e 8154313: Generated javadoc scattered all over the place
neugens
parents: 36792
diff changeset
   667
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   668
JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47217
diff changeset
   669
JAVADOC_ZIP_FILE := $(OUTPUTDIR)/bundles/$(JAVADOC_ZIP_NAME)
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   670
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   671
$(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
45103
85999d3d05f0 8175825: Stop including pubs repo
ihse
parents: 45095
diff changeset
   672
    SRC := $(DOCS_OUTPUTDIR), \
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   673
    ZIP := $(JAVADOC_ZIP_FILE), \
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   674
    EXTRA_DEPS := $(JDK_API_JAVADOC_TARGETS) $(JDK_API_MODULEGRAPH_TARGETS) \
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   675
        $(JDK_SPECS_TARGETS), \
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   676
))
37034
b63fd4af003e 8154313: Generated javadoc scattered all over the place
neugens
parents: 36792
diff changeset
   677
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   678
ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   679
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   680
################################################################################
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   681
45103
85999d3d05f0 8175825: Stop including pubs repo
ihse
parents: 45095
diff changeset
   682
docs-jdk-api-javadoc: $(JDK_API_JAVADOC_TARGETS) $(JDK_API_CUSTOM_TARGETS)
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   683
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   684
docs-jdk-api-modulegraph: $(JDK_API_MODULEGRAPH_TARGETS)
44397
f932d6b9f7fe 8173303: Add module-subgraph images to main platform documentation
mchung
parents: 44071
diff changeset
   685
45103
85999d3d05f0 8175825: Stop including pubs repo
ihse
parents: 45095
diff changeset
   686
docs-javase-api-javadoc: $(JAVASE_API_JAVADOC_TARGETS) $(JAVASE_API_CUSTOM_TARGETS)
44725
8747b14eb49c 8172312: Update docs target and image for new combined docs
ihse
parents: 44397
diff changeset
   687
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   688
docs-javase-api-modulegraph: $(JAVASE_API_MODULEGRAPH_TARGETS)
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   689
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   690
docs-reference-api-javadoc: $(REFERENCE_API_JAVADOC_TARGETS) $(REFERENCE_API_CUSTOM_TARGETS)
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   691
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   692
docs-reference-api-modulegraph: $(REFERENCE_API_MODULEGRAPH_TARGETS)
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   693
44733
6505f00be6f2 8178038: Copy jdwp-protocol.html to proper location
ihse
parents: 44732
diff changeset
   694
docs-jdk-specs: $(JDK_SPECS_TARGETS)
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   695
45229
88a3fab6006f 8180426: Use standard css file for new docs bundle index.html page
ihse
parents: 45108
diff changeset
   696
docs-jdk-index: $(JDK_INDEX_TARGETS)
45105
bf3dae998ca2 8180208: Provide a new docs bundle page
mchung
parents: 45103
diff changeset
   697
56950
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   698
man-pages: $(MAN_PAGE_TARGETS)
55725429863a Make pandoc conversion of man pages work again.
ihse
parents: 56891
diff changeset
   699
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   700
docs-zip: $(ZIP_TARGETS)
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   701
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   702
all: docs-jdk-api-javadoc docs-jdk-api-modulegraph docs-javase-api-javadoc \
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   703
    docs-javase-api-modulegraph docs-reference-api-javadoc \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   704
    docs-reference-api-modulegraph docs-jdk-specs docs-jdk-index docs-zip
41652
a0664e2b49a1 8168772: Convert javadoc generation to build-infra standards
ihse
parents: 41260
diff changeset
   705
44726
04aa2c065f5c 8176785: Add build support to generate PNG file from .dot file
ihse
parents: 44725
diff changeset
   706
.PHONY: default all docs-jdk-api-javadoc docs-jdk-api-modulegraph \
47432
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   707
    docs-javase-api-javadoc docs-javase-api-modulegraph \
28d6070f5f2f 8189056: javadoc target for stable specdiff comparisons
ihse
parents: 47429
diff changeset
   708
    docs-reference-api-javadoc docs-reference-api-modulegraph docs-jdk-specs \
45105
bf3dae998ca2 8180208: Provide a new docs bundle page
mchung
parents: 45103
diff changeset
   709
    docs-jdk-index docs-zip