make/CreateJmods.gmk
changeset 37770 9f040cf69078
parent 37765 d65d7bda43ce
child 37975 551c5d86de79
--- a/make/CreateJmods.gmk	Thu May 05 22:39:14 2016 -0700
+++ b/make/CreateJmods.gmk	Sat May 07 01:21:08 2016 +0200
@@ -1,4 +1,4 @@
-#
+
 # Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
@@ -35,6 +35,8 @@
 
 ################################################################################
 
+JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
+
 LIBS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
     $(SUPPORT_OUTPUTDIR)/modules_libs-stripped $(IMPORT_MODULES_LIBS))))
 CMDS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
@@ -67,28 +69,32 @@
 # Add dependencies on other jmod files. Only java.base needs access to other
 # jmods.
 ifeq ($(MODULE), java.base)
-  DEPS += $(patsubst %, $(IMAGES_OUTPUTDIR)/jmods/%.jmod, \
-      $(filter-out java.base, $(call FindAllModules)))
+  # When creating a BUILDJDK, we don't need to add hashes to java.base
+  ifneq ($(CREATING_BUILDJDK), true)
+    DEPS += $(patsubst %, $(JMODS_DIR)/%.jmod, \
+        $(filter-out java.base, $(call FindAllModules)))
 
-  # TODO: find modules that directly and indrectly on upgradeable modules
-  EXCLUDE_HASH_MODULES := $(UPGRADEABLE_MODULES) \
-    java.se.ee \
-    jdk.rmic \
-    jdk.xml.bind \
-    jdk.xml.ws \
-    #
+    # TODO: find modules that directly and indirectly depend on upgradeable
+    # modules
+    EXCLUDE_HASH_MODULES := $(UPGRADEABLE_MODULES) \
+      java.se.ee \
+      jdk.rmic \
+      jdk.xml.bind \
+      jdk.xml.ws \
+      #
 
-  EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(EXCLUDE_HASH_MODULES))))
+    EXCLUDE_PATTERN := $(strip $(subst $(SPACE),|,$(strip $(EXCLUDE_HASH_MODULES))))
 
-  JMOD_FLAGS += --modulepath $(IMAGES_OUTPUTDIR)/jmods \
-    		--hash-modules '^(?!$(EXCLUDE_PATTERN))'
+    JMOD_FLAGS += --modulepath $(JMODS_DIR) \
+        --hash-modules '^(?!$(EXCLUDE_PATTERN))'
+  endif
 endif
 
 # TODO: What about headers?
 # Create jmods in a temp dir and then move them into place to keep the
 # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
-$(IMAGES_OUTPUTDIR)/jmods/$(MODULE).jmod: $(DEPS)
-	$(call LogWarn, Creating $(notdir $@))
+$(JMODS_DIR)/$(MODULE).jmod: $(DEPS)
+	$(call LogWarn, Creating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
 	$(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/jmods)
 	$(RM) $@ $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
 	$(JMOD) create \
@@ -96,7 +102,7 @@
             --os-name $(REQUIRED_OS_NAME) \
             --os-arch $(OPENJDK_TARGET_CPU_LEGACY) \
             --os-version $(REQUIRED_OS_VERSION) \
-	        --modulepath $(IMAGES_OUTPUTDIR)/jmods\
+	        --modulepath $(JMODS_DIR) \
             --exclude '**{_the.*,*.diz,*.debuginfo,*.dSYM/**,*.pdb,*.map}' \
 	    $(JMOD_FLAGS) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
 	$(MV) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $@