1 #
   2 # Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 # This must be the first rule
  27 default: all
  28 
  29 include $(SPEC)
  30 include MakeBase.gmk
  31 include Modules.gmk
  32 include JavaCompilation.gmk
  33 include SetupJavaCompilers.gmk
  34 
  35 # Hook to include the corresponding custom file, if present.
  36 $(eval $(call IncludeCustomExtension, CompileJavaModules.gmk))
  37 
  38 ################################################################################
  39 # Module specific build settings
  40 
  41 java.base_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline
  42 java.base_COPY += .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties
  43 java.base_CLEAN += intrinsic.properties
  44 
  45 java.base_EXCLUDE_FILES += \
  46   $(TOPDIR)/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java
  47 
  48 java.base_EXCLUDES += java/lang/doc-files
  49 
  50 # Exclude BreakIterator classes that are just used in compile process to generate
  51 # data files and shouldn't go in the product
  52 java.base_EXCLUDE_FILES += sun/text/resources/BreakIteratorRules.java
  53 
  54 ifeq ($(call isTargetOs, solaris), false)
  55   java.base_EXCLUDE_FILES += \
  56       SolarisLoginModule.java \
  57       SolarisSystem.java \
  58       #
  59 endif
  60 
  61 ifeq ($(call isTargetOs, solaris macosx aix), false)
  62   java.base_EXCLUDE_FILES += sun/nio/fs/PollingWatchService.java
  63 endif
  64 
  65 ifeq ($(call isTargetOs, windows), true)
  66   java.base_EXCLUDE_FILES += \
  67       sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \
  68       #
  69 endif
  70 
  71 ################################################################################
  72 
  73 java.compiler_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
  74 
  75 ################################################################################
  76 
  77 java.datatransfer_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*'
  78 java.datatransfer_COPY += flavormap.properties
  79 
  80 ################################################################################
  81 
  82 java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference \
  83     '-Xdoclint/package:java.*,javax.*' -Xlint:exports \
  84     --doclint-format html4
  85 java.desktop_COPY += .gif .png .wav .txt .xml .css .pf
  86 java.desktop_CLEAN += iio-plugin.properties cursors.properties
  87 
  88 java.desktop_EXCLUDES += \
  89     java/awt/doc-files \
  90     javax/swing/doc-files \
  91     javax/swing/text/doc-files \
  92     javax/swing/plaf/synth/doc-files \
  93     javax/swing/undo/doc-files \
  94     sun/awt/X11/doc-files \
  95     #
  96 
  97 java.desktop_EXCLUDE_FILES += \
  98     javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
  99     javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
 100     javax/swing/plaf/nimbus/ScrollBarPainter.java \
 101     javax/swing/plaf/nimbus/SliderPainter.java \
 102     javax/swing/plaf/nimbus/SpinnerPainter.java \
 103     javax/swing/plaf/nimbus/SplitPanePainter.java \
 104     javax/swing/plaf/nimbus/TabbedPanePainter.java \
 105     sun/awt/resources/security-icon-bw16.png \
 106     sun/awt/resources/security-icon-bw24.png \
 107     sun/awt/resources/security-icon-bw32.png \
 108     sun/awt/resources/security-icon-bw48.png \
 109     sun/awt/resources/security-icon-interim16.png \
 110     sun/awt/resources/security-icon-interim24.png \
 111     sun/awt/resources/security-icon-interim32.png \
 112     sun/awt/resources/security-icon-interim48.png \
 113     sun/awt/resources/security-icon-yellow16.png \
 114     sun/awt/resources/security-icon-yellow24.png \
 115     sun/awt/resources/security-icon-yellow32.png \
 116     sun/awt/resources/security-icon-yellow48.png \
 117     sun/awt/X11/java-icon16.png \
 118     sun/awt/X11/java-icon24.png \
 119     sun/awt/X11/java-icon32.png \
 120     sun/awt/X11/java-icon48.png \
 121     .template \
 122     #
 123 
 124 ifeq ($(call isTargetOs, macosx), true)
 125   # exclude all X11 on Mac.
 126   java.desktop_EXCLUDES += \
 127       sun/awt/X11 \
 128       sun/java2d/x11 \
 129       sun/java2d/jules \
 130       sun/java2d/xr \
 131       com/sun/java/swing/plaf/gtk \
 132       #
 133   java.desktop_EXCLUDE_FILES += \
 134       $(wildcard $(TOPDIR)/src/java.desktop/unix/classes/sun/java2d/*.java) \
 135       $(wildcard $(TOPDIR)/src/java.desktop/unix/classes/sun/java2d/opengl/*.java) \
 136       $(wildcard $(TOPDIR)/src/java.desktop/unix/classes/sun/awt/*.java) \
 137       $(wildcard $(TOPDIR)/src/java.desktop/unix/classes/sun/font/*.java) \
 138       #
 139 else
 140   # TBD: figure out how to eliminate this long list
 141   java.desktop_EXCLUDE_FILES += \
 142       sun/awt/X11/ScreenFormat.java \
 143       sun/awt/X11/XArc.java \
 144       sun/awt/X11/XChar2b.java \
 145       sun/awt/X11/XCharStruct.java \
 146       sun/awt/X11/XClassHint.java \
 147       sun/awt/X11/XComposeStatus.java \
 148       sun/awt/X11/XExtCodes.java \
 149       sun/awt/X11/XFontProp.java \
 150       sun/awt/X11/XFontSetExtents.java \
 151       sun/awt/X11/XFontStruct.java \
 152       sun/awt/X11/XGCValues.java \
 153       sun/awt/X11/XHostAddress.java \
 154       sun/awt/X11/XIMCallback.java \
 155       sun/awt/X11/XIMHotKeyTrigger.java \
 156       sun/awt/X11/XIMHotKeyTriggers.java \
 157       sun/awt/X11/XIMPreeditCaretCallbackStruct.java \
 158       sun/awt/X11/XIMPreeditDrawCallbackStruct.java \
 159       sun/awt/X11/XIMPreeditStateNotifyCallbackStruct.java \
 160       sun/awt/X11/XIMStatusDrawCallbackStruct.java \
 161       sun/awt/X11/XIMStringConversionCallbackStruct.java \
 162       sun/awt/X11/XIMStringConversionText.java \
 163       sun/awt/X11/XIMStyles.java \
 164       sun/awt/X11/XIMText.java \
 165       sun/awt/X11/XIMValuesList.java \
 166       sun/awt/X11/XImage.java \
 167       sun/awt/X11/XKeyboardControl.java \
 168       sun/awt/X11/XKeyboardState.java \
 169       sun/awt/X11/XOMCharSetList.java \
 170       sun/awt/X11/XOMFontInfo.java \
 171       sun/awt/X11/XOMOrientation.java \
 172       sun/awt/X11/XPoint.java \
 173       sun/awt/X11/XRectangle.java \
 174       sun/awt/X11/XSegment.java \
 175       sun/awt/X11/XStandardColormap.java \
 176       sun/awt/X11/XTextItem.java \
 177       sun/awt/X11/XTextItem16.java \
 178       sun/awt/X11/XTextProperty.java \
 179       sun/awt/X11/XTimeCoord.java \
 180       sun/awt/X11/XWindowChanges.java \
 181       sun/awt/X11/XdbeSwapInfo.java \
 182       sun/awt/X11/XmbTextItem.java \
 183       sun/awt/X11/XwcTextItem.java
 184 endif
 185 
 186 ifeq ($(call isTargetOs, windows), true)
 187   java.desktop_EXCLUDES += com/sun/java/swing/plaf/gtk
 188 endif
 189 
 190 ifdef BUILD_HEADLESS_ONLY
 191   java.desktop_EXCLUDES += sun/applet
 192 endif
 193 
 194 ifeq ($(call isTargetOs, windows macosx), false)
 195   java.desktop_EXCLUDE_FILES += sun/awt/AWTCharset.java
 196 endif
 197 
 198 # These files do not appear in the build result of the old build. This
 199 # is because they are generated sources, but the AUTO_JAVA_FILES won't
 200 # pick them up since they aren't generated when the source dirs are
 201 # searched and they aren't referenced by any other classes so they won't
 202 # be picked up by implicit compilation. On a rebuild, they are picked up
 203 # and compiled. Exclude them here to produce the same rt.jar as the old
 204 # build does when building just once.
 205 java.desktop_EXCLUDE_FILES += \
 206     javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
 207     javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
 208     javax/swing/plaf/nimbus/ScrollBarPainter.java \
 209     javax/swing/plaf/nimbus/SliderPainter.java \
 210     javax/swing/plaf/nimbus/SpinnerPainter.java \
 211     javax/swing/plaf/nimbus/SplitPanePainter.java \
 212     javax/swing/plaf/nimbus/TabbedPanePainter.java \
 213     #
 214 
 215 ################################################################################
 216 
 217 java.scripting_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 218 java.scripting_COPY += .js
 219 java.scripting_CLEAN += .properties
 220 
 221 ################################################################################
 222 
 223 java.instrument_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
 224 
 225 ################################################################################
 226 
 227 java.logging_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*'
 228 
 229 ################################################################################
 230 
 231 java.management_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*'
 232 
 233 ################################################################################
 234 
 235 java.management.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:javax.*'
 236 
 237 ################################################################################
 238 
 239 java.prefs_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 240 
 241 ################################################################################
 242 
 243 java.transaction.xa_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:javax.*'
 244 
 245 ################################################################################
 246 
 247 java.sql_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 248 java.sql_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
 249 
 250 ################################################################################
 251 
 252 java.sql.rowset_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
 253 java.sql.rowset_CLEAN_FILES += $(wildcard \
 254     $(TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \
 255     $(TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties)
 256 
 257 ################################################################################
 258 
 259 java.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 260 java.rmi_CLEAN_FILES += $(wildcard \
 261     $(TOPDIR)/src/java.rmi/share/classes/sun/rmi/registry/resources/*.properties \
 262     $(TOPDIR)/src/java.rmi/share/classes/sun/rmi/server/resources/*.properties)
 263 
 264 ################################################################################
 265 
 266 java.xml_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility \
 267     '-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \
 268     javax.xml.transform javax.xml.validation javax.xml.xpath)'
 269 java.xml_CLEAN += .properties
 270 
 271 ################################################################################
 272 
 273 java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' -Xlint:-exports
 274 java.naming_CLEAN += jndiprovider.properties
 275 
 276 ################################################################################
 277 
 278 java.security.jgss_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 279 
 280 ################################################################################
 281 
 282 java.smartcardio_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
 283 
 284 ################################################################################
 285 
 286 java.xml.crypto_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
 287 java.xml.crypto_COPY += .dtd .xml
 288 java.xml.crypto_CLEAN += .properties
 289 
 290 ################################################################################
 291 
 292 jdk.charsets_COPY += .dat
 293 
 294 ################################################################################
 295 
 296 ################################################################################
 297 
 298 jdk.compiler_ADD_JAVAC_FLAGS += -Xdoclint:all/protected \
 299     '-Xdoclint/package:-com.sun.tools.*,-jdk.internal.*,sun.tools.serialver.resources.*' \
 300     -XDstringConcat=inline
 301 jdk.compiler_CLEAN_FILES += $(wildcard \
 302     $(patsubst %, $(TOPDIR)/src/jdk.compiler/share/classes/%/*.properties, \
 303         sun/tools/serialver/resources))
 304 
 305 ################################################################################
 306 
 307 jdk.hotspot.agent_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides
 308 jdk.hotspot.agent_COPY += .gif .png sa.js .properties
 309 
 310 ################################################################################
 311 
 312 jdk.editpad_COPY += .properties
 313 
 314 ################################################################################
 315 
 316 jdk.jshell_COPY += .jsh .properties
 317 
 318 ################################################################################
 319 
 320 jdk.internal.le_COPY += .properties .caps .txt
 321 
 322 ################################################################################
 323 
 324 jdk.internal.opt_COPY += .properties
 325 
 326 ################################################################################
 327 
 328 jdk.jcmd_COPY += _options
 329 
 330 ################################################################################
 331 
 332 jdk.dynalink_CLEAN += .properties
 333 
 334 ################################################################################
 335 
 336 jdk.javadoc_COPY += .xml .css .js .png
 337 
 338 ################################################################################
 339 
 340 jdk.jartool_ADD_JAVAC_FLAGS += -XDstringConcat=inline
 341 
 342 ################################################################################
 343 
 344 jdk.scripting.nashorn_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides
 345 jdk.scripting.nashorn_COPY := .properties .js
 346 
 347 ################################################################################
 348 
 349 jdk.scripting.nashorn.shell_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides
 350 jdk.scripting.nashorn.shell_COPY += .js .properties
 351 
 352 ################################################################################
 353 
 354 jdk.rmic_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
 355 jdk.rmic_CLEAN += .properties
 356 
 357 ################################################################################
 358 
 359 # No SCTP implementation on Mac OS X or AIX. These classes should be excluded.
 360 SCTP_IMPL_CLASSES = \
 361     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationChange.java \
 362     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationImpl.java \
 363     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/PeerAddrChange.java \
 364     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/ResultContainer.java \
 365     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpChannelImpl.java \
 366     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java \
 367     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java \
 368     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNotification.java \
 369     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java \
 370     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SendFailed.java \
 371     $(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/Shutdown.java
 372 
 373 ifeq ($(call isTargetOs, macosx), true)
 374   jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES)
 375 endif
 376 
 377 ifeq ($(call isTargetOs, aix), true)
 378   jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES)
 379 endif
 380 
 381 ################################################################################
 382 
 383 jdk.jconsole_COPY += .gif .png
 384 
 385 jdk.jconsole_CLEAN_FILES += $(wildcard \
 386     $(TOPDIR)/src/jdk.jconsole/share/classes/sun/tools/jconsole/resources/*.properties)
 387 
 388 ################################################################################
 389 
 390 jdk.jdeps_COPY += .txt
 391 
 392 jdk.jdeps_CLEAN_FILES += $(wildcard \
 393     $(TOPDIR)/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/*.properties \
 394     $(TOPDIR)/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/*.properties)
 395 
 396 ################################################################################
 397 
 398 jdk.jdi_EXCLUDES += \
 399     com/sun/tools/example/debug/bdi \
 400     com/sun/tools/example/debug/event \
 401     com/sun/tools/example/debug/gui \
 402     com/sun/jdi/doc-files \
 403     #
 404 
 405 jdk.jdi_EXCLUDE_FILES += jdi-overview.html
 406 
 407 ################################################################################
 408 
 409 jdk.dev_CLEAN_FILES += $(wildcard \
 410     $(patsubst %, $(TOPDIR)/src/jdk.dev/share/classes/%/*.properties, \
 411         com/sun/tools/script/shell))
 412 
 413 jdk.dev_COPY += .js oqlhelp.html .txt
 414 
 415 ################################################################################
 416 
 417 jdk.internal.jvmstat_COPY += aliasmap
 418 
 419 ################################################################################
 420 
 421 # -parameters provides method's parameters information in class file,
 422 # JVMCI compilers make use of that information for various sanity checks.
 423 # Don't use Indy strings concatenation to have good JVMCI startup performance.
 424 # The exports are needed since JVMCI is dynamically exported (see
 425 # jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo).
 426 
 427 jdk.internal.vm.ci_ADD_JAVAC_FLAGS += -parameters -Xlint:-exports -XDstringConcat=inline
 428 
 429 ################################################################################
 430 
 431 jdk.internal.vm.compiler_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
 432     --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler \
 433     --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler \
 434     --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler \
 435     --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.site=jdk.internal.vm.compiler \
 436     --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.stack=jdk.internal.vm.compiler \
 437     --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=jdk.internal.vm.compiler \
 438     --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=jdk.internal.vm.compiler \
 439     --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=jdk.internal.vm.compiler \
 440     --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=jdk.internal.vm.compiler \
 441     --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=jdk.internal.vm.compiler \
 442     --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=jdk.internal.vm.compiler \
 443     --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=jdk.internal.vm.compiler \
 444     --add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=jdk.internal.vm.compiler \
 445     #
 446 
 447 jdk.internal.vm.compiler_EXCLUDES += \
 448     jdk.internal.vm.compiler.collections.test \
 449     jdk.tools.jaotc.test \
 450     org.graalvm.compiler.api.directives.test \
 451     org.graalvm.compiler.api.test \
 452     org.graalvm.compiler.asm.aarch64.test \
 453     org.graalvm.compiler.asm.amd64.test \
 454     org.graalvm.compiler.asm.sparc.test \
 455     org.graalvm.compiler.asm.test \
 456     org.graalvm.compiler.core.aarch64.test \
 457     org.graalvm.compiler.core.amd64.test \
 458     org.graalvm.compiler.core.jdk9.test \
 459     org.graalvm.compiler.core.match.processor \
 460     org.graalvm.compiler.core.test \
 461     org.graalvm.compiler.debug.test \
 462     org.graalvm.compiler.graph.test \
 463     org.graalvm.compiler.hotspot.amd64.test \
 464     org.graalvm.compiler.hotspot.jdk9.test \
 465     org.graalvm.compiler.hotspot.lir.test \
 466     org.graalvm.compiler.hotspot.sparc.test \
 467     org.graalvm.compiler.hotspot.test \
 468     org.graalvm.compiler.jtt \
 469     org.graalvm.compiler.lir.jtt \
 470     org.graalvm.compiler.lir.test \
 471     org.graalvm.compiler.loop.test \
 472     org.graalvm.compiler.microbenchmarks \
 473     org.graalvm.compiler.nodeinfo.processor \
 474     org.graalvm.compiler.nodes.test \
 475     org.graalvm.compiler.options.processor \
 476     org.graalvm.compiler.options.test \
 477     org.graalvm.compiler.phases.common.test \
 478     org.graalvm.compiler.processor \
 479     org.graalvm.compiler.replacements.jdk12.test \
 480     org.graalvm.compiler.replacements.jdk9.test \
 481     org.graalvm.compiler.replacements.processor \
 482     org.graalvm.compiler.replacements.test \
 483     org.graalvm.compiler.serviceprovider.processor \
 484     org.graalvm.compiler.test \
 485     org.graalvm.compiler.virtual.bench \
 486     org.graalvm.micro.benchmarks \
 487     org.graalvm.util.test \
 488     #
 489 
 490 ################################################################################
 491 
 492 # -parameters provides method's parameters information in class file,
 493 # JVMCI compilers make use of that information for various sanity checks.
 494 # Don't use Indy strings concatenation to have good JAOTC startup performance.
 495 # The exports are needed since JVMCI is dynamically exported (see
 496 # jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo).
 497 
 498 jdk.aot_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
 499     --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler,jdk.aot \
 500     --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler,jdk.aot \
 501     --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler,jdk.aot \
 502     --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.site=jdk.internal.vm.compiler,jdk.aot \
 503     --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.stack=jdk.internal.vm.compiler,jdk.aot \
 504     --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=jdk.internal.vm.compiler,jdk.aot \
 505     --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=jdk.internal.vm.compiler,jdk.aot \
 506     --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=jdk.internal.vm.compiler,jdk.aot \
 507     --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=jdk.internal.vm.compiler,jdk.aot \
 508     --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=jdk.internal.vm.compiler,jdk.aot \
 509     --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=jdk.internal.vm.compiler,jdk.aot \
 510     --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=jdk.internal.vm.compiler,jdk.aot \
 511     --add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=jdk.internal.vm.compiler,jdk.aot \
 512     #
 513 
 514 jdk.aot_EXCLUDES += \
 515     jdk.tools.jaotc.test
 516     #
 517 
 518 ################################################################################
 519 
 520 sun.charsets_COPY += .dat
 521 
 522 ################################################################################
 523 
 524 jdk.localedata_COPY += _dict _th
 525 # Exclude BreakIterator classes that are just used in compile process to generate
 526 # data files and shouldn't go in the product
 527 jdk.localedata_EXCLUDE_FILES += sun/text/resources/ext/BreakIteratorRules_th.java
 528 jdk.localedata_KEEP_ALL_TRANSLATIONS := true
 529 ################################################################################
 530 
 531 # There is an issue in sjavac that triggers a warning in jdk.jfr that isn't
 532 # triggered without sjavac.
 533 ifeq ($(ENABLE_SJAVAC), yes)
 534   jdk.jfr_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
 535 endif
 536 jdk.jfr_COPY := .xsd .xml .dtd
 537 jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline -Xlint:-exports
 538 
 539 ################################################################################
 540 # If this is an imported module that has prebuilt classes, only compile
 541 # module-info.java.
 542 ifneq ($(IMPORT_MODULES_CLASSES), )
 543   IMPORT_MODULE_DIR := $(IMPORT_MODULES_CLASSES)/$(MODULE)
 544   ifneq ($(wildcard $(IMPORT_MODULE_DIR)), )
 545     $(MODULE)_INCLUDE_FILES := module-info.java
 546   endif
 547 else
 548   IMPORT_MODULE_DIR :=
 549 endif
 550 
 551 ################################################################################
 552 # Setup the compilation for the module
 553 #
 554 MODULE_SRC_DIRS := $(call FindModuleSrcDirs, $(MODULE))
 555 
 556 # The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying
 557 # JDK_FILTER at the make command line, only a subset of the JDK java files will
 558 # be recompiled. If multiple paths are separated by comma, convert that into a
 559 # space separated list.
 560 JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
 561 ifeq ($(JDK_FILTER), )
 562   FAIL_NO_SRC := true
 563 else
 564   # When using JDK_FILTER, most module java compilations will end up finding
 565   # no source files. Don't let that fail the build.
 566   FAIL_NO_SRC := false
 567 endif
 568 
 569 # Get the complete module source path.
 570 MODULESOURCEPATH := $(call GetModuleSrcPath)
 571 
 572 # Add imported modules to the modulepath
 573 MODULEPATH := $(call PathList, $(IMPORT_MODULES_CLASSES))
 574 
 575 ifeq ($(MODULE), jdk.internal.vm.ci)
 576   ## WORKAROUND jdk.internal.vm.ci source structure issue
 577   JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \
 578       $(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
 579           $(wildcard $(TOPDIR)/src/$(MODULE)/share/classes/*/src)))
 580   MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))
 581 endif
 582 
 583 ifeq ($(MODULE), jdk.internal.vm.compiler)
 584   ## WORKAROUND jdk.internal.vm.compiler source structure issue
 585   VM_COMPILER_MODULESOURCEPATH := $(MODULESOURCEPATH) \
 586       $(subst /$(MODULE)/,/*/, $(filter-out %processor/src %test/src %jtt/src %bench/src %microbenchmarks/src, \
 587           $(wildcard $(TOPDIR)/src/$(MODULE)/share/classes/*/src)))
 588   MODULESOURCEPATH := $(call PathList, $(VM_COMPILER_MODULESOURCEPATH))
 589 endif
 590 
 591 ifeq ($(MODULE), jdk.aot)
 592   ## WORKAROUND jdk.aot source structure issue
 593   AOT_MODULESOURCEPATH := $(MODULESOURCEPATH) \
 594       $(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
 595           $(wildcard $(TOPDIR)/src/$(MODULE)/share/classes/*/src)))
 596   MODULESOURCEPATH := $(call PathList, $(AOT_MODULESOURCEPATH))
 597 endif
 598 
 599 $(eval $(call SetupJavaCompilation, $(MODULE), \
 600     SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
 601     MODULE := $(MODULE), \
 602     SRC := $(wildcard $(MODULE_SRC_DIRS)), \
 603     INCLUDES := $(JDK_USER_DEFINED_FILTER), \
 604     FAIL_NO_SRC := $(FAIL_NO_SRC), \
 605     BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
 606     HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
 607     CREATE_API_DIGEST := true, \
 608     ADD_JAVAC_FLAGS := \
 609         $($(MODULE)_ADD_JAVAC_FLAGS) \
 610         --module-source-path $(MODULESOURCEPATH) \
 611         --module-path $(MODULEPATH) \
 612         --system none, \
 613 ))
 614 
 615 TARGETS += $($(MODULE)) $($(MODULE)_COPY_EXTRA)
 616 
 617 # Declare dependencies between java compilations of different modules.
 618 # Since the other modules are declared in different invocations of this file,
 619 # use the macro to find the correct target file to depend on.
 620 # Only the javac compilation actually depends on other modules so limit
 621 # dependency declaration to that by using the *_COMPILE_TARGET variable.
 622 $($(MODULE)_COMPILE_TARGET): $(foreach d, $(call FindDepsForModule, $(MODULE)), \
 623     $(call SetupJavaCompilationApiTarget, $d, \
 624         $(if $($d_BIN), $($d_BIN), $(JDK_OUTPUTDIR)/modules/$d)))
 625 
 626 ################################################################################
 627 # Copy zh_HK properties files from zh_TW
 628 
 629 $(JDK_OUTPUTDIR)/modules/%_zh_HK.properties: $(JDK_OUTPUTDIR)/modules/%_zh_TW.properties
 630         $(install-file)
 631 
 632 CreateHkTargets = \
 633     $(call FilterExcludedTranslations, \
 634        $(patsubst $(TOPDIR)/src/%, $(JDK_OUTPUTDIR)/modules/%, \
 635          $(subst /share/classes,, \
 636             $(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $1)) \
 637          ) \
 638        ), \
 639        .properties \
 640     )
 641 
 642 ifeq ($(MODULE), java.sql.rowset)
 643   TARGETS += $(call CreateHkTargets, $(java.sql.rowset_CLEAN_FILES))
 644 endif
 645 
 646 ifeq ($(MODULE), java.rmi)
 647   TARGETS += $(call CreateHkTargets, $(java.rmi_CLEAN_FILES))
 648 endif
 649 
 650 ################################################################################
 651 # If this is an imported module, copy the pre built classes and resources into
 652 # the modules output dir
 653 
 654 ifneq ($(wildcard $(IMPORT_MODULE_DIR)), )
 655   $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
 656       $(call FindFiles, $(IMPORT_MODULE_DIR))
 657         $(call MakeDir, $(@D))
 658         # Do not delete marker and build meta data files
 659         $(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))
 660         $(CP) -R $(IMPORT_MODULE_DIR)/* $(@D)/
 661         $(TOUCH) $@
 662 
 663   TARGETS += $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker
 664 
 665   # Add this dependency to avoid a race between compiling module-info.java and
 666   # importing the classes.
 667   $($(MODULE)_COMPILE_TARGET): $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker
 668 endif
 669 
 670 ################################################################################
 671 
 672 ifeq ($(MODULE), jdk.scripting.nashorn)
 673   include CompileJavaModulesNashorn.gmk
 674 endif
 675 
 676 ################################################################################
 677 
 678 $(eval $(call IncludeCustomExtension, CompileJavaModules-post.gmk))
 679 
 680 ################################################################################
 681 
 682 all: $(TARGETS)
 683 
 684 .PHONY: all