make/Main.gmk
changeset 34122 16e5e1fdf327
parent 34117 afc734a1cf3b
child 34491 307c28cb36c2
equal deleted inserted replaced
34121:c2229f4217ec 34122:16e5e1fdf327
    51 
    51 
    52 # Hook to include the corresponding custom file, if present.
    52 # Hook to include the corresponding custom file, if present.
    53 $(eval $(call IncludeCustomExtension, , Main.gmk))
    53 $(eval $(call IncludeCustomExtension, , Main.gmk))
    54 
    54 
    55 # All modules for the current target platform.
    55 # All modules for the current target platform.
    56 # Manually add jdk.hotspot.agent for now.
    56 ALL_MODULES := $(call FindAllModules)
    57 ALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
       
    58 
    57 
    59 ################################################################################
    58 ################################################################################
    60 ################################################################################
    59 ################################################################################
    61 #
    60 #
    62 # Recipes for all targets. Only recipes, dependencies are declared later.
    61 # Recipes for all targets. Only recipes, dependencies are declared later.
   142 JAVA_MODULES := $(call FindJavaModules)
   141 JAVA_MODULES := $(call FindJavaModules)
   143 JAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
   142 JAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
   144 
   143 
   145 define DeclareCompileJavaRecipe
   144 define DeclareCompileJavaRecipe
   146   $1-java:
   145   $1-java:
   147 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \
   146 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) \
   148 	    $1 JAVA_MODULES=$1 MODULE=$1)
   147 	    -f CompileJavaModules.gmk MODULE=$1)
   149 endef
   148 endef
   150 
   149 
   151 $(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
   150 $(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
   152     $(eval $(call DeclareCompileJavaRecipe,$m)))
   151     $(eval $(call DeclareCompileJavaRecipe,$m)))
   153 
   152 
   154 # Build nashorn. Needs to be compiled separately from the rest of the modules
   153 # Build nashorn. Needs to be compiled separately from the rest of the modules
   155 # due to nasgen.
   154 # due to nasgen.
   156 jdk.scripting.nashorn-java:
   155 jdk.scripting.nashorn-java:
   157 	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile)
   156 	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
       
   157 	    -f BuildNashorn.gmk compile)
   158 
   158 
   159 ALL_TARGETS += $(JAVA_TARGETS)
   159 ALL_TARGETS += $(JAVA_TARGETS)
   160 
   160 
   161 ################################################################################
   161 ################################################################################
   162 # Targets for running rmic.
   162 # Targets for running rmic.
   193 ################################################################################
   193 ################################################################################
   194 # Build hotspot target
   194 # Build hotspot target
   195 
   195 
   196 ifeq ($(BUILD_HOTSPOT),true)
   196 ifeq ($(BUILD_HOTSPOT),true)
   197   hotspot:
   197   hotspot:
   198 	($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
   198 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
   199 endif
   199 endif
   200 
   200 
   201 ALL_TARGETS += hotspot
   201 ALL_TARGETS += hotspot
   202 
   202 
   203 ################################################################################
   203 ################################################################################
   223 	@$(call GetSourceTips)
   223 	@$(call GetSourceTips)
   224 
   224 
   225 BOOTCYCLE_TARGET := product-images
   225 BOOTCYCLE_TARGET := product-images
   226 bootcycle-images:
   226 bootcycle-images:
   227 	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
   227 	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
   228 	+$(MAKE) $(MAKE_ARGS) -f $(SRC_ROOT)/make/Main.gmk \
   228 	+$(MAKE) -f $(SRC_ROOT)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
   229 	    SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET)
   229 	    JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
   230 
   230 
   231 zip-security:
   231 zip-security:
   232 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
   232 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
   233 
   233 
   234 zip-source:
   234 zip-source:
   421   # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
   421   # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
   422   # header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a
   422   # header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a
   423   # virtual target.
   423   # virtual target.
   424   jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
   424   jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
   425 
   425 
   426   # Until the module system is in place, jdk.jdi-gensrc needs to combine service
       
   427   # loader configuration with jdk.hotspot.agent so is dependent on importing
       
   428   # hotspot.
       
   429   jdk.jdi-gensrc-jdk: import-hotspot
       
   430 
       
   431   # The swing beans need to have java base properly generated to avoid errors
   426   # The swing beans need to have java base properly generated to avoid errors
   432   # in javadoc.
   427   # in javadoc.
   433   java.desktop-gensrc-jdk: java.base-gensrc
   428   java.desktop-gensrc-jdk: java.base-gensrc
   434 
   429 
   435   # Explicitly add dependencies for special targets
   430   # Explicitly add dependencies for special targets
   509 # Explicitly declare dependency for virtual target jdk.jdwp.agent-gensrc which
   504 # Explicitly declare dependency for virtual target jdk.jdwp.agent-gensrc which
   510 # is actually handled by jdk.jdi-gensrc
   505 # is actually handled by jdk.jdi-gensrc
   511 jdk.jdwp.agent-gensrc: jdk.jdi-gensrc
   506 jdk.jdwp.agent-gensrc: jdk.jdi-gensrc
   512 
   507 
   513 # Declare dependencies from <module> to all the individual targets specific
   508 # Declare dependencies from <module> to all the individual targets specific
   514 # to that module <module>-*.
   509 # to that module <module>-*, that are needed for the exploded image.
   515 $(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
   510 $(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
   516 $(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
   511 $(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
   517 $(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
   512 $(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
   518 $(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
   513 $(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
   519 $(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
   514 $(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
   520 $(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
   515 $(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
   521 $(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
   516 $(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
   522 
   517 
   523 ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
       
   524     $(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
       
   525 
       
   526 demos: demos-jdk
   518 demos: demos-jdk
   527 
   519 
   528 samples: samples-jdk
   520 samples: samples-jdk
   529 
   521 
   530 # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
   522 # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
   531 exploded-image: $(ALL_MODULE_TARGETS)
   523 exploded-image: $(ALL_MODULES)
   532 
   524 
   533 mac-bundles: mac-bundles-jdk
   525 mac-bundles: mac-bundles-jdk
   534 
   526 
   535 # The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
   527 # The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
   536 # and in line with this, our targets for creating these are named *-image[s].
   528 # and in line with this, our targets for creating these are named *-image[s].
   552 
   544 
   553 # all-images is the top-most target, it builds all our deliverables ("images").
   545 # all-images is the top-most target, it builds all our deliverables ("images").
   554 all-images: product-images test-image docs-image
   546 all-images: product-images test-image docs-image
   555 
   547 
   556 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
   548 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
   557     jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) demos samples exploded-image \
   549     jdk.jdwp.agent-gensrc $(ALL_MODULES) demos samples exploded-image \
   558     mac-bundles product-images docs-image test-image all-images
   550     mac-bundles product-images docs-image test-image all-images
   559 
   551 
   560 ################################################################################
   552 ################################################################################
   561 
   553 
   562 # Traditional targets typically run by users.
   554 # Traditional targets typically run by users.