提交 242e007c 编写于 作者: D dholmes

8004265: Add build support for Compact Profiles

Reviewed-by: erikj, ohair
上级 00af4316
...@@ -162,8 +162,9 @@ public class JarReorder { ...@@ -162,8 +162,9 @@ public class JarReorder {
for (int i = orderList.size() - 1; i >= 0; --i) { for (int i = orderList.size() - 1; i >= 0; --i) {
String s = orderList.get(i); String s = orderList.get(i);
if (allFilesExcluded.contains(s)) { if (allFilesExcluded.contains(s)) {
System.err.println("Included order file " + s // Disable this warning until 8005688 is fixed
+ " is also excluded, skipping."); // System.err.println("Included order file " + s
// + " is also excluded, skipping.");
} else if (new File(s).exists()) { } else if (new File(s).exists()) {
allFiles.add(s); allFiles.add(s);
} else { } else {
......
...@@ -39,6 +39,12 @@ include NativeCompilation.gmk ...@@ -39,6 +39,12 @@ include NativeCompilation.gmk
# Setup the java compilers for the JDK build. # Setup the java compilers for the JDK build.
include Setup.gmk include Setup.gmk
# Include Profile information
include ProfileNames.gmk
# Include the corresponding custom file, if present.
-include $(CUSTOM_MAKE_DIR)/BuildJdk.gmk
import: import-only import: import-only
import-only: import-only:
# Import (corba jaxp jaxws langtools hotspot) # Import (corba jaxp jaxws langtools hotspot)
...@@ -97,6 +103,13 @@ overlay-images: ...@@ -97,6 +103,13 @@ overlay-images:
+$(MAKE) -f CompileLaunchers.gmk OVERLAY_IMAGES=true +$(MAKE) -f CompileLaunchers.gmk OVERLAY_IMAGES=true
+$(MAKE) -f Images.gmk overlay-images +$(MAKE) -f Images.gmk overlay-images
# Create Compact Profile images
$(ALL_PROFILES):
+$(MAKE) PROFILE=$@ -f CreateJars.gmk
+$(MAKE) PROFILE=$@ JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/j2re-$(word $(call profile_number,$@),$(PROFILE_NAMES))-image -f Images.gmk profile-image
profiles: $(ALL_PROFILES)
sign-jars: sign-jars:
+$(MAKE) -f SignJars.gmk +$(MAKE) -f SignJars.gmk
...@@ -121,3 +134,4 @@ all: jdk ...@@ -121,3 +134,4 @@ all: jdk
.PHONY: import gensrc gendata classes libs launchers genclasses .PHONY: import gensrc gendata classes libs launchers genclasses
.PHONY: import-only gensrc-only gendata-only classes-only libs-only launchers-only genclasses-only .PHONY: import-only gensrc-only gendata-only classes-only libs-only launchers-only genclasses-only
.PHONY: all jdk demos images overlay-images bundles install .PHONY: all jdk demos images overlay-images bundles install
.PHONY: profiles $(ALL_PROFILES)
# #
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -35,16 +35,19 @@ $(eval $(call FillCacheFind,$(JDK_OUTPUTDIR)/classes)) ...@@ -35,16 +35,19 @@ $(eval $(call FillCacheFind,$(JDK_OUTPUTDIR)/classes))
include Tools.gmk include Tools.gmk
include Profiles.gmk
# #
# This makefile...so that altering will trigger rebuilding include/exclude-lists => jars # This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
# #
MAKEFILE=$(JDK_TOPDIR)/makefiles/CreateJars.gmk MAKEFILE=$(JDK_TOPDIR)/makefiles/CreateJars.gmk
#
# And similarly for the Profiles
PROFILE_MAKEFILES=$(JDK_TOPDIR)/makefiles/Profiles.gmk $(JDK_TOPDIR)/makefiles/profile-rtjar-includes.txt
MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
BEANMANIFEST := $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest BEANMANIFEST := $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest
JARS:=
$(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/lib)) $(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/lib))
########################################################################################## ##########################################################################################
...@@ -57,7 +60,6 @@ $(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,,\ ...@@ -57,7 +60,6 @@ $(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/jconsole.jar,\ JAR:=$(IMAGES_OUTPUTDIR)/lib/jconsole.jar,\
SKIP_METAINF:=true)) SKIP_METAINF:=true))
JARS+=$(IMAGES_OUTPUTDIR)/lib/jconsole.jar
########################################################################################## ##########################################################################################
...@@ -68,7 +70,6 @@ $(eval $(call SetupArchive,BUILD_DNS_JAR,,\ ...@@ -68,7 +70,6 @@ $(eval $(call SetupArchive,BUILD_DNS_JAR,,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar,\ JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar,\
SKIP_METAINF:=true)) SKIP_METAINF:=true))
JARS+=$(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar
########################################################################################## ##########################################################################################
...@@ -120,15 +121,20 @@ $(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\ ...@@ -120,15 +121,20 @@ $(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar,\ JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar,\
SKIP_METAINF:=true)) SKIP_METAINF:=true))
JARS+=$(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar
########################################################################################## ##########################################################################################
# rt.jar and resources.jar are being built in the same way as in the old build. They require #
# the files to be in a certain order and converting that is not easy and will not be needed # Different variants of rt.jar are built based on the current profile. The output
# in jigsaw anyway. # directory is augmented with the profile name so that the final jar file and all the
# intermediary list files will be in directory. This has the form lib$PROFILE rather than
# lib/$PROFILE so that it won't get copied as part of the image generation process.
# Each profile customizes the RT_JAR_EXCLUDES variable.
#
##########################################################################################
# Exclude list for rt.jar and resources.jar # Full JRE exclude list for rt.jar and resources.jar
RT_JAR_EXCLUDES := \ # This value should exclude types destined for jars other than rt.jar and resources.jar.
# When building a Profile this value augments the profile specific exclusions
RT_JAR_EXCLUDES += \
com/oracle/security \ com/oracle/security \
com/sun/codemodel \ com/sun/codemodel \
com/sun/crypto/provider \ com/sun/crypto/provider \
...@@ -250,24 +256,9 @@ RT_JAR_EXCLUDES := \ ...@@ -250,24 +256,9 @@ RT_JAR_EXCLUDES := \
sun/tools/util \ sun/tools/util \
sun/util/cldr/CLDRLocaleDataMetaInfo.class \ sun/util/cldr/CLDRLocaleDataMetaInfo.class \
sun/util/resources/cldr \ sun/util/resources/cldr \
$(LOCALEDATA_INCLUDES) $(LOCALEDATA_INCLUDES) \
# These files should never be put into rt.jar
# but due to a misstake...some are put there if embedded
#
ifneq ($(JAVASE_EMBEDDED), true)
# normal (correct) case
RT_JAR_EXCLUDES += \
com/oracle/jrockit/jfr \ com/oracle/jrockit/jfr \
oracle/jrockit/jfr oracle/jrockit/jfr
else
# embedded (broken) case
RT_JAR_EXCLUDES += \
oracle/jrockit/jfr/parser \
oracle/jrockit/jfr/tools \
oracle/jrockit/jfr/NativeOptions.class \
oracle/jrockit/jfr/RepositoryChunkHandler.class
endif
ifeq ($(OPENJDK_TARGET_OS), macosx) ifeq ($(OPENJDK_TARGET_OS), macosx)
RT_JAR_EXCLUDES += com/sun/nio/sctp \ RT_JAR_EXCLUDES += com/sun/nio/sctp \
...@@ -278,8 +269,8 @@ endif ...@@ -278,8 +269,8 @@ endif
ALL_FILES_IN_CLASSES := $(call not-containing,_the.,$(filter-out %javac_state,\ ALL_FILES_IN_CLASSES := $(call not-containing,_the.,$(filter-out %javac_state,\
$(call CacheFind,$(JDK_OUTPUTDIR)/classes))) $(call CacheFind,$(JDK_OUTPUTDIR)/classes)))
RT_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib/_the.rt.jar_manifest RT_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar_manifest
RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib/_the.resources.jar_manifest RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar_manifest
$(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST) $(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
...@@ -299,7 +290,7 @@ $(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST) ...@@ -299,7 +290,7 @@ $(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
$(MAINMANIFEST) >> $@.tmp $(MAINMANIFEST) >> $@.tmp
$(MV) $@.tmp $@ $(MV) $@.tmp $@
$(IMAGES_OUTPUTDIR)/lib/_the.jars.exclude: $(MAKEFILE) $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude: $(MAKEFILE) $(PROFILE_MAKEFILES)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $@.tmp $(RM) $@ $@.tmp
$(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@.tmp) $(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@.tmp)
...@@ -312,55 +303,115 @@ $(IMAGES_OUTPUTDIR)/lib/classlist : $(JDK_TOPDIR)/make/tools/sharing/classlist.$ ...@@ -312,55 +303,115 @@ $(IMAGES_OUTPUTDIR)/lib/classlist : $(JDK_TOPDIR)/make/tools/sharing/classlist.$
$(TOOL_ADDJSUM) $< $@.tmp $(TOOL_ADDJSUM) $< $@.tmp
$(MV) $@.tmp $@ $(MV) $@.tmp $@
$(IMAGES_OUTPUTDIR)/lib/_the.jars.contents: $(BUILD_TOOLS) $(IMAGES_OUTPUTDIR)/lib/_the.jars.exclude \ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents: $(BUILD_TOOLS) $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude \
$(ALL_FILES_IN_CLASSES) $(IMAGES_OUTPUTDIR)/lib/classlist $(ALL_FILES_IN_CLASSES) $(IMAGES_OUTPUTDIR)/lib/classlist
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $@.tmp $(RM) $@ $@.tmp
($(CD) $(JDK_OUTPUTDIR)/classes && \ ($(CD) $(JDK_OUTPUTDIR)/classes && \
$(TOOL_JARREORDER) \ $(TOOL_JARREORDER) \
-o $@.tmp $(IMAGES_OUTPUTDIR)/lib/classlist $(IMAGES_OUTPUTDIR)/lib/_the.jars.exclude . ) -o $@.tmp $(IMAGES_OUTPUTDIR)/lib/classlist $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude . )
$(MV) $@.tmp $@ $(MV) $@.tmp $@
$(IMAGES_OUTPUTDIR)/lib/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib/_the.jars.contents $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $@.tmp $(RM) $@ $@.tmp
$(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib/_the.jars.contents > $@.tmp $(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
ifneq ($(PROFILE),)
# # Add back classes from excluded packages (fixing the $ substitution in the process)
for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
$(ECHO) $$type >> $@.tmp ; \
done
endif
$(MV) $@.tmp $@ $(MV) $@.tmp $@
$(IMAGES_OUTPUTDIR)/lib/_the.resources.jar.contents: $(IMAGES_OUTPUTDIR)/lib/_the.jars.contents $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $@.tmp $(RM) $@ $@.tmp
$(GREP) -v -e '\.class$$' \ $(GREP) -v -e '\.class$$' \
-e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \ -e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \
$(IMAGES_OUTPUTDIR)/lib/_the.jars.contents > $@.tmp $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
ifneq ($(PROFILE),)
# # Strip out all META-INF/services/ entries
$(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
# # Add back the required services
# # FIXME: On Solaris if PROFILE_INCLUDE_METAINF_SERVICES is not defined
# # we get a syntax error from sh. That doesn't happen on linux
for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
$(ECHO) $$service >> $@.tmp2; \
done
$(MV) $@.tmp2 $@.tmp
endif
$(MV) $@.tmp $@ $(MV) $@.tmp $@
# This is a hack but I don't know how to make this fit into the existing scheme
$(PROFILE_VERSION_CLASS_TARGETS) : $(PROFILE_VERSION_JAVA_TARGETS)
@$(JAVAC) -d $(@D)/../../ $(@D)/$(VERSION_JAVA_FILE)
# Support for removing the addPropertyChangeListener and removePropertyChangeListener
# methods from classes that only go into the profile builds. For now the Pack200.Packer
# and Packer200.Unpacker classes have special handling because of the $ in the file
# name.
BEANLESS_CLASSES = $(IMAGES_OUTPUTDIR)/beanless
$(BEANLESS_CLASSES)/%: $(JDK_OUTPUTDIR)/classes/%
$(MKDIR) -p $(@D)
$(TOOL_REMOVEMETHODS) $< $@ addPropertyChangeListener removePropertyChangeListener
CLASSES_TO_DEBEAN = \
java/util/logging/LogManager.class \
com/sun/java/util/jar/pack/PackerImpl.class \
com/sun/java/util/jar/pack/UnpackerImpl.class
BEANLESS_CLASSES_TARGETS =
ifneq ($(PROFILE),)
BEANLESS_CLASSES_TARGETS := $(foreach c, $(CLASSES_TO_DEBEAN), $(BEANLESS_CLASSES)/$c)
endif
RT_JAR_CREATE_OPTIONS := c0fm RT_JAR_CREATE_OPTIONS := c0fm
RT_JAR_UPDATE_OPTIONS := u0f
ifeq ($(COMPRESS_JARS), true) ifeq ($(COMPRESS_JARS), true)
RT_JAR_CREATE_OPTIONS := cfm RT_JAR_CREATE_OPTIONS := cfm
RT_JAR_UPDATE_OPTIONS := uf
endif endif
$(IMAGES_OUTPUTDIR)/lib/rt.jar: $(IMAGES_OUTPUTDIR)/lib/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE) # This defines a target-specific variables to make the shell logic easier to see.
$(ECHO) Creating rt.jar # We need to find the Version.class file for the profile currently being built
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: \
CLASS_FILE = $(if $(PROFILE),$(strip $(foreach class,$(PROFILE_VERSION_CLASS_TARGETS),$(if $(findstring $(PROFILE),$(class)),$(class)))), NO_SUCH_FILE)
# This is the real target
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE) $(PROFILE_VERSION_CLASS_TARGETS) $(BEANLESS_CLASSES_TARGETS)
$(ECHO) Creating rt.jar $(PROFILE) Compressed=$(COMPRESS_JARS)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $@.tmp $(RM) $@ $@.tmp
$(CD) $(JDK_OUTPUTDIR)/classes && \ $(CD) $(JDK_OUTPUTDIR)/classes && \
$(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RT_JAR_MANIFEST_FILE) \ $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RT_JAR_MANIFEST_FILE) \
@$(IMAGES_OUTPUTDIR)/lib/_the.rt.jar.contents @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents && \
if [ -f $(CLASS_FILE) ]; then \
$(ECHO) Updating rt.jar $(PROFILE) && \
$(CD) $(patsubst %$(VERSION_CLASS_PATH),%,$(CLASS_FILE)) && \
$(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(VERSION_CLASS_PATH); \
$(MKDIR) -p $(BEANLESS_CLASSES)/java/util/jar; \
$(TOOL_REMOVEMETHODS) $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200\$$Packer.class \
$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Packer.class addPropertyChangeListener removePropertyChangeListener; \
$(TOOL_REMOVEMETHODS) $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200\$$Unpacker.class \
$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Unpacker.class addPropertyChangeListener removePropertyChangeListener; \
$(CD) $(BEANLESS_CLASSES) && \
$(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(CLASSES_TO_DEBEAN) java/util/jar/* ; \
fi
$(MV) $@.tmp $@ $(MV) $@.tmp $@
$(IMAGES_OUTPUTDIR)/lib/resources.jar: $(IMAGES_OUTPUTDIR)/lib/_the.resources.jar.contents \ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/resources.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents \
$(RESOURCE_JAR_MANIFEST_FILE) $(RESOURCE_JAR_MANIFEST_FILE)
$(ECHO) Creating resources.jar $(ECHO) Creating resources.jar
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $@.tmp $(RM) $@ $@.tmp
$(CD) $(JDK_OUTPUTDIR)/classes && \ $(CD) $(JDK_OUTPUTDIR)/classes && \
$(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RESOURCE_JAR_MANIFEST_FILE) \ $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RESOURCE_JAR_MANIFEST_FILE) \
@$(IMAGES_OUTPUTDIR)/lib/_the.resources.jar.contents @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents
$(MV) $@.tmp $@ $(MV) $@.tmp $@
JARS+=$(IMAGES_OUTPUTDIR)/lib/rt.jar $(IMAGES_OUTPUTDIR)/lib/resources.jar
########################################################################################## ##########################################################################################
ifneq ($(OPENJDK_TARGET_OS), windows) ifneq ($(OPENJDK_TARGET_OS), windows)
...@@ -385,8 +436,6 @@ $(eval $(call SetupArchive,BUILD_CHARSETS_JAR,,\ ...@@ -385,8 +436,6 @@ $(eval $(call SetupArchive,BUILD_CHARSETS_JAR,,\
SKIP_METAINF := true, \ SKIP_METAINF := true, \
CHECK_COMPRESS_JAR:=true)) CHECK_COMPRESS_JAR:=true))
JARS+=$(IMAGES_OUTPUTDIR)/lib/charsets.jar
########################################################################################## ##########################################################################################
ifndef OPENJDK ifndef OPENJDK
...@@ -400,7 +449,6 @@ ifeq ($(ENABLE_JFR), true) ...@@ -400,7 +449,6 @@ ifeq ($(ENABLE_JFR), true)
MANIFEST:=$(MAINMANIFEST), \ MANIFEST:=$(MAINMANIFEST), \
CHECK_COMPRESS_JAR:=true)) CHECK_COMPRESS_JAR:=true))
JARS+=$(IMAGES_OUTPUTDIR)/lib/jfr.jar
endif endif
endif endif
...@@ -417,8 +465,6 @@ $(eval $(call SetupArchive,BUILD_JSSE_JAR,,\ ...@@ -417,8 +465,6 @@ $(eval $(call SetupArchive,BUILD_JSSE_JAR,,\
MANIFEST:=$(MAINMANIFEST), \ MANIFEST:=$(MAINMANIFEST), \
CHECK_COMPRESS_JAR:=true)) CHECK_COMPRESS_JAR:=true))
JARS+=$(IMAGES_OUTPUTDIR)/lib/jsse.jar
########################################################################################## ##########################################################################################
# Create manifest for security jars # Create manifest for security jars
...@@ -438,7 +484,8 @@ $(JCE_MANIFEST): $(MAINMANIFEST) ...@@ -438,7 +484,8 @@ $(JCE_MANIFEST): $(MAINMANIFEST)
########################################################################################## ##########################################################################################
# For all security jars, always build the jar, but for closed, install the prebuilt signed # For all security jars, always build the jar, but for closed, install the prebuilt signed
# version instead of the newly built jar. For open, signing is not needed. See SignJars.gmk # version instead of the newly built jar. Unsigned jars are treated as intermediate targets
# and explicitly added to the JARS list. For open, signing is not needed. See SignJars.gmk
# for more information. # for more information.
SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar
...@@ -464,7 +511,7 @@ else ...@@ -464,7 +511,7 @@ else
$(install-file) $(install-file)
endif endif
JARS += $(SUNPKCS11_JAR_DST) $(SUNPKCS11_JAR_UNSIGNED) JARS += $(SUNPKCS11_JAR_UNSIGNED)
########################################################################################## ##########################################################################################
...@@ -491,7 +538,7 @@ else ...@@ -491,7 +538,7 @@ else
$(install-file) $(install-file)
endif endif
JARS += $(SUNEC_JAR_DST) $(SUNEC_JAR_UNSIGNED) JARS += $(SUNEC_JAR_UNSIGNED)
########################################################################################## ##########################################################################################
...@@ -504,8 +551,6 @@ $(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR,,\ ...@@ -504,8 +551,6 @@ $(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR,,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/dt.jar,\ JAR:=$(IMAGES_OUTPUTDIR)/lib/dt.jar,\
SKIP_METAINF:=true)) SKIP_METAINF:=true))
JARS+=$(IMAGES_OUTPUTDIR)/lib/dt.jar
########################################################################################## ##########################################################################################
SUNJCE_PROVIDER_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunjce_provider.jar SUNJCE_PROVIDER_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunjce_provider.jar
...@@ -531,7 +576,7 @@ else ...@@ -531,7 +576,7 @@ else
$(install-file) $(install-file)
endif endif
JARS += $(SUNJCE_PROVIDER_JAR_DST) $(SUNJCE_PROVIDER_JAR_UNSIGNED) JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
########################################################################################## ##########################################################################################
...@@ -558,7 +603,7 @@ else ...@@ -558,7 +603,7 @@ else
$(install-file) $(install-file)
endif endif
JARS += $(JCE_JAR_DST) $(JCE_JAR_UNSIGNED) JARS += $(JCE_JAR_UNSIGNED)
########################################################################################## ##########################################################################################
...@@ -596,7 +641,7 @@ else ...@@ -596,7 +641,7 @@ else
$(install-file) $(install-file)
endif endif
JARS += $(US_EXPORT_POLICY_JAR_DST) $(US_EXPORT_POLICY_JAR_UNSIGNED) JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED)
########################################################################################## ##########################################################################################
...@@ -639,7 +684,7 @@ else ...@@ -639,7 +684,7 @@ else
$(install-file) $(install-file)
endif endif
JARS += $(LOCAL_POLICY_JAR_DST) $(LOCAL_POLICY_JAR_UNSIGNED) JARS += $(LOCAL_POLICY_JAR_UNSIGNED)
########################################################################################## ##########################################################################################
...@@ -668,7 +713,7 @@ else ...@@ -668,7 +713,7 @@ else
$(install-file) $(install-file)
endif endif
JARS += $(SUNMSCAPI_JAR_DST) $(SUNMSCAPI_JAR_UNSIGNED) JARS += $(SUNMSCAPI_JAR_UNSIGNED)
endif endif
...@@ -695,7 +740,7 @@ $(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC) ...@@ -695,7 +740,7 @@ $(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC)
@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..." @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
$(install-file) $(install-file)
JARS += $(UCRYPTO_JAR_DST) $(UCRYPTO_JAR_UNSIGNED) JARS += $(UCRYPTO_JAR_UNSIGNED)
endif endif
endif endif
...@@ -718,8 +763,6 @@ $(eval $(call SetupArchive,BUILD_CLDRDATA_JAR,,\ ...@@ -718,8 +763,6 @@ $(eval $(call SetupArchive,BUILD_CLDRDATA_JAR,,\
EXTRA_MANIFEST_ATTR:=CLDR-Version: $(CLDRVERSION),\ EXTRA_MANIFEST_ATTR:=CLDR-Version: $(CLDRVERSION),\
SKIP_METAINF:=true)) SKIP_METAINF:=true))
JARS += $(CLDRDATA_JAR_DST)
########################################################################################## ##########################################################################################
TOOLS_JAR_INCLUDES := \ TOOLS_JAR_INCLUDES := \
...@@ -793,7 +836,6 @@ $(eval $(call SetupArchive,BUILD_TOOLS_JAR,,\ ...@@ -793,7 +836,6 @@ $(eval $(call SetupArchive,BUILD_TOOLS_JAR,,\
SKIP_METAINF:=true, \ SKIP_METAINF:=true, \
CHECK_COMPRESS_JAR:=true)) CHECK_COMPRESS_JAR:=true))
JARS+=$(IMAGES_OUTPUTDIR)/lib/tools.jar
########################################################################################## ##########################################################################################
...@@ -834,6 +876,7 @@ $(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar ...@@ -834,6 +876,7 @@ $(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
-processor com.sun.tools.javac.sym.CreateSymbols \ -processor com.sun.tools.javac.sym.CreateSymbols \
-Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \ -Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \
-Acom.sun.tools.javac.sym.Dest=$(IMAGES_OUTPUTDIR)/symbols/META-INF/sym/rt.jar \ -Acom.sun.tools.javac.sym.Dest=$(IMAGES_OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
-Acom.sun.tools.javac.sym.Profiles=profile-rtjar-includes.txt \
$(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS) $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
$(TOUCH) $@ $(TOUCH) $@
...@@ -844,7 +887,6 @@ $(eval $(call SetupArchive,BUILD_CT_SYM,$(IMAGES_OUTPUTDIR)/symbols/_the.symbols ...@@ -844,7 +887,6 @@ $(eval $(call SetupArchive,BUILD_CT_SYM,$(IMAGES_OUTPUTDIR)/symbols/_the.symbols
JAR:=$(IMAGES_OUTPUTDIR)/lib/ct.sym, \ JAR:=$(IMAGES_OUTPUTDIR)/lib/ct.sym, \
CHECK_COMPRESS_JAR:=true)) CHECK_COMPRESS_JAR:=true))
JARS+=$(IMAGES_OUTPUTDIR)/lib/ct.sym
########################################################################################## ##########################################################################################
...@@ -930,8 +972,6 @@ $(eval $(call SetupZipArchive,BUILD_SRC_ZIP,\ ...@@ -930,8 +972,6 @@ $(eval $(call SetupZipArchive,BUILD_SRC_ZIP,\
ZIP:=$(IMAGES_OUTPUTDIR)/src.zip,\ ZIP:=$(IMAGES_OUTPUTDIR)/src.zip,\
EXTRA_DEPS:=$(LAUNCHER_ZIP_SRC))) EXTRA_DEPS:=$(LAUNCHER_ZIP_SRC)))
JARS+=$(IMAGES_OUTPUTDIR)/src.zip
########################################################################################## ##########################################################################################
# #
...@@ -941,15 +981,11 @@ JARS+=$(IMAGES_OUTPUTDIR)/src.zip ...@@ -941,15 +981,11 @@ JARS+=$(IMAGES_OUTPUTDIR)/src.zip
$(IMAGES_OUTPUTDIR)/lib/management-agent.jar : $(JDK_TOPDIR)/src/share/classes/sun/management/manifest $(IMAGES_OUTPUTDIR)/lib/management-agent.jar : $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
$(JAR) cfm $@ $< $(JAR) cfm $@ $<
JARS += $(IMAGES_OUTPUTDIR)/lib/management-agent.jar
########################################################################################## ##########################################################################################
$(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar $(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar
$(install-file) $(install-file)
JARS += $(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar
########################################################################################## ##########################################################################################
ifeq ($(OPENJDK_TARGET_OS),macosx) ifeq ($(OPENJDK_TARGET_OS),macosx)
...@@ -957,8 +993,6 @@ ifeq ($(OPENJDK_TARGET_OS),macosx) ...@@ -957,8 +993,6 @@ ifeq ($(OPENJDK_TARGET_OS),macosx)
SRCS:=$(JDK_OUTPUTDIR)/jobjc_classes,\ SRCS:=$(JDK_OUTPUTDIR)/jobjc_classes,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/JObjC.jar, \ JAR:=$(IMAGES_OUTPUTDIR)/lib/JObjC.jar, \
JARINDEX:=true)) JARINDEX:=true))
JARS += $(IMAGES_OUTPUTDIR)/lib/JObjC.jar
endif endif
########################################################################################## ##########################################################################################
...@@ -968,7 +1002,6 @@ ifndef OPENJDK ...@@ -968,7 +1002,6 @@ ifndef OPENJDK
SRCS:=$(JDK_OUTPUTDIR)/altclasses_classes,\ SRCS:=$(JDK_OUTPUTDIR)/altclasses_classes,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/alt-rt.jar)) JAR:=$(IMAGES_OUTPUTDIR)/lib/alt-rt.jar))
JARS += $(IMAGES_OUTPUTDIR)/lib/alt-rt.jar
endif endif
########################################################################################## ##########################################################################################
...@@ -979,8 +1012,6 @@ endif ...@@ -979,8 +1012,6 @@ endif
$(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar: $(JDK_OUTPUTDIR)/lib/sa-jdi.jar $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar: $(JDK_OUTPUTDIR)/lib/sa-jdi.jar
$(install-file) $(install-file)
JARS += $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar
########################################################################################## ##########################################################################################
# #
# sec-bin.zip is used by builds where the corresponding sources are not available # sec-bin.zip is used by builds where the corresponding sources are not available
......
...@@ -41,6 +41,8 @@ $(eval $(call FillCacheFind,\ ...@@ -41,6 +41,8 @@ $(eval $(call FillCacheFind,\
include Tools.gmk include Tools.gmk
include Profiles.gmk
# Note: This double-colon rule is intentional, to support # Note: This double-colon rule is intentional, to support
# custom make file integration. # custom make file integration.
images:: jre-image jdk-image images:: jre-image jdk-image
...@@ -84,7 +86,7 @@ endef ...@@ -84,7 +86,7 @@ endef
################################################################################ ################################################################################
# #
# Variable prefixes explained: # Variable prefixes explained:
# JRE_ refers to files in the j2re-image. # JRE_ refers to files in the j2re-*-image.
# JDK_ refers to files in the j2sdk-image outside of the jre subdir. # JDK_ refers to files in the j2sdk-image outside of the jre subdir.
# JDKJRE_ refers to files in the j2sdk-image inside the jre subdir. # JDKJRE_ refers to files in the j2sdk-image inside the jre subdir.
# #
...@@ -92,7 +94,8 @@ endef ...@@ -92,7 +94,8 @@ endef
################################################################################ ################################################################################
# /bin dir # /bin dir
NOT_JRE_BIN_FILES := \ ifeq ($(PROFILE),)
NOT_JRE_BIN_FILES := \
appletviewer$(EXE_SUFFIX) \ appletviewer$(EXE_SUFFIX) \
extcheck$(EXE_SUFFIX) \ extcheck$(EXE_SUFFIX) \
idlj$(EXE_SUFFIX) \ idlj$(EXE_SUFFIX) \
...@@ -125,6 +128,7 @@ NOT_JRE_BIN_FILES := \ ...@@ -125,6 +128,7 @@ NOT_JRE_BIN_FILES := \
schemagen$(EXE_SUFFIX) \ schemagen$(EXE_SUFFIX) \
jsadebugd$(EXE_SUFFIX) \ jsadebugd$(EXE_SUFFIX) \
jhat$(EXE_SUFFIX) jhat$(EXE_SUFFIX)
endif
WINDOWS_JDK_BIN_FILES = \ WINDOWS_JDK_BIN_FILES = \
$(EXE_SUFFIX) \ $(EXE_SUFFIX) \
...@@ -196,7 +200,8 @@ ifneq ($(OPENJDK_TARGET_OS), macosx) ...@@ -196,7 +200,8 @@ ifneq ($(OPENJDK_TARGET_OS), macosx)
$(SALIB_NAME) $(SALIB_NAME)
endif endif
NOT_JRE_LIB_FILES := \ ifeq ($(PROFILE),)
NOT_JRE_LIB_FILES := \
tools.jar \ tools.jar \
jconsole.jar \ jconsole.jar \
sa-jdi.jar \ sa-jdi.jar \
...@@ -205,8 +210,9 @@ NOT_JRE_LIB_FILES := \ ...@@ -205,8 +210,9 @@ NOT_JRE_LIB_FILES := \
ir.idl \ ir.idl \
ct.sym ct.sym
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(OPENJDK_TARGET_OS), windows)
NOT_JRE_LIB_FILES += jawt.lib jvm.lib NOT_JRE_LIB_FILES += jawt.lib jvm.lib
endif
endif endif
JDK_LIB_FILES := $(NOT_JRE_LIB_FILES) JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
...@@ -607,6 +613,9 @@ ALL_SOURCE_TIPS = $(shell \ ...@@ -607,6 +613,9 @@ ALL_SOURCE_TIPS = $(shell \
$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips $(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(call create-info-file) $(call create-info-file)
ifneq ($(PROFILE),)
$(call info-file-item, "JAVA_PROFILE", "$(call profile_name, $(call profile_number, $(PROFILE)))")
endif
$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips $(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
...@@ -648,7 +657,7 @@ ifneq ($(POST_STRIP_CMD),) ...@@ -648,7 +657,7 @@ ifneq ($(POST_STRIP_CMD),)
EXEC_LIST_OVERLAY:=$(filter $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB) EXEC_LIST_OVERLAY:=$(filter $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
# Filter out non JRE files and convert to unique touch files to depend on # Filter out non JRE files and convert to unique touch files to depend on
JRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped,\ JRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped,\
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\ $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
$(EXEC_LIST))) $(EXEC_LIST)))
...@@ -688,7 +697,7 @@ ifneq ($(POST_STRIP_CMD),) ...@@ -688,7 +697,7 @@ ifneq ($(POST_STRIP_CMD),)
endef endef
# Setup a rule for stripping files based on touch files # Setup a rule for stripping files based on touch files
$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped: $(JRE_IMAGE_DIR)/% $(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped: $(JRE_IMAGE_DIR)/%
$(call strip-file) $(call strip-file)
$(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/% $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/%
...@@ -728,6 +737,20 @@ jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \ ...@@ -728,6 +737,20 @@ jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \
$(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \ $(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \
$(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST) $(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST)
ifneq ($(PROFILE),)
# Files in lib$(PROFILE) are excluded from the generic copying routines so
# we have to add them back in here
$(foreach f,$(CUSTOM_PROFILE_JARS),\
$(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR)/lib$(PROFILE),$(JRE_IMAGE_DIR)/lib,$f,JRE_LIB_TARGETS)))
profile-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) \
$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
$(JRE_INFO_FILE) $(JRE_STRIP_LIST)
.PHONY: profile-image
endif # Profile
################################################################################ ################################################################################
.PHONY: default images jre-image jdk-image .PHONY: default images jre-image jdk-image
#
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# This was split out from Profiles.gmk to allow GenSrcMisc.gmk to include it
# without attempting to generate lists for output files that don't exist yet
# These are the external names of each profile
PROFILE_NAMES := compact1 compact2 compact3
# The include files use 1,2,3,4 for simplicity and conciseness. Internally we
# use profile_1, profile_2 and profile_3. Note that profile_4 is a full JRE so
# we never have to use it directly.
ALL_PROFILES := profile_1 profile_2 profile_3
# This defines targets to generate per-profile Version.java/class files into
# distinct locations
VERSION_JAVA_DIR := sun/misc
VERSION_JAVA_FILE := Version.java
VERSION_JAVA_PATH := $(VERSION_JAVA_DIR)/$(VERSION_JAVA_FILE)
VERSION_CLASS_PATH := $(VERSION_JAVA_PATH:.java=.class)
PROFILE_VERSION_JAVA_TARGETS := $(foreach i, $(ALL_PROFILES), $(subst XXX,$i, $(JDK_OUTPUTDIR)/gen_XXX/$(VERSION_JAVA_PATH)))
PROFILE_VERSION_CLASS_TARGETS := $(foreach i, $(PROFILE_VERSION_JAVA_TARGETS), $(i:.java=.class))
# Function to map from profile designator, profile_1 etc, to its number
profile_number = $(if $(patsubst profile_%,%, $(1)),$(patsubst profile_%,%, $(1)), $(words $(PROFILE_NAMES) extra))
# Function to map from profile number, 1, 2 etc, to the corresponding name
# An invalid number maps to an empty name
profile_name = $(word $(1), $(PROFILE_NAMES))
# Function to isolate a profile number from a Version.java target
# Evaluates to the arg if the arg is not a profile version target
profile_version_number = $(patsubst $(JDK_OUTPUTDIR)/gen_profile_%/$(VERSION_JAVA_PATH), %, $(1))
# Function to go from a profile Version.java target to profile name. If not
# a profile version target then we need a number that maps to an empty name
profile_version_name = $(word $(if $(filter-out $(call profile_version_number, $(1)), $(1)), $(call profile_version_number, $(1)), $(words $(PROFILE_NAMES) extra)), $(PROFILE_NAMES))
#
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
include ProfileNames.gmk
# This defines the include lists for each profile, categorized as lib, bin
# and other. We can use these to define the file lists for each profile
# directly, rather than constructing a set of files to exclude from the
# set of all files. But initially we will stick with generating exclude lists
# as that is how the main build process already works.
include profile-includes.txt
###############################################################################
# Per profile Jar lists
#
# These are the jar files to be built. In some builds these have to be
# imported (signed jars) rather than built.
#
# The incoming lists, eg PROFILE_1_JRE_JARS_FILES, are the jars to be
# included in this profile. They have the jar name relative to the lib
# directory. We have to turn these into targets by adding the
# $(IMAGES_OUTPUTDIR)/lib prefix
#
# Note that some jars may be optional depending on the type of build (jdk vs.
# openjdk) and the platform.
#
# WARNING: incoming lists are currently validated for linux only!
###############################################################################
# These are jar files for which the contents vary depending on the profile
CUSTOM_JARS := rt.jar resources.jar
# This is used in Images.gmk
CUSTOM_PROFILE_JARS := $(addprefix $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/, $(CUSTOM_JARS))
# These are the common jar files built for and included with this profile
# Filter out the custom jars and turn them into targets.
PROFILE_1_JARS := \
$(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(filter-out $(CUSTOM_JARS), $(PROFILE_1_JRE_JAR_FILES)))
PROFILE_2_JARS := \
$(if $(PROFILE_2_JRE_JAR_FILES), $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_2_JRE_JAR_FILES))) \
$(PROFILE_1_JARS)
ifneq ($(ENABLE_JFR), true)
PROFILE_3_JRE_JAR_FILES := $(filter-out jfr.jar, $(PROFILE_3_JRE_JAR_FILES))
endif
PROFILE_3_JARS := \
$(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_3_JRE_JAR_FILES)) \
$(PROFILE_2_JARS)
ifdef OPENJDK
PROFILE_4_JRE_JAR_FILES := $(filter-out alt-rt.jar, $(PROFILE_4_JRE_JAR_FILES))
endif
PROFILE_4_JARS := \
$(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_4_JRE_JAR_FILES)) \
$(PROFILE_3_JARS)
# The full set of "jar" files needed for a complete JDK (ct.sym and src.zip
# are also included.)
# Note we need to add back the regular form of all the custom profile jars e.g.
# rt.jar and resources.jar
ALL_JARS := $(PROFILE_4_JARS) \
$(IMAGES_OUTPUTDIR)/lib/rt.jar \
$(IMAGES_OUTPUTDIR)/lib/resources.jar \
$(IMAGES_OUTPUTDIR)/lib/jconsole.jar \
$(IMAGES_OUTPUTDIR)/lib/dt.jar \
$(IMAGES_OUTPUTDIR)/lib/tools.jar \
$(IMAGES_OUTPUTDIR)/lib/ct.sym \
$(IMAGES_OUTPUTDIR)/src.zip \
$(IMAGES_OUTPUTDIR)/lib/ext/cldrdata.jar \
$(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar
ifeq ($(OPENJDK_TARGET_OS),solaris)
ifndef OPENJDK
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar
endif
endif
ifeq ($(OPENJDK_TARGET_OS),windows)
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar
endif
ifeq ($(OPENJDK_TARGET_OS),macosx)
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/JObjC.jar
endif
ifeq ($(PROFILE), profile_1)
PROFILE_JARS := $(PROFILE_1_JARS)
else ifeq ($(PROFILE), profile_2)
PROFILE_JARS := $(PROFILE_2_JARS)
else ifeq ($(PROFILE), profile_3)
PROFILE_JARS := $(PROFILE_3_JARS)
endif
ifneq ($(PROFILE),)
JARS := $(CUSTOM_PROFILE_JARS) $(PROFILE_JARS)
else
JARS := $(ALL_JARS)
endif
###############################################################################
# JRE contents
###############################################################################
# we don't need to do anything if not building a profile
ifneq ($(PROFILE),)
# Need all files to generate the exclude lists
NEW_ALL_BIN_LIST := $(patsubst $(JDK_OUTPUTDIR)/bin/%,%,$(shell $(FIND) $(JDK_OUTPUTDIR)/bin \( -type f -o -type l \) ! -name "sjavac"))
ALL_JRE_BIN_FILES := \
$(PROFILE_1_JRE_BIN_FILES) \
$(PROFILE_2_JRE_BIN_FILES) \
$(PROFILE_3_JRE_BIN_FILES) \
$(PROFILE_4_JRE_BIN_FILES)
NOT_JRE_BIN_FILES := $(filter-out $(ALL_JRE_BIN_FILES), $(NEW_ALL_BIN_LIST))
# Additional exclusions for profile JRE
ifeq ($(PROFILE), profile_1)
NOT_JRE_BIN_FILES += \
$(PROFILE_2_JRE_BIN_FILES) \
$(PROFILE_3_JRE_BIN_FILES) \
$(PROFILE_4_JRE_BIN_FILES)
endif
ifeq ($(PROFILE), profile_2)
NOT_JRE_BIN_FILES += \
$(PROFILE_3_JRE_BIN_FILES) \
$(PROFILE_4_JRE_BIN_FILES)
endif
ifeq ($(PROFILE), profile_3)
NOT_JRE_BIN_FILES += \
$(PROFILE_4_JRE_BIN_FILES)
endif
NOT_JRE_BIN_FILES := $(addprefix $(JDK_OUTPUTDIR)/bin/, $(NOT_JRE_BIN_FILES))
# Need all files to generate the exclude lists
NEW_ALL_LIB_LIST := $(patsubst $(JDK_OUTPUTDIR)/lib/%,%,$(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \( -name "_the*" -o -name "javac_state " \) ))
NEW_ALL_LIB_LIST += $(patsubst $(IMAGES_OUTPUTDIR)/lib/%,%,$(shell $(FIND) $(IMAGES_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \( -name "_the*" -o -name "javac_state " \) ))
ALL_JRE_LIB_FILES := \
$(PROFILE_1_JRE_LIB_FILES) \
$(PROFILE_2_JRE_LIB_FILES) \
$(PROFILE_3_JRE_LIB_FILES) \
$(PROFILE_4_JRE_LIB_FILES)
NOT_JRE_LIB_FILES := $(filter-out $(ALL_JRE_LIB_FILES), $(NEW_ALL_LIB_LIST))
# Although these are NOT JRE lib files we have to filter them from the list
# (ie cause them to be added them back in here) because the logic in
# Images.gmk expects them to be there and handles them differently.
# If we don't, they end up in the wrong place in the JDK image.
# This needs fixing.
NOT_JRE_LIB_FILES := $(filter-out $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(SALIB_NAME), $(NOT_JRE_LIB_FILES))
# Additional exclusions for profile JREs
ifeq ($(PROFILE), profile_1)
NOT_JRE_LIB_FILES += \
$(PROFILE_2_JRE_LIB_FILES) \
$(PROFILE_3_JRE_LIB_FILES) \
$(PROFILE_4_JRE_LIB_FILES)
endif
ifeq ($(PROFILE), profile_2)
NOT_JRE_LIB_FILES += \
$(PROFILE_3_JRE_LIB_FILES) \
$(PROFILE_4_JRE_LIB_FILES)
endif
ifeq ($(PROFILE), profile_3)
NOT_JRE_LIB_FILES += \
$(PROFILE_4_JRE_LIB_FILES)
endif
# Exclude the custom jar files as these will be added back via a special rule
NOT_JRE_LIB_FILES += $(CUSTOM_JARS)
###############################################################################
# Customization of rt.jar file contents
# These are expressed as exclusions from everything found in the
# JDK_OUTPUTDIR/classes directory
###############################################################################
# The main set of excluded types/packages (ie everything not destined to be
# part of rt.jar or resources.jar is captured in the CreateJars.gmk RT_JAR_EXCLUDES
# variable. We add to that for the per-profile exclusion lists
# For each profile we have four variables:
#
# - PROFILE_n_RTJAR_INCLUDE_PACKAGES
#
# This is a package prefix indicating that all classes in that package
# and conditionally its subpackages are included in rt.jar for this profile.
# The subpackages will be included as long as they do not appear in the
# include list of a higher profile
#
# - PROFILE_n_RTJAR_INCLUDE_TYPES
#
# These are specific types that must be included within a package.
# There are two cases:
# - individual types in a package that is otherwise excluded at this
# profile level. The only arises if there are split packages.
#
# - A higher-level package is included in a high profile where a subpackage
# is included in a lower profile. Including the package in the high profile
# would exclude it and all subpackages from the lower profile, so instead
# the classes in the package are listed for that higher profile (as *.class)
#
# These types are explicitly added back into the rt.jar content lists.
#
# - PROFILE_n_RTJAR_EXCLUDE_TYPES
#
# These are specific types that must be excluded even though most of the
# containing package is include. Again this occurs with split packges.
#
# So the exclude list for each profile consists of the include lists
# for all profiles above it, together with any explicitly excluded types.
# This is then combined with the overall RT_JAR_EXCLUDES list (which covers
# things that go into other jar files).
#
# We also have to define the types to be explicitly included. This
# accumulates up the profiles ie profile 3 has to include the types
# that profiles 1 and 2 had to include. This is unnecessary if, for example,
# profile 3 includes the entire package, but it is harmless to add them
# explicitly, and complex to determine if we still need to include them.
#
# Need a way to express:
# for (int i = profile+1; i < 4; i++)
# RT_JAR_EXCLUDES += PROFILE_$i_RTJAR_INCLUDE_PACKAGES
#
# Do it the long way for now
#
# - PROFILE_n_INCLUDE_METAINF_SERVICES
#
# These are META-INF/services/ entries found in resources.jar. Together
# resources.jar and rt.jar hold the contents of the classes directory, (the
# classes in rt.jar and everything else in resources.jar).Hence the
# include/exclude information for resources.jar is tied to that of rt.jar
include profile-rtjar-includes.txt
# Function to expand foo/*.class into the set of classes
# NOTE: Classfiles with $ in their name are problematic as that is the
# meta-character for both make and the shell! Hence the \$$$$ substitution.
# But note that if you echo these values they will NOT display as expected.
class_list = $(patsubst $(JDK_OUTPUTDIR)/classes/%,%,\
$(foreach i,$(1), $(subst $$,\$$$$, $(wildcard $(JDK_OUTPUTDIR)/classes/$i))))
ifeq ($(PROFILE), profile_1)
RT_JAR_EXCLUDES += \
$(PROFILE_1_RTJAR_EXCLUDE_TYPES) \
$(PROFILE_2_RTJAR_INCLUDE_PACKAGES) \
$(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES)) \
$(PROFILE_3_RTJAR_INCLUDE_PACKAGES) \
$(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES)) \
$(PROFILE_4_RTJAR_INCLUDE_PACKAGES) \
$(call class_list, $(PROFILE_4_RTJAR_INCLUDE_TYPES))
RT_JAR_INCLUDE_TYPES := \
$(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES))
PROFILE_INCLUDE_METAINF_SERVICES := \
$(PROFILE_1_INCLUDE_METAINF_SERVICES)
endif
ifeq ($(PROFILE), profile_2)
RT_JAR_EXCLUDES += \
$(PROFILE_2_RTJAR_EXCLUDE_TYPES) \
$(PROFILE_3_RTJAR_INCLUDE_PACKAGES) \
$(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES)) \
$(PROFILE_4_RTJAR_INCLUDE_PACKAGES) \
$(call class_list, $(PROFILE_4_RTJAR_INCLUDE_TYPES))
RT_JAR_INCLUDE_TYPES := \
$(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES)) \
$(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES))
PROFILE_INCLUDE_METAINF_SERVICES := \
$(PROFILE_1_INCLUDE_METAINF_SERVICES) \
$(PROFILE_2_INCLUDE_METAINF_SERVICES)
endif
ifeq ($(PROFILE), profile_3)
RT_JAR_EXCLUDES += \
$(PROFILE_3_RTJAR_EXCLUDE_TYPES) \
$(PROFILE_4_RTJAR_INCLUDE_PACKAGES) \
$(call class_list, $(PROFILE_4_RTJAR_INCLUDE_TYPES))
RT_JAR_INCLUDE_TYPES := \
$(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES)) \
$(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES)) \
$(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES))
PROFILE_INCLUDE_METAINF_SERVICES := \
$(PROFILE_1_INCLUDE_METAINF_SERVICES) \
$(PROFILE_2_INCLUDE_METAINF_SERVICES) \
$(PROFILE_3_INCLUDE_METAINF_SERVICES)
endif
# Filter out non-OpenJDK services
ifdef OPENJDK
EXCLUDED_SERVICES := META-INF/services/javax.script.ScriptEngineFactory
PROFILE_INCLUDE_METAINF_SERVICES := $(filter-out $(EXCLUDED_SERVICES),$(PROFILE_INCLUDE_METAINF_SERVICES))
endif
endif # profile
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册