< prev index next >

make/CompileJavaModules.gmk

Print this page




 452 
 453 ################################################################################
 454 
 455 jdk.xml.ws_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
 456 jdk.xml.ws_CLEAN := .properties
 457 
 458 ################################################################################
 459 
 460 sun.charsets_COPY := .dat
 461 
 462 ################################################################################
 463 
 464 jdk.localedata_COPY := _dict _th
 465 # Exclude BreakIterator classes that are just used in compile process to generate
 466 # data files and shouldn't go in the product
 467 jdk.localedata_EXCLUDE_FILES += sun/text/resources/th/BreakIteratorRules_th.java
 468 
 469 ################################################################################
 470 # Setup the compilation for the module
 471 #
 472 # Order src dirs in order of override with the most important first. Generated
 473 # source before static source and platform specific source before shared.
 474 #
 475 GENERATED_SRC_DIRS += \
 476     $(SUPPORT_OUTPUTDIR)/gensrc \
 477     #
 478 
 479 TOP_SRC_DIRS += \
 480     $(HOTSPOT_TOPDIR)/src \
 481     $(CORBA_TOPDIR)/src \
 482     $(JDK_TOPDIR)/src \
 483     $(LANGTOOLS_TOPDIR)/src \
 484     $(JAXP_TOPDIR)/src \
 485     $(JAXWS_TOPDIR)/src \
 486     $(NASHORN_TOPDIR)/src \
 487     #
 488 
 489 SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
 490 ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
 491   SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
 492 endif
 493 SRC_SUBDIRS += share/classes
 494 
 495 MODULE_SRC_DIRS := $(strip \
 496     $(addsuffix /$(MODULE), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
 497     $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(MODULE)/$(sub), $(TOP_SRC_DIRS))))
 498 
 499 # The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying
 500 # JDK_FILTER at the make command line, only a subset of the JDK java files will
 501 # be recompiled. If multiple paths are separated by comma, convert that into a
 502 # space separated list.
 503 JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
 504 
 505 # Rewrite the MODULE_SRC_DIRS with a wildcard for the module so that all module
 506 # source dirs are available on the path.
 507 MODULESOURCEPATH := $(subst $(SPACE),$(PATH_SEP),$(subst $(MODULE),*,$(MODULE_SRC_DIRS)))
 508 
 509 # Add imported modules to the moduleclasspath
 510 MODULECLASSPATH := $(subst $(SPACE),$(PATH_SEP), $(IMPORT_MODULES_CLASSES))
 511 
 512 ifeq ($(MODULE), jdk.vm.ci)
 513   ## WORKAROUND jdk.vm.ci source structure issue
 514   JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \
 515       $(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
 516           $(wildcard $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes/*/src)))
 517   MODULESOURCEPATH := $(subst $(SPACE),$(PATH_SEP), $(JVMCI_MODULESOURCEPATH))
 518 endif
 519 
 520 # Make sure the generated source base dirs exist. Not all modules have generated
 521 # source in all of these directories and because of timing, all of them might not
 522 # exist at the time this makefile gets called. Javac will complain if there are
 523 # missing directories in the moduleclasspath.
 524 $(call MakeDir, $(GENERATED_SRC_DIRS))
 525 
 526 $(eval $(call SetupJavaCompilation, $(MODULE), \
 527     SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
 528     MODULE := $(MODULE), \
 529     SRC := $(wildcard $(MODULE_SRC_DIRS)), \
 530     INCLUDES := $(JDK_USER_DEFINED_FILTER),\
 531     BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
 532     HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
 533     ADD_JAVAC_FLAGS := \
 534         $($(MODULE)_ADD_JAVAC_FLAGS) \
 535         -modulesourcepath "$(MODULESOURCEPATH)" \
 536         $(if $(MODULECLASSPATH), -modulepath "$(MODULECLASSPATH)") \
 537         -system none, \
 538 ))
 539 
 540 TARGETS += $($(MODULE)) $($(MODULE)_COPY_EXTRA)
 541 
 542 # Declare dependencies between java compilations of different modules.
 543 # Since the other modules are declared in different invocations of this file,
 544 # use the macro to find the correct target file to depend on.
 545 # Only the javac compilation actually depends on other modules so limit
 546 # dependency declaration to that by using the *_COMPILE_TARGET variable.
 547 $($(MODULE)_COMPILE_TARGET): $(foreach d, $(call FindDepsForModule, $(MODULE)), \
 548     $(call SetupJavaCompilationCompileTarget, $d, \
 549         $(if $($d_BIN), $($d_BIN), $(JDK_OUTPUTDIR)/modules/$d)))
 550 
 551 ################################################################################
 552 # Copy zh_HK properties files from zh_TW
 553 
 554 $(JDK_OUTPUTDIR)/modules/%_zh_HK.properties: $(JDK_OUTPUTDIR)/modules/%_zh_TW.properties
 555         $(install-file)
 556 




 452 
 453 ################################################################################
 454 
 455 jdk.xml.ws_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
 456 jdk.xml.ws_CLEAN := .properties
 457 
 458 ################################################################################
 459 
 460 sun.charsets_COPY := .dat
 461 
 462 ################################################################################
 463 
 464 jdk.localedata_COPY := _dict _th
 465 # Exclude BreakIterator classes that are just used in compile process to generate
 466 # data files and shouldn't go in the product
 467 jdk.localedata_EXCLUDE_FILES += sun/text/resources/th/BreakIteratorRules_th.java
 468 
 469 ################################################################################
 470 # Setup the compilation for the module
 471 #
 472 MODULE_SRC_DIRS := $(call FindModuleSrcDirs, $(MODULE))

























 473 
 474 # The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying
 475 # JDK_FILTER at the make command line, only a subset of the JDK java files will
 476 # be recompiled. If multiple paths are separated by comma, convert that into a
 477 # space separated list.
 478 JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
 479 
 480 # Get the complete module source path.
 481 MODULESOURCEPATH := $(call GetModuleSrcPath)

 482 
 483 # Add imported modules to the modulepath
 484 MODULEPATH := $(call PathList, $(IMPORT_MODULES_CLASSES))
 485 
 486 ifeq ($(MODULE), jdk.vm.ci)
 487   ## WORKAROUND jdk.vm.ci source structure issue
 488   JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \
 489       $(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
 490           $(wildcard $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes/*/src)))
 491   MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))
 492 endif
 493 






 494 $(eval $(call SetupJavaCompilation, $(MODULE), \
 495     SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
 496     MODULE := $(MODULE), \
 497     SRC := $(wildcard $(MODULE_SRC_DIRS)), \
 498     INCLUDES := $(JDK_USER_DEFINED_FILTER),\
 499     BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
 500     HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
 501     ADD_JAVAC_FLAGS := \
 502         $($(MODULE)_ADD_JAVAC_FLAGS) \
 503         -modulesourcepath $(MODULESOURCEPATH) \
 504         -modulepath $(MODULEPATH) \
 505         -system none, \
 506 ))
 507 
 508 TARGETS += $($(MODULE)) $($(MODULE)_COPY_EXTRA)
 509 
 510 # Declare dependencies between java compilations of different modules.
 511 # Since the other modules are declared in different invocations of this file,
 512 # use the macro to find the correct target file to depend on.
 513 # Only the javac compilation actually depends on other modules so limit
 514 # dependency declaration to that by using the *_COMPILE_TARGET variable.
 515 $($(MODULE)_COMPILE_TARGET): $(foreach d, $(call FindDepsForModule, $(MODULE)), \
 516     $(call SetupJavaCompilationCompileTarget, $d, \
 517         $(if $($d_BIN), $($d_BIN), $(JDK_OUTPUTDIR)/modules/$d)))
 518 
 519 ################################################################################
 520 # Copy zh_HK properties files from zh_TW
 521 
 522 $(JDK_OUTPUTDIR)/modules/%_zh_HK.properties: $(JDK_OUTPUTDIR)/modules/%_zh_TW.properties
 523         $(install-file)
 524 


< prev index next >