annotate makefiles/Profiles.gmk @ 9031:46e86a9402ab

Merge
author chegar
date Fri, 06 Sep 2013 13:36:33 +0100
parents 3b8fed46b2a8 9bc1411d0223
children d7ef65d3ee57
rev   line source
dholmes@6571 1 #
dholmes@6571 2 # Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
dholmes@6571 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dholmes@6571 4 #
dholmes@6571 5 # This code is free software; you can redistribute it and/or modify it
dholmes@6571 6 # under the terms of the GNU General Public License version 2 only, as
dholmes@6571 7 # published by the Free Software Foundation. Oracle designates this
dholmes@6571 8 # particular file as subject to the "Classpath" exception as provided
dholmes@6571 9 # by Oracle in the LICENSE file that accompanied this code.
dholmes@6571 10 #
dholmes@6571 11 # This code is distributed in the hope that it will be useful, but WITHOUT
dholmes@6571 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dholmes@6571 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dholmes@6571 14 # version 2 for more details (a copy is included in the LICENSE file that
dholmes@6571 15 # accompanied this code).
dholmes@6571 16 #
dholmes@6571 17 # You should have received a copy of the GNU General Public License version
dholmes@6571 18 # 2 along with this work; if not, write to the Free Software Foundation,
dholmes@6571 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dholmes@6571 20 #
dholmes@6571 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dholmes@6571 22 # or visit www.oracle.com if you need additional information or have any
dholmes@6571 23 # questions.
dholmes@6571 24 #
dholmes@6571 25
dholmes@6571 26 include ProfileNames.gmk
dholmes@6571 27
dholmes@6571 28 # This defines the include lists for each profile, categorized as lib, bin
dholmes@6571 29 # and other. We can use these to define the file lists for each profile
dholmes@6571 30 # directly, rather than constructing a set of files to exclude from the
dholmes@6571 31 # set of all files. But initially we will stick with generating exclude lists
dholmes@6571 32 # as that is how the main build process already works.
dholmes@6571 33
dholmes@6571 34 include profile-includes.txt
dholmes@6571 35
dholmes@6571 36 ###############################################################################
dholmes@6571 37 # Per profile Jar lists
dholmes@6571 38 #
dholmes@6571 39 # These are the jar files to be built. In some builds these have to be
dholmes@6571 40 # imported (signed jars) rather than built.
dholmes@6571 41 #
dholmes@6571 42 # The incoming lists, eg PROFILE_1_JRE_JARS_FILES, are the jars to be
dholmes@6571 43 # included in this profile. They have the jar name relative to the lib
dholmes@6571 44 # directory. We have to turn these into targets by adding the
dholmes@6571 45 # $(IMAGES_OUTPUTDIR)/lib prefix
dholmes@6571 46 #
dholmes@6571 47 # Note that some jars may be optional depending on the type of build (jdk vs.
dholmes@6571 48 # openjdk) and the platform.
dholmes@6571 49 #
dholmes@6571 50 # WARNING: incoming lists are currently validated for linux only!
dholmes@6571 51 ###############################################################################
dholmes@6571 52
dholmes@6571 53 # These are jar files for which the contents vary depending on the profile
dholmes@6571 54 CUSTOM_JARS := rt.jar resources.jar
dholmes@6571 55 # This is used in Images.gmk
dholmes@6571 56 CUSTOM_PROFILE_JARS := $(addprefix $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/, $(CUSTOM_JARS))
dholmes@6571 57
dholmes@6571 58 # These are the common jar files built for and included with this profile
dholmes@6571 59 # Filter out the custom jars and turn them into targets.
dholmes@6571 60
dholmes@6571 61 PROFILE_1_JARS := \
dholmes@6571 62 $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(filter-out $(CUSTOM_JARS), $(PROFILE_1_JRE_JAR_FILES)))
dholmes@6571 63
dholmes@6571 64 PROFILE_2_JARS := \
dholmes@6571 65 $(if $(PROFILE_2_JRE_JAR_FILES), $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_2_JRE_JAR_FILES))) \
dholmes@6571 66 $(PROFILE_1_JARS)
dholmes@6571 67
dholmes@6571 68 PROFILE_3_JARS := \
dholmes@6571 69 $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_3_JRE_JAR_FILES)) \
dholmes@6571 70 $(PROFILE_2_JARS)
dholmes@6571 71
dholmes@6571 72 ifdef OPENJDK
dholmes@6787 73 FULL_JRE_JAR_FILES := $(filter-out alt-rt.jar, $(FULL_JRE_JAR_FILES))
dholmes@6571 74 endif
dholmes@6571 75
dholmes@7933 76 ifneq ($(ENABLE_JFR), true)
dholmes@7933 77 FULL_JRE_JAR_FILES := $(filter-out jfr.jar, $(FULL_JRE_JAR_FILES))
dholmes@7933 78 endif
dholmes@7933 79
dholmes@6787 80 FULL_JRE_JARS := \
dholmes@6787 81 $(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(FULL_JRE_JAR_FILES)) \
dholmes@6571 82 $(PROFILE_3_JARS)
dholmes@6571 83
dholmes@6571 84 # The full set of "jar" files needed for a complete JDK (ct.sym and src.zip
dholmes@6571 85 # are also included.)
dholmes@6571 86 # Note we need to add back the regular form of all the custom profile jars e.g.
dholmes@6796 87 # rt.jar and resources.jar that we filtered out above
dholmes@6571 88
dholmes@6787 89 ALL_JARS := $(FULL_JRE_JARS) \
dholmes@6571 90 $(IMAGES_OUTPUTDIR)/lib/rt.jar \
dholmes@6571 91 $(IMAGES_OUTPUTDIR)/lib/resources.jar \
dholmes@6571 92 $(IMAGES_OUTPUTDIR)/lib/jconsole.jar \
dholmes@6571 93 $(IMAGES_OUTPUTDIR)/lib/dt.jar \
dholmes@6571 94 $(IMAGES_OUTPUTDIR)/lib/tools.jar \
dholmes@6571 95 $(IMAGES_OUTPUTDIR)/lib/ct.sym \
omajid@6825 96 $(IMAGES_OUTPUTDIR)/src.zip
omajid@6825 97
omajid@6825 98 ifeq ($(INCLUDE_SA),true)
omajid@6825 99 ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar
omajid@6825 100 endif
dholmes@6571 101
dholmes@6571 102 ifeq ($(OPENJDK_TARGET_OS),solaris)
dholmes@6571 103 ifndef OPENJDK
dholmes@6571 104 ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar
dholmes@6571 105 endif
dholmes@6571 106 endif
dholmes@6571 107
dholmes@6571 108 ifeq ($(OPENJDK_TARGET_OS),windows)
dholmes@6571 109 ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar
dholmes@6571 110 endif
dholmes@6571 111
dholmes@6571 112 ifeq ($(PROFILE), profile_1)
dholmes@6571 113 PROFILE_JARS := $(PROFILE_1_JARS)
dholmes@6571 114 else ifeq ($(PROFILE), profile_2)
dholmes@6571 115 PROFILE_JARS := $(PROFILE_2_JARS)
dholmes@6571 116 else ifeq ($(PROFILE), profile_3)
dholmes@6571 117 PROFILE_JARS := $(PROFILE_3_JARS)
dholmes@6571 118 endif
dholmes@6571 119 ifneq ($(PROFILE),)
dholmes@6571 120 JARS := $(CUSTOM_PROFILE_JARS) $(PROFILE_JARS)
dholmes@6571 121 else
dholmes@6571 122 JARS := $(ALL_JARS)
dholmes@6571 123 endif
dholmes@6571 124
dholmes@6571 125 ###############################################################################
dholmes@6571 126 # JRE contents
dholmes@6571 127 ###############################################################################
dholmes@6571 128
dholmes@6571 129
dholmes@6571 130 # we don't need to do anything if not building a profile
dholmes@6571 131 ifneq ($(PROFILE),)
dholmes@6571 132
dholmes@6571 133
dholmes@6571 134 # Need all files to generate the exclude lists
dholmes@6571 135 NEW_ALL_BIN_LIST := $(patsubst $(JDK_OUTPUTDIR)/bin/%,%,$(shell $(FIND) $(JDK_OUTPUTDIR)/bin \( -type f -o -type l \) ! -name "sjavac"))
dholmes@6571 136
dholmes@6571 137 ALL_JRE_BIN_FILES := \
dholmes@6571 138 $(PROFILE_1_JRE_BIN_FILES) \
dholmes@6571 139 $(PROFILE_2_JRE_BIN_FILES) \
dholmes@6571 140 $(PROFILE_3_JRE_BIN_FILES) \
dholmes@6787 141 $(FULL_JRE_BIN_FILES)
dholmes@6571 142
dholmes@6571 143 NOT_JRE_BIN_FILES := $(filter-out $(ALL_JRE_BIN_FILES), $(NEW_ALL_BIN_LIST))
dholmes@6571 144
dholmes@6571 145 # Additional exclusions for profile JRE
dholmes@6571 146 ifeq ($(PROFILE), profile_1)
dholmes@6571 147 NOT_JRE_BIN_FILES += \
dholmes@6571 148 $(PROFILE_2_JRE_BIN_FILES) \
dholmes@6571 149 $(PROFILE_3_JRE_BIN_FILES) \
dholmes@6787 150 $(FULL_JRE_BIN_FILES)
dholmes@6571 151 endif
dholmes@6571 152
dholmes@6571 153 ifeq ($(PROFILE), profile_2)
dholmes@6571 154 NOT_JRE_BIN_FILES += \
dholmes@6571 155 $(PROFILE_3_JRE_BIN_FILES) \
dholmes@6787 156 $(FULL_JRE_BIN_FILES)
dholmes@6571 157 endif
dholmes@6571 158
dholmes@6571 159 ifeq ($(PROFILE), profile_3)
dholmes@6571 160 NOT_JRE_BIN_FILES += \
dholmes@6787 161 $(FULL_JRE_BIN_FILES)
dholmes@6571 162 endif
dholmes@6571 163
dholmes@6571 164 NOT_JRE_BIN_FILES := $(addprefix $(JDK_OUTPUTDIR)/bin/, $(NOT_JRE_BIN_FILES))
dholmes@6571 165
dholmes@6571 166 # Need all files to generate the exclude lists
dholmes@6571 167 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 " \) ))
dholmes@6571 168 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 " \) ))
dholmes@6571 169
dholmes@6571 170 ALL_JRE_LIB_FILES := \
dholmes@6571 171 $(PROFILE_1_JRE_LIB_FILES) \
dholmes@6571 172 $(PROFILE_2_JRE_LIB_FILES) \
dholmes@6571 173 $(PROFILE_3_JRE_LIB_FILES) \
dholmes@6787 174 $(FULL_JRE_LIB_FILES)
dholmes@6571 175
dholmes@6571 176 NOT_JRE_LIB_FILES := $(filter-out $(ALL_JRE_LIB_FILES), $(NEW_ALL_LIB_LIST))
dholmes@6571 177
dholmes@6571 178 # Although these are NOT JRE lib files we have to filter them from the list
dholmes@6571 179 # (ie cause them to be added them back in here) because the logic in
dholmes@6571 180 # Images.gmk expects them to be there and handles them differently.
dholmes@6571 181 # If we don't, they end up in the wrong place in the JDK image.
dholmes@6571 182 # This needs fixing.
dholmes@6571 183 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))
dholmes@6571 184
dholmes@6571 185 # Additional exclusions for profile JREs
dholmes@6571 186 ifeq ($(PROFILE), profile_1)
dholmes@6571 187 NOT_JRE_LIB_FILES += \
dholmes@6571 188 $(PROFILE_2_JRE_LIB_FILES) \
dholmes@6571 189 $(PROFILE_3_JRE_LIB_FILES) \
dholmes@6787 190 $(FULL_JRE_LIB_FILES)
dholmes@6571 191 endif
dholmes@6571 192
dholmes@6571 193 ifeq ($(PROFILE), profile_2)
dholmes@6571 194 NOT_JRE_LIB_FILES += \
dholmes@6571 195 $(PROFILE_3_JRE_LIB_FILES) \
dholmes@6787 196 $(FULL_JRE_LIB_FILES)
dholmes@6571 197 endif
dholmes@6571 198
dholmes@6571 199 ifeq ($(PROFILE), profile_3)
dholmes@6571 200 NOT_JRE_LIB_FILES += \
dholmes@6787 201 $(FULL_JRE_LIB_FILES)
dholmes@6571 202 endif
dholmes@6571 203
dholmes@6571 204 # Exclude the custom jar files as these will be added back via a special rule
dholmes@6571 205 NOT_JRE_LIB_FILES += $(CUSTOM_JARS)
dholmes@6571 206
dholmes@6571 207 ###############################################################################
dholmes@6571 208 # Customization of rt.jar file contents
dholmes@6571 209 # These are expressed as exclusions from everything found in the
dholmes@6571 210 # JDK_OUTPUTDIR/classes directory
dholmes@6571 211 ###############################################################################
dholmes@6571 212
dholmes@6571 213 # The main set of excluded types/packages (ie everything not destined to be
dholmes@6571 214 # part of rt.jar or resources.jar is captured in the CreateJars.gmk RT_JAR_EXCLUDES
dholmes@6571 215 # variable. We add to that for the per-profile exclusion lists
dholmes@6571 216
dholmes@6571 217 # For each profile we have four variables:
dholmes@6571 218 #
dholmes@6571 219 # - PROFILE_n_RTJAR_INCLUDE_PACKAGES
dholmes@6571 220 #
dholmes@6571 221 # This is a package prefix indicating that all classes in that package
dholmes@6571 222 # and conditionally its subpackages are included in rt.jar for this profile.
dholmes@6571 223 # The subpackages will be included as long as they do not appear in the
dholmes@6571 224 # include list of a higher profile
dholmes@6571 225 #
dholmes@6571 226 # - PROFILE_n_RTJAR_INCLUDE_TYPES
dholmes@6571 227 #
dholmes@6571 228 # These are specific types that must be included within a package.
dholmes@6571 229 # There are two cases:
dholmes@6571 230 # - individual types in a package that is otherwise excluded at this
dholmes@6571 231 # profile level. The only arises if there are split packages.
dholmes@6571 232 #
dholmes@6571 233 # - A higher-level package is included in a high profile where a subpackage
dholmes@6571 234 # is included in a lower profile. Including the package in the high profile
dholmes@6571 235 # would exclude it and all subpackages from the lower profile, so instead
dholmes@6571 236 # the classes in the package are listed for that higher profile (as *.class)
dholmes@6571 237 #
dholmes@6571 238 # These types are explicitly added back into the rt.jar content lists.
dholmes@6571 239 #
dholmes@6571 240 # - PROFILE_n_RTJAR_EXCLUDE_TYPES
dholmes@6571 241 #
dholmes@6571 242 # These are specific types that must be excluded even though most of the
dholmes@6571 243 # containing package is include. Again this occurs with split packges.
dholmes@6571 244 #
dholmes@6571 245 # So the exclude list for each profile consists of the include lists
dholmes@6571 246 # for all profiles above it, together with any explicitly excluded types.
dholmes@6571 247 # This is then combined with the overall RT_JAR_EXCLUDES list (which covers
dholmes@6571 248 # things that go into other jar files).
dholmes@6571 249 #
dholmes@6571 250 # We also have to define the types to be explicitly included. This
dholmes@6571 251 # accumulates up the profiles ie profile 3 has to include the types
dholmes@6571 252 # that profiles 1 and 2 had to include. This is unnecessary if, for example,
dholmes@6571 253 # profile 3 includes the entire package, but it is harmless to add them
dholmes@6571 254 # explicitly, and complex to determine if we still need to include them.
dholmes@6571 255 #
dholmes@6571 256 # Need a way to express:
dholmes@6571 257 # for (int i = profile+1; i < 4; i++)
dholmes@6571 258 # RT_JAR_EXCLUDES += PROFILE_$i_RTJAR_INCLUDE_PACKAGES
dholmes@6571 259 #
dholmes@6571 260 # Do it the long way for now
dholmes@6571 261 #
dholmes@6571 262 # - PROFILE_n_INCLUDE_METAINF_SERVICES
dholmes@6571 263 #
dholmes@6571 264 # These are META-INF/services/ entries found in resources.jar. Together
dholmes@6571 265 # resources.jar and rt.jar hold the contents of the classes directory, (the
dholmes@6571 266 # classes in rt.jar and everything else in resources.jar).Hence the
dholmes@6571 267 # include/exclude information for resources.jar is tied to that of rt.jar
dholmes@6571 268
dholmes@6571 269 include profile-rtjar-includes.txt
dholmes@6571 270
dholmes@6571 271 # Function to expand foo/*.class into the set of classes
dholmes@6571 272 # NOTE: Classfiles with $ in their name are problematic as that is the
dholmes@6571 273 # meta-character for both make and the shell! Hence the \$$$$ substitution.
dholmes@6571 274 # But note that if you echo these values they will NOT display as expected.
dholmes@6571 275 class_list = $(patsubst $(JDK_OUTPUTDIR)/classes/%,%,\
dholmes@6571 276 $(foreach i,$(1), $(subst $$,\$$$$, $(wildcard $(JDK_OUTPUTDIR)/classes/$i))))
dholmes@6571 277
dholmes@6571 278 ifeq ($(PROFILE), profile_1)
dholmes@6571 279 RT_JAR_EXCLUDES += \
dholmes@6787 280 $(call class_list, $(PROFILE_1_RTJAR_EXCLUDE_TYPES)) \
dholmes@6571 281 $(PROFILE_2_RTJAR_INCLUDE_PACKAGES) \
dholmes@6571 282 $(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES)) \
dholmes@6571 283 $(PROFILE_3_RTJAR_INCLUDE_PACKAGES) \
dholmes@6571 284 $(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES)) \
dholmes@6787 285 $(FULL_JRE_RTJAR_INCLUDE_PACKAGES) \
dholmes@6787 286 $(call class_list, $(FULL_JRE_RTJAR_INCLUDE_TYPES))
dholmes@6571 287 RT_JAR_INCLUDE_TYPES := \
dholmes@6571 288 $(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES))
dholmes@6571 289 PROFILE_INCLUDE_METAINF_SERVICES := \
dholmes@6571 290 $(PROFILE_1_INCLUDE_METAINF_SERVICES)
dholmes@6571 291 endif
dholmes@6571 292 ifeq ($(PROFILE), profile_2)
dholmes@6571 293 RT_JAR_EXCLUDES += \
dholmes@6787 294 $(call class_list, $(PROFILE_2_RTJAR_EXCLUDE_TYPES)) \
dholmes@6571 295 $(PROFILE_3_RTJAR_INCLUDE_PACKAGES) \
dholmes@6571 296 $(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES)) \
dholmes@6787 297 $(FULL_JRE_RTJAR_INCLUDE_PACKAGES) \
dholmes@6787 298 $(call class_list, $(FULL_JRE_RTJAR_INCLUDE_TYPES))
dholmes@6571 299 RT_JAR_INCLUDE_TYPES := \
dholmes@6571 300 $(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES)) \
dholmes@6571 301 $(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES))
dholmes@6571 302 PROFILE_INCLUDE_METAINF_SERVICES := \
dholmes@6571 303 $(PROFILE_1_INCLUDE_METAINF_SERVICES) \
dholmes@6571 304 $(PROFILE_2_INCLUDE_METAINF_SERVICES)
dholmes@6571 305 endif
dholmes@6571 306 ifeq ($(PROFILE), profile_3)
dholmes@6571 307 RT_JAR_EXCLUDES += \
dholmes@6787 308 $(call class_list, $(PROFILE_3_RTJAR_EXCLUDE_TYPES)) \
dholmes@6787 309 $(FULL_JRE_RTJAR_INCLUDE_PACKAGES) \
dholmes@6787 310 $(call class_list, $(FULL_JRE_RTJAR_INCLUDE_TYPES))
dholmes@6571 311 RT_JAR_INCLUDE_TYPES := \
dholmes@6571 312 $(call class_list, $(PROFILE_1_RTJAR_INCLUDE_TYPES)) \
dholmes@6571 313 $(call class_list, $(PROFILE_2_RTJAR_INCLUDE_TYPES)) \
dholmes@6571 314 $(call class_list, $(PROFILE_3_RTJAR_INCLUDE_TYPES))
dholmes@6571 315 PROFILE_INCLUDE_METAINF_SERVICES := \
dholmes@6571 316 $(PROFILE_1_INCLUDE_METAINF_SERVICES) \
dholmes@6571 317 $(PROFILE_2_INCLUDE_METAINF_SERVICES) \
dholmes@6571 318 $(PROFILE_3_INCLUDE_METAINF_SERVICES)
dholmes@6571 319 endif
dholmes@6571 320
dholmes@6571 321 # Filter out non-OpenJDK services
dholmes@6571 322 ifdef OPENJDK
dholmes@6571 323 EXCLUDED_SERVICES := META-INF/services/javax.script.ScriptEngineFactory
dholmes@6571 324 PROFILE_INCLUDE_METAINF_SERVICES := $(filter-out $(EXCLUDED_SERVICES),$(PROFILE_INCLUDE_METAINF_SERVICES))
dholmes@6571 325 endif
dholmes@6571 326
dholmes@6571 327
dholmes@6571 328 endif # profile
dholmes@6571 329