CompileJavaModules.gmk revision 1243:56e20ce67f01
161981Sbrian# 261981Sbrian# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 361981Sbrian# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 461981Sbrian# 561981Sbrian# This code is free software; you can redistribute it and/or modify it 661981Sbrian# under the terms of the GNU General Public License version 2 only, as 761981Sbrian# published by the Free Software Foundation. Oracle designates this 861981Sbrian# particular file as subject to the "Classpath" exception as provided 961981Sbrian# by Oracle in the LICENSE file that accompanied this code. 1061981Sbrian# 1161981Sbrian# This code is distributed in the hope that it will be useful, but WITHOUT 1261981Sbrian# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1361981Sbrian# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1461981Sbrian# version 2 for more details (a copy is included in the LICENSE file that 1561981Sbrian# accompanied this code). 1661981Sbrian# 1761981Sbrian# You should have received a copy of the GNU General Public License version 1861981Sbrian# 2 along with this work; if not, write to the Free Software Foundation, 1961981Sbrian# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2061981Sbrian# 2161981Sbrian# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2261981Sbrian# or visit www.oracle.com if you need additional information or have any 2361981Sbrian# questions. 2461981Sbrian# 2565843Sbrian 2665843Sbrian# This must be the first rule 2765843Sbriandefault: all 2865843Sbrian 2965843Sbrianinclude $(SPEC) 3065843Sbrianinclude MakeBase.gmk 3165843Sbrianinclude Modules.gmk 3265843Sbrianinclude JavaCompilation.gmk 3365843Sbrianinclude SetupJavaCompilers.gmk 3465843Sbrian 3561981Sbrian# Hook to include the corresponding custom file, if present. 3661981Sbrian$(eval $(call IncludeCustomExtension, , CompileJavaModules.gmk)) 3761981Sbrian 3861981Sbrian################################################################################ 3961981Sbrian# Module specific build settings 4061981Sbrian 4161981Sbrianjava.activation_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 4261981Sbrian 4361981Sbrian################################################################################ 4461981Sbrian 4561981Sbrianjava.base_COPY := .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties 4661981Sbrianjava.base_CLEAN := intrinsic.properties 4761981Sbrian 4861981Sbrianjava.base_EXCLUDES += java/lang/doc-files 4961981Sbrian 5061981Sbrian# Exclude BreakIterator classes that are just used in compile process to generate 5161981Sbrian# data files and shouldn't go in the product 5261981Sbrianjava.base_EXCLUDE_FILES += sun/text/resources/BreakIteratorRules.java 5361981Sbrian 5461981Sbrianifeq ($(OPENJDK_TARGET_OS), macosx) 5561981Sbrian JAVA_BASE_UNIX_DIR := $(JDK_TOPDIR)/src/java.base/unix/classes 5661981Sbrian # TODO: make JavaCompilation handle overrides automatically instead of excluding here 5761981Sbrian # These files are overridden in macosx 5861981Sbrian java.base_EXCLUDE_FILES += \ 5961981Sbrian $(JAVA_BASE_UNIX_DIR)/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java \ 6061981Sbrian $(JAVA_BASE_UNIX_DIR)/java/net/DefaultInterface.java \ 6161981Sbrian $(JAVA_BASE_UNIX_DIR)/java/lang/ClassLoaderHelper.java \ 6261981Sbrian $(JAVA_BASE_UNIX_DIR)/sun/nio/ch/DefaultSelectorProvider.java \ 6361981Sbrian # 6461981Sbrian # This is just skipped on macosx 6561981Sbrian java.base_EXCLUDE_FILES += $(JAVA_BASE_UNIX_DIR)/sun/nio/fs/GnomeFileTypeDetector.java 6661981Sbrianendif 6761981Sbrian 6861981Sbrianifneq ($(OPENJDK_TARGET_OS), solaris) 6961981Sbrian java.base_EXCLUDE_FILES += \ 7061981Sbrian SolarisLoginModule.java \ 7161981Sbrian SolarisSystem.java \ 7261981Sbrian # 7361981Sbrianendif 7465843Sbrian 7561981Sbrianifeq ($(filter $(OPENJDK_TARGET_OS), solaris macosx aix), ) 7661981Sbrian # 7761981Sbrian # only solaris, macosx and aix 7861981Sbrian # 7961981Sbrian java.base_EXCLUDE_FILES += sun/nio/fs/PollingWatchService.java 8061981Sbrianendif 8162054Sbrian 8261981Sbrianifeq ($(OPENJDK_TARGET_OS), windows) 8361981Sbrian java.base_EXCLUDE_FILES += \ 8461981Sbrian sun/nio/ch/AbstractPollSelectorImpl.java \ 8561981Sbrian sun/nio/ch/PollSelectorProvider.java \ 8661981Sbrian sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \ 8761981Sbrian # 8861981Sbrianendif 8961981Sbrian 9061981Sbrian################################################################################ 9161981Sbrian 9261981Sbrianjava.desktop_COPY := .gif .png .wav .txt .xml .css flavormap.properties .pf 9361981Sbrianjava.desktop_CLEAN := iio-plugin.properties 9462644Ssheldonh 9561981Sbrianjava.desktop_EXCLUDES += \ 9661981Sbrian java/awt/doc-files \ 9761981Sbrian javax/swing/doc-files \ 9861981Sbrian javax/swing/text/doc-files \ 9961981Sbrian javax/swing/plaf/synth/doc-files \ 10061981Sbrian javax/swing/undo/doc-files \ 10161981Sbrian sun/awt/X11/doc-files \ 10261981Sbrian # 10361981Sbrian 10461981Sbrian# The exception handling of swing beaninfo 10561981Sbrian# These resources violates the convention of having code and resources together under 10661981Sbrian# $(JDK_TOPDIR)/src/.../classes directories 10761981Sbrian$(eval $(call SetupCopyFiles,COPY_BEANINFO, \ 10861981Sbrian SRC := $(JDK_TOPDIR)/make/data/swingbeaninfo/images, \ 10961981Sbrian DEST := $(JDK_OUTPUTDIR)/modules/java.desktop/javax/swing/beaninfo/images, \ 11061981Sbrian FILES := $(wildcard $(JDK_TOPDIR)/make/data/swingbeaninfo/images/*.gif))) 11161981Sbrian 11261981Sbrianjava.desktop_COPY_EXTRA += $(COPY_BEANINFO) 11361981Sbrian 11461981Sbrianjava.desktop_EXCLUDE_FILES += \ 11561981Sbrian javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \ 11661981Sbrian javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \ 11761981Sbrian javax/swing/plaf/nimbus/ScrollBarPainter.java \ 11862274Sbrian javax/swing/plaf/nimbus/SliderPainter.java \ 11961981Sbrian javax/swing/plaf/nimbus/SpinnerPainter.java \ 12061981Sbrian javax/swing/plaf/nimbus/SplitPanePainter.java \ 12161981Sbrian javax/swing/plaf/nimbus/TabbedPanePainter.java \ 12261981Sbrian sun/awt/resources/security-icon-bw16.png \ 12361981Sbrian sun/awt/resources/security-icon-bw24.png \ 12461981Sbrian sun/awt/resources/security-icon-bw32.png \ 12561981Sbrian sun/awt/resources/security-icon-bw48.png \ 12665843Sbrian sun/awt/resources/security-icon-interim16.png \ 12765843Sbrian sun/awt/resources/security-icon-interim24.png \ 12865843Sbrian sun/awt/resources/security-icon-interim32.png \ 12965843Sbrian sun/awt/resources/security-icon-interim48.png \ 13065843Sbrian sun/awt/resources/security-icon-yellow16.png \ 13165843Sbrian sun/awt/resources/security-icon-yellow24.png \ 13265843Sbrian sun/awt/resources/security-icon-yellow32.png \ 13365843Sbrian sun/awt/resources/security-icon-yellow48.png \ 13465843Sbrian sun/awt/X11/java-icon16.png \ 13565843Sbrian sun/awt/X11/java-icon24.png \ 13661981Sbrian sun/awt/X11/java-icon32.png \ 13761981Sbrian sun/awt/X11/java-icon48.png \ 13861981Sbrian .template \ 13961981Sbrian # 14061981Sbrian 14161981Sbrianifeq ($(OPENJDK_TARGET_OS), macosx) 14261981Sbrian # exclude all X11 on Mac. 14361981Sbrian java.desktop_EXCLUDES += sun/awt/X11 14461981Sbrian java.desktop_EXCLUDE_FILES += \ 14561981Sbrian $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/java2d/BackBufferCapsProvider.java \ 14661981Sbrian # 14761981Sbrianelse 14861981Sbrian # TBD: figure out how to eliminate this long list 14961981Sbrian java.desktop_EXCLUDE_FILES += \ 15061981Sbrian sun/awt/X11/ScreenFormat.java \ 15161981Sbrian sun/awt/X11/XArc.java \ 15261981Sbrian sun/awt/X11/XChar2b.java \ 15361981Sbrian sun/awt/X11/XCharStruct.java \ 15461981Sbrian sun/awt/X11/XClassHint.java \ 15561981Sbrian sun/awt/X11/XComposeStatus.java \ 15661981Sbrian sun/awt/X11/XExtCodes.java \ 15762206Sbrian sun/awt/X11/XFontProp.java \ 15862155Sbrian sun/awt/X11/XFontSetExtents.java \ 15962155Sbrian sun/awt/X11/XFontStruct.java \ 16061981Sbrian sun/awt/X11/XGCValues.java \ 16161981Sbrian sun/awt/X11/XHostAddress.java \ 16261981Sbrian sun/awt/X11/XIMCallback.java \ 16361981Sbrian sun/awt/X11/XIMHotKeyTrigger.java \ 16461981Sbrian sun/awt/X11/XIMHotKeyTriggers.java \ 16561981Sbrian sun/awt/X11/XIMPreeditCaretCallbackStruct.java \ 16665843Sbrian sun/awt/X11/XIMPreeditDrawCallbackStruct.java \ 16765843Sbrian sun/awt/X11/XIMPreeditStateNotifyCallbackStruct.java \ 16865843Sbrian sun/awt/X11/XIMStatusDrawCallbackStruct.java \ 16965843Sbrian sun/awt/X11/XIMStringConversionCallbackStruct.java \ 17065843Sbrian sun/awt/X11/XIMStringConversionText.java \ 17165843Sbrian sun/awt/X11/XIMStyles.java \ 17265843Sbrian sun/awt/X11/XIMText.java \ 17365843Sbrian sun/awt/X11/XIMValuesList.java \ 17465843Sbrian sun/awt/X11/XImage.java \ 17565843Sbrian sun/awt/X11/XKeyboardControl.java \ 17661981Sbrian sun/awt/X11/XKeyboardState.java \ 17761981Sbrian sun/awt/X11/XOMCharSetList.java \ 17861981Sbrian sun/awt/X11/XOMFontInfo.java \ 17961981Sbrian sun/awt/X11/XOMOrientation.java \ 18061981Sbrian sun/awt/X11/XPoint.java \ 18161981Sbrian sun/awt/X11/XRectangle.java \ 18261981Sbrian sun/awt/X11/XSegment.java \ 18361981Sbrian sun/awt/X11/XStandardColormap.java \ 18461981Sbrian sun/awt/X11/XTextItem.java \ 18561981Sbrian sun/awt/X11/XTextItem16.java \ 18661981Sbrian sun/awt/X11/XTextProperty.java \ 18761981Sbrian sun/awt/X11/XTimeCoord.java \ 18861981Sbrian sun/awt/X11/XWindowChanges.java \ 18961981Sbrian sun/awt/X11/XdbeSwapInfo.java \ 19061981Sbrian sun/awt/X11/XmbTextItem.java \ 19161981Sbrian sun/awt/X11/XwcTextItem.java 19261981Sbrianendif 19361981Sbrian 19461981Sbrianifeq ($(OPENJDK_TARGET_OS), windows) 19561981Sbrian java.desktop_EXCLUDES += com/sun/java/swing/plaf/gtk 19661981Sbrianendif 19761981Sbrian 19861981Sbrianifdef BUILD_HEADLESS_ONLY 19961981Sbrian java.desktop_EXCLUDES += sun/applet 20061981Sbrianendif 20161981Sbrian 20261981Sbrian# Why is this in the open source tree? 203ifdef OPENJDK 204 java.desktop_EXCLUDES += sun/dc 205endif 206 207# Used on windows and macosx 208ifeq ($(filter $(OPENJDK_TARGET_OS), windows macosx), ) 209 java.desktop_EXCLUDE_FILES += sun/awt/AWTCharset.java 210endif 211 212# These files do not appear in the build result of the old build. This 213# is because they are generated sources, but the AUTO_JAVA_FILES won't 214# pick them up since they aren't generated when the source dirs are 215# searched and they aren't referenced by any other classes so they won't 216# be picked up by implicit compilation. On a rebuild, they are picked up 217# and compiled. Exclude them here to produce the same rt.jar as the old 218# build does when building just once. 219java.desktop_EXCLUDE_FILES += \ 220 javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \ 221 javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \ 222 javax/swing/plaf/nimbus/ScrollBarPainter.java \ 223 javax/swing/plaf/nimbus/SliderPainter.java \ 224 javax/swing/plaf/nimbus/SpinnerPainter.java \ 225 javax/swing/plaf/nimbus/SplitPanePainter.java \ 226 javax/swing/plaf/nimbus/TabbedPanePainter.java \ 227 # 228 229ifeq ($(OPENJDK_TARGET_OS), macosx) 230 # These files are duplicated in MACOSX_SRC_DIRS 231 java.desktop_EXCLUDE_FILES += \ 232 $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/java2d/BackBufferCapsProvider.java \ 233 # 234endif 235 236################################################################################ 237 238java.scripting_COPY := .js 239java.scripting_CLEAN := .properties 240 241################################################################################ 242 243java.sql_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 244 245################################################################################ 246 247java.sql.rowset_CLEAN_FILES := $(wildcard \ 248 $(JDK_TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \ 249 $(JDK_TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties) 250 251################################################################################ 252# Exclude building of IIOP transport for RMI Connector 253 254ifeq ($(RMICONNECTOR_IIOP), false) 255 java.management_EXCLUDES += com/sun/jmx/remote/protocol/iiop 256endif 257 258################################################################################ 259 260java.rmi_CLEAN_FILES := $(wildcard \ 261 $(JDK_TOPDIR)/src/java.rmi/share/classes/sun/rmi/registry/resources/*.properties \ 262 $(JDK_TOPDIR)/src/java.rmi/share/classes/sun/rmi/server/resources/*.properties) 263 264################################################################################ 265 266java.corba_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 267 268java.corba_COPY := .prp 269java.corba_CLEAN := .properties 270 271java.corba_EXCLUDES += \ 272 com/sun/corba/se/PortableActivationIDL \ 273 com/sun/tools/corba/se/logutil \ 274 # 275java.corba_EXCLUDE_FILES += \ 276 com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java \ 277 com/sun/corba/se/spi/presentation/rmi/StubWrapper.java \ 278 com/sun/org/omg/CORBA/IDLTypeOperations.java \ 279 com/sun/org/omg/CORBA/IRObjectOperations.java \ 280 org/omg/PortableInterceptor/UNKNOWN.java \ 281 com/sun/tools/corba/se/idl/ResourceBundleUtil.java \ 282 com/sun/corba/se/impl/presentation/rmi/jndi.properties \ 283 # 284 285################################################################################ 286 287java.xml_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 288java.xml_CLEAN := .properties 289 290################################################################################ 291 292java.xml.bind_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 293java.xml.bind_CLEAN := .properties 294 295################################################################################ 296 297java.xml.soap_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 298java.xml.soap_CLEAN := .properties 299 300################################################################################ 301 302java.xml.ws_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 303java.xml.ws_COPY := .xml 304java.xml.ws_CLEAN := .properties 305 306################################################################################ 307 308java.naming_CLEAN := jndiprovider.properties 309 310################################################################################ 311 312java.security.saaj_CLEAN := .properties 313 314################################################################################ 315 316java.xml.crypto_COPY := .dtd .xml 317java.xml.crypto_CLEAN := .properties 318 319################################################################################ 320 321jdk.charsets_COPY := .dat 322 323################################################################################ 324 325jdk.compiler_COPY := javax.tools.JavaCompilerTool 326jdk.compiler_CLEAN_FILES := $(wildcard \ 327 $(patsubst %, $(JDK_TOPDIR)/src/jdk.compiler/share/classes/%/*.properties, \ 328 sun/tools/serialver/resources)) 329 330################################################################################ 331 332jdk.jcmd_COPY := _options 333 334################################################################################ 335 336jdk.javadoc_COPY := .xml .css .js 337 338################################################################################ 339 340jdk.rmic_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 341jdk.rmic_CLEAN := .properties 342 343################################################################################ 344 345# No SCTP implementation on Mac OS X or AIX. These classes should be excluded. 346SCTP_IMPL_CLASSES = \ 347 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationChange.java \ 348 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationImpl.java \ 349 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/PeerAddrChange.java \ 350 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/ResultContainer.java \ 351 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpChannelImpl.java \ 352 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java \ 353 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java \ 354 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNotification.java \ 355 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java \ 356 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SendFailed.java \ 357 $(JDK_TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/Shutdown.java 358 359ifeq ($(OPENJDK_TARGET_OS), macosx) 360 jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES) 361endif 362 363ifeq ($(OPENJDK_TARGET_OS),aix) 364 # These files are duplicated in AIX_SRC_DIRS 365 jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES) 366endif 367 368################################################################################ 369 370jdk.jconsole_COPY := .gif .png 371 372jdk.jconsole_CLEAN_FILES := $(wildcard \ 373 $(JDK_TOPDIR)/src/jdk.jconsole/share/classes/sun/tools/jconsole/resources/*.properties) 374 375################################################################################ 376 377jdk.jdi_EXCLUDES += \ 378 com/sun/tools/example/debug/bdi \ 379 com/sun/tools/example/debug/event \ 380 com/sun/tools/example/debug/gui \ 381 com/sun/jdi/doc-files \ 382 # 383 384jdk.jdi_EXCLUDE_FILES += jdi-overview.html 385 386################################################################################ 387 388jdk.dev_CLEAN_FILES := $(wildcard \ 389 $(patsubst %, $(JDK_TOPDIR)/src/jdk.dev/share/classes/%/*.properties, \ 390 com/sun/tools/script/shell)) 391 392jdk.dev_COPY := .js oqlhelp.html .txt 393 394################################################################################ 395 396jdk.jvmstat_COPY := aliasmap 397 398################################################################################ 399 400jdk.xml.bind_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 401jdk.xml.bind_CLEAN := .properties 402jdk.xml.bind_COPY := .xsd JAXBContextFactory.java ZeroOneBooleanAdapter.java 403 404################################################################################ 405 406jdk.xml.ws_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS 407jdk.xml.ws_CLEAN := .properties 408 409################################################################################ 410 411sun.charsets_COPY := .dat 412 413################################################################################ 414 415jdk.localedata_COPY := _dict _th 416# Exclude BreakIterator classes that are just used in compile process to generate 417# data files and shouldn't go in the product 418jdk.localedata_EXCLUDE_FILES += sun/text/resources/th/BreakIteratorRules_th.java 419 420################################################################################ 421# Setup the compilation of each module 422# 423# Do not include nashorn src here since it needs to be compiled separately due 424# to nasgen. 425# 426# Order src dirs in order of override with the most important first. Generated 427# source before static source and platform specific source before shared. 428# 429# To use this variable, use $(call ALL_SRC_DIRS,module) with no space. 430GENERATED_SRC_DIRS += \ 431 $(SUPPORT_OUTPUTDIR)/gensrc/$1 \ 432 $(SUPPORT_OUTPUTDIR)/gensrc_no_docs/$1 \ 433 # 434 435OS_SRC_DIRS += $(JDK_TOPDIR)/src/$1/$(OPENJDK_TARGET_OS)/classes 436ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE)) 437 OS_TYPE_SRC_DIRS += $(JDK_TOPDIR)/src/$1/$(OPENJDK_TARGET_OS_TYPE)/classes 438endif 439 440SHARE_SRC_DIRS += \ 441 $(JDK_TOPDIR)/src/$1/share/classes \ 442 $(LANGTOOLS_TOPDIR)/src/$1/share/classes \ 443 $(CORBA_TOPDIR)/src/$1/share/classes \ 444 $(JAXP_TOPDIR)/src/$1/share/classes \ 445 $(JAXWS_TOPDIR)/src/$1/share/classes \ 446 # 447 448ALL_SRC_DIRS = \ 449 $(GENERATED_SRC_DIRS) \ 450 $(OS_SRC_DIRS) \ 451 $(OS_TYPE_SRC_DIRS) \ 452 $(SHARE_SRC_DIRS) \ 453 # 454 455# Find all modules with java sources. Filter out nashorn since it needs to be 456# compiled separately. 457ALL_JAVA_MODULES := $(filter-out jdk.scripting.nashorn, $(call FindJavaModules)) 458JAVA_MODULES := $(ALL_JAVA_MODULES) 459 460# The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying 461# JDK_FILTER at the make command line, only a subset of the JDK java files will 462# be recompiled. If multiple paths are separated by comma, convert that into a 463# space separated list. 464JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER))) 465 466# This macro sets up compilation of a module and declares dependencies for it. 467# Param 1 - module name 468define SetupModuleCompilation 469 # Find the module dependencies by parsing modules.list file 470 $1_DEPS := $$(call FindDepsForModule, $1) 471 472 $1_CLASSPATH := $$(addprefix $(JDK_OUTPUTDIR)/modules/,$$($1_DEPS)) 473 # When crypto classes are prebuilt, need to look for classes already in 474 # output dir. 475 ifneq ($(BUILD_CRYPTO), true) 476 $1_CLASSPATH += $(JDK_OUTPUTDIR)/modules/$1 477 endif 478 ifeq ($1, jdk.hotspot.agent) 479 ## The source of this module is compiled elsewhere, hotspot, and imported. 480 ## Service types are required in the classpath when compiing module-info 481 $1_CLASSPATH := $$($1_CLASSPATH) $$(addprefix $(JDK_OUTPUTDIR)/modules/,jdk.hotspot.agent) 482 endif 483 $1_CLASSPATH := $$(subst $$(SPACE),$$(PATH_SEP),$$($1_CLASSPATH)) 484 $1_JAVAC_FLAGS := -bootclasspath "$$($1_CLASSPATH)" 485 486 $$(eval $$(call SetupJavaCompilation,$1, \ 487 SETUP := $$(if $$($1_SETUP), $$($1_SETUP), GENERATE_JDKBYTECODE), \ 488 SRC := $$(wildcard $$(call ALL_SRC_DIRS,$1)), \ 489 INCLUDES:=$(JDK_USER_DEFINED_FILTER),\ 490 BIN := $(JDK_OUTPUTDIR)/modules/$1, \ 491 HEADERS := $(SUPPORT_OUTPUTDIR)/headers/$1, \ 492 ADD_JAVAC_FLAGS := $$($1_JAVAC_FLAGS))) 493 494 $1: $$($1) $$($1_COPY_EXTRA) 495 496 # Declare dependencies between java compilation of different modules. 497 # Since not all modules have been declared yet, or might be declared 498 # in different invocations of this file, use the macro to find the 499 # correct target file to depend on. 500 # Only the javac compilation actually depends on other modules so limit 501 # dependency declaration to that by using the *_COMPILE_TARGET variable. 502 $$($1_COMPILE_TARGETS): $$(foreach d,$$($1_DEPS), \ 503 $$(call SetupJavaCompilationCompileTarget, $$d, $(JDK_OUTPUTDIR)/modules/$$d)) 504endef 505 506# Setup compilation for each module 507$(foreach m,$(JAVA_MODULES),$(eval $(call SetupModuleCompilation,$m))) 508 509################################################################################ 510# Copy zh_HK properties files from zh_TW 511 512$(JDK_OUTPUTDIR)/modules/%_zh_HK.properties: $(JDK_OUTPUTDIR)/modules/%_zh_TW.properties 513 $(install-file) 514 515define CreateHkTargets 516 $(patsubst $(JDK_TOPDIR)/src/%, $(JDK_OUTPUTDIR)/modules/%, \ 517 $(subst /share/classes,, \ 518 $(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $1)))) 519endef 520 521java.sql.rowset: $(call CreateHkTargets, $(java.sql.rowset_CLEAN_FILES)) 522java.rmi: $(call CreateHkTargets, $(java.rmi_CLEAN_FILES)) 523 524all: $(JAVA_MODULES) 525 526.PHONY: all $(JAVA_MODULES) 527