1 #
   2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 include $(SPEC)
  27 include MakeBase.gmk
  28 include JavaCompilation.gmk
  29 include Setup.gmk
  30 
  31 default: all
  32 
  33 include Tools.gmk
  34 
  35 include Profiles.gmk
  36 
  37 #
  38 # This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
  39 #
  40 MAKEFILE=$(JDK_TOPDIR)/makefiles/CreateJars.gmk
  41 #
  42 # And similarly for the Profiles
  43 PROFILE_MAKEFILES=$(JDK_TOPDIR)/makefiles/Profiles.gmk $(JDK_TOPDIR)/makefiles/profile-rtjar-includes.txt
  44 
  45 MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
  46 BEANMANIFEST := $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest
  47 
  48 $(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/lib))
  49 
  50 ##########################################################################################
  51 
  52 $(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,,\
  53                 SRCS:=$(JDK_OUTPUTDIR)/classes,\
  54                 SUFFIXES:=.class .gif .png .properties,\
  55                 INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
  56                 JARMAIN:=sun.tools.jconsole.JConsole,\
  57                 JAR:=$(IMAGES_OUTPUTDIR)/lib/jconsole.jar,\
  58                 SKIP_METAINF:=true))
  59 
  60 
  61 ##########################################################################################
  62 
  63 $(eval $(call SetupArchive,BUILD_DNS_JAR,,\
  64                 SRCS:=$(JDK_OUTPUTDIR)/classes,\
  65                 INCLUDES:=sun/net/spi/nameservice/dns,\
  66                 EXTRA_FILES:=META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor,\
  67                 JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar,\
  68                 SKIP_METAINF:=true))
  69 
  70 
  71 ##########################################################################################
  72 
  73 LOCALEDATA_INCLUDE_LOCALES := ar be bg ca cs da de el es et fi fr ga hi hr hu in is it \
  74                               iw ja ko lt lv mk ms mt nl no pl pt ro ru sk sl sq sr sv \
  75                               th tr uk vi zh
  76 
  77 LOCALEDATA_INCLUDES := $(addprefix sun/text/resources/,$(LOCALEDATA_INCLUDE_LOCALES)) \
  78                        $(addprefix sun/util/resources/,$(LOCALEDATA_INCLUDE_LOCALES))
  79 
  80 # For non-US English locale data
  81 
  82 LOCALEDATA_INCLUDES += \
  83                 sun/text/resources/en/FormatData_en_AU.class \
  84                 sun/text/resources/en/FormatData_en_CA.class \
  85                 sun/text/resources/en/FormatData_en_GB.class \
  86                 sun/text/resources/en/FormatData_en_IE.class \
  87                 sun/text/resources/en/FormatData_en_IN.class \
  88                 sun/text/resources/en/FormatData_en_MT.class \
  89                 sun/text/resources/en/FormatData_en_NZ.class \
  90                 sun/text/resources/en/FormatData_en_PH.class \
  91                 sun/text/resources/en/FormatData_en_SG.class \
  92                 sun/text/resources/en/FormatData_en_ZA.class \
  93                 sun/util/resources/en/CalendarData_en_GB.class \
  94                 sun/util/resources/en/CalendarData_en_IE.class \
  95                 sun/util/resources/en/CalendarData_en_MT.class \
  96                 sun/util/resources/en/CurrencyNames_en_AU.class \
  97                 sun/util/resources/en/CurrencyNames_en_CA.class \
  98                 sun/util/resources/en/CurrencyNames_en_GB.class \
  99                 sun/util/resources/en/CurrencyNames_en_IE.class \
 100                 sun/util/resources/en/CurrencyNames_en_IN.class \
 101                 sun/util/resources/en/CurrencyNames_en_MT.class \
 102                 sun/util/resources/en/CurrencyNames_en_NZ.class \
 103                 sun/util/resources/en/CurrencyNames_en_PH.class \
 104                 sun/util/resources/en/CurrencyNames_en_SG.class \
 105                 sun/util/resources/en/CurrencyNames_en_ZA.class \
 106                 sun/util/resources/en/LocaleNames_en_MT.class \
 107                 sun/util/resources/en/LocaleNames_en_PH.class \
 108                 sun/util/resources/en/LocaleNames_en_SG.class \
 109                 sun/util/resources/en/TimeZoneNames_en_CA.class \
 110                 sun/util/resources/en/TimeZoneNames_en_GB.class \
 111                 sun/util/resources/en/TimeZoneNames_en_IE.class
 112 
 113 $(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\
 114                 SRCS:=$(JDK_OUTPUTDIR)/classes,\
 115                 SUFFIXES:=.class _dict _th,\
 116                 INCLUDES:=$(LOCALEDATA_INCLUDES),\
 117                 EXCLUDES:=sun/text/resources/th/BreakIteratorRules_th.class,\
 118                 JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar,\
 119                 SKIP_METAINF:=true))
 120 
 121 ##########################################################################################
 122 #
 123 # Different variants of rt.jar are built based on the current profile. The output
 124 # directory is augmented with the profile name so that the final jar file and all the
 125 # intermediary list files will be in directory. This has the form lib$PROFILE rather than
 126 # lib/$PROFILE so that it won't get copied as part of the image generation process.
 127 # Each profile customizes the RT_JAR_EXCLUDES variable.
 128 #
 129 ##########################################################################################
 130 
 131 # Find all files in the classes dir to use as dependencies. This could be more fine granular.
 132 ALL_FILES_IN_CLASSES := $(shell $(FIND) $(JDK_OUTPUTDIR)/classes -type f \
 133                         | $(GREP) -v -e '/_the\.*' -e '^_the\.*' -e 'javac_state')
 134 
 135 RT_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar_manifest
 136 RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar_manifest
 137 
 138 $(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
 139         $(MKDIR) -p $(@D)
 140         $(RM) $@ $@.tmp
 141         $(SED) -e "s#@@RELEASE@@#$(RELEASE)#"           \
 142                -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
 143                $(MAINMANIFEST) >> $@.tmp
 144         $(ECHO) >> $@.tmp
 145         $(CAT) $(BEANMANIFEST) >> $@.tmp
 146         $(MV) $@.tmp $@
 147 
 148 $(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
 149         $(MKDIR) -p $(@D)
 150         $(RM) $@ $@.tmp
 151         $(SED) -e "s#@@RELEASE@@#$(RELEASE)#"           \
 152                -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
 153                $(MAINMANIFEST) >> $@.tmp
 154         $(MV) $@.tmp $@
 155 
 156 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude: $(MAKEFILE) $(PROFILE_MAKEFILES)
 157         $(MKDIR) -p $(@D)
 158         $(RM) $@ $@.tmp
 159         $(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@.tmp)
 160         $(MV) $@.tmp $@
 161 
 162 $(IMAGES_OUTPUTDIR)/lib/classlist : $(JDK_TOPDIR)/make/tools/sharing/classlist.$(OPENJDK_TARGET_OS) \
 163   $(MAKEFILE)
 164         $(MKDIR) -p $(@D)
 165         $(RM) $@ $@.tmp
 166         $(TOOL_ADDJSUM) $< $@.tmp
 167         $(MV) $@.tmp $@
 168 
 169 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents: $(BUILD_TOOLS) $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude \
 170                                          $(ALL_FILES_IN_CLASSES) $(IMAGES_OUTPUTDIR)/lib/classlist
 171         $(MKDIR) -p $(@D)
 172         $(RM) $@ $@.tmp
 173         ($(CD) $(JDK_OUTPUTDIR)/classes && \
 174             $(TOOL_JARREORDER) \
 175                 -o  $@.tmp $(IMAGES_OUTPUTDIR)/lib/classlist $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude . )
 176         $(MV) $@.tmp $@
 177 
 178 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
 179         $(MKDIR) -p $(@D)
 180         $(RM) $@ $@.tmp
 181         $(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
 182         $(MV) $@.tmp $@
 183         # Add back classes from excluded packages (fixing the $ substitution in the process)
 184         for type in  $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
 185           $(ECHO) $$type >> $@ ; \
 186         done
 187 
 188 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
 189         $(MKDIR) -p $(@D)
 190         $(RM) $@ $@.tmp
 191         # Strip out all META-INF/services/ entries
 192         $(GREP) -v -e '\.class$$' \
 193             -e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' -e 'META-INF/services/' \
 194             $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
 195         # Add back the required services
 196         for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
 197           $(ECHO) $$service >> $@.tmp; \
 198         done
 199         $(MV) $@.tmp $@
 200 
 201 # This is a hack but I don't know how to make this fit into the existing scheme
 202 $(PROFILE_VERSION_CLASS_TARGETS) : $(PROFILE_VERSION_JAVA_TARGETS)
 203         @$(JAVAC) -d $(@D)/../../ $(@D)/$(VERSION_JAVA_FILE)
 204 
 205 
 206 # Support for removing the addPropertyChangeListener and removePropertyChangeListener
 207 # methods from classes that only go into the profile builds. For now the Pack200.Packer
 208 # and Packer200.Unpacker classes have special handling because of the $ in the file
 209 # name.
 210 BEANLESS_CLASSES = $(JDK_OUTPUTDIR)/beanless
 211 
 212 $(BEANLESS_CLASSES)/%: $(JDK_OUTPUTDIR)/classes/%
 213         $(MKDIR) -p $(@D)
 214         $(TOOL_REMOVEMETHODS) $< $@ addPropertyChangeListener removePropertyChangeListener
 215 
 216 CLASSES_TO_DEBEAN = \
 217     java/util/logging/LogManager.class \
 218     com/sun/java/util/jar/pack/PackerImpl.class \
 219     com/sun/java/util/jar/pack/UnpackerImpl.class
 220 
 221 BEANLESS_CLASSES_TARGETS =
 222 ifneq ($(PROFILE),)
 223     BEANLESS_CLASSES_TARGETS := $(foreach c, $(CLASSES_TO_DEBEAN), $(BEANLESS_CLASSES)/$c)
 224 endif
 225 
 226 
 227 RT_JAR_CREATE_OPTIONS := c0fm
 228 RT_JAR_UPDATE_OPTIONS := u0f
 229 ifeq ($(COMPRESS_JARS), true)
 230     RT_JAR_CREATE_OPTIONS := cfm
 231     RT_JAR_UPDATE_OPTIONS := uf
 232 endif
 233 
 234 # This defines a target-specific variables to make the shell logic easier to see.
 235 # We need to find the Version.class file for the profile currently being built
 236 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: \
 237   CLASS_FILE = $(if $(PROFILE),$(strip $(foreach class,$(PROFILE_VERSION_CLASS_TARGETS),$(if $(findstring $(PROFILE),$(class)),$(class)))), NO_SUCH_FILE)
 238 # This is the real target
 239 $(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)
 240         $(ECHO) Creating rt.jar $(PROFILE) Compressed=$(COMPRESS_JARS)
 241         $(MKDIR) -p $(@D)
 242         $(RM) $@ $@.tmp
 243         $(CD) $(JDK_OUTPUTDIR)/classes && \
 244             $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RT_JAR_MANIFEST_FILE) \
 245                 @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents && \
 246             if [ -f $(CLASS_FILE) ]; then \
 247               $(ECHO)  Updating rt.jar $(PROFILE) && \
 248               $(CD) $(patsubst %$(VERSION_CLASS_PATH),%,$(CLASS_FILE)) && \
 249                 $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(VERSION_CLASS_PATH); \
 250               $(MKDIR) -p $(BEANLESS_CLASSES)/java/util/jar; \
 251               $(TOOL_REMOVEMETHODS) $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200\$$Packer.class \
 252                 $(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Packer.class addPropertyChangeListener removePropertyChangeListener; \
 253               $(TOOL_REMOVEMETHODS) $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200\$$Unpacker.class \
 254                 $(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Unpacker.class addPropertyChangeListener removePropertyChangeListener; \
 255               $(CD) $(BEANLESS_CLASSES) && \
 256                 $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(CLASSES_TO_DEBEAN) java/util/jar/* ; \
 257             fi
 258         $(MV) $@.tmp $@
 259 
 260 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/resources.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents \
 261                                     $(RESOURCE_JAR_MANIFEST_FILE)
 262         $(ECHO) Creating resources.jar
 263         $(MKDIR) -p $(@D)
 264         $(RM) $@ $@.tmp
 265         $(CD) $(JDK_OUTPUTDIR)/classes && \
 266             $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RESOURCE_JAR_MANIFEST_FILE) \
 267                 @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents
 268         $(MV) $@.tmp $@
 269 
 270 ##########################################################################################
 271 
 272 ifneq ($(OPENJDK_TARGET_OS), windows)
 273     CHARSETS_EXTRA_FILES:=sun/awt/motif/X11GBK.class \
 274                           sun/awt/motif/X11GB2312\$$$$Decoder.class \
 275                           sun/awt/motif/X11GB2312.class \
 276                           sun/awt/motif/X11KSC5601\$$$$Decoder.class \
 277                           sun/awt/motif/X11KSC5601\$$$$Encoder.class \
 278                           sun/awt/motif/X11GB2312\$$$$Encoder.class \
 279                           sun/awt/motif/X11GBK\$$$$Encoder.class \
 280                           sun/awt/motif/X11KSC5601.class
 281 endif
 282 
 283 $(eval $(call SetupArchive,BUILD_CHARSETS_JAR,,\
 284                 SRCS:=$(JDK_OUTPUTDIR)/classes, \
 285                 SUFFIXES:=.class .dat,\
 286                 INCLUDES:=sun/nio/cs/ext,\
 287                 EXTRA_FILES := sun/awt/HKSCS.class \
 288                                $(CHARSETS_EXTRA_FILES) \
 289                                META-INF/services/java.nio.charset.spi.CharsetProvider, \
 290                 JAR:=$(IMAGES_OUTPUTDIR)/lib/charsets.jar, \
 291                 SKIP_METAINF := true, \
 292                 CHECK_COMPRESS_JAR:=true))
 293 
 294 ##########################################################################################
 295 
 296 ifndef OPENJDK
 297 ifeq ($(ENABLE_JFR), true)
 298     $(eval $(call SetupArchive,BUILD_JFR_JAR,,\
 299                 SRCS:=$(JDK_OUTPUTDIR)/classes,\
 300                 INCLUDES:=com/oracle/jrockit/jfr \
 301                           oracle/jrockit/jfr,\
 302                 JAR:=$(IMAGES_OUTPUTDIR)/lib/jfr.jar,\
 303                 SKIP_METAINF:=true,\
 304                 MANIFEST:=$(MAINMANIFEST), \
 305                 CHECK_COMPRESS_JAR:=true))
 306 
 307 endif
 308 endif
 309 
 310 ##########################################################################################
 311 
 312 $(eval $(call SetupArchive,BUILD_JSSE_JAR,,\
 313                 SRCS:=$(JDK_OUTPUTDIR)/classes,\
 314                 INCLUDES:=sun/security/provider/Sun.class \
 315                           sun/security/rsa/SunRsaSign.class \
 316                           sun/security/ssl \
 317                           com/sun/net/ssl/internal/ssl,\
 318                 JAR:=$(IMAGES_OUTPUTDIR)/lib/jsse.jar,\
 319                 SKIP_METAINF:=true,\
 320                 MANIFEST:=$(MAINMANIFEST), \
 321                 CHECK_COMPRESS_JAR:=true))
 322 
 323 ##########################################################################################
 324 # Create manifest for security jars
 325 
 326 #
 327 # Include these extra attributes for now, should probably take out.
 328 #
 329 JCE_MANIFEST := $(IMAGES_OUTPUTDIR)/lib/_the.security.manifest.mf
 330 $(JCE_MANIFEST): $(MAINMANIFEST)
 331         $(MKDIR) -p $(@D)
 332         $(RM) $@ $@.tmp
 333         $(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#"       \
 334                -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
 335                $(MAINMANIFEST) >> $@.tmp
 336         $(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
 337         $(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
 338         $(MV) $@.tmp $@
 339 
 340 ##########################################################################################
 341 
 342 SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar
 343 
 344 ifndef OPENJDK
 345 
 346     SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
 347 
 348     $(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_SRC)
 349         @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
 350         $(install-file)
 351 
 352 else
 353 
 354     $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR,,\
 355         SRCS:=$(JDK_OUTPUTDIR)/classes, \
 356         SUFFIXES:=.class,\
 357         INCLUDES:=sun/security/pkcs11,\
 358         JAR:=$(SUNPKCS11_JAR_DST), \
 359         MANIFEST:=$(JCE_MANIFEST), \
 360         SKIP_METAINF := true))
 361 
 362     $(SUNPKCS11_JAR_DST): $(JCE_MANIFEST)
 363 
 364 endif
 365 
 366 ##########################################################################################
 367 
 368 SUNEC_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunec.jar
 369 
 370 ifndef OPENJDK
 371 
 372     SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
 373 
 374     $(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
 375         @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
 376         $(install-file)
 377 
 378 else
 379 
 380     $(eval $(call SetupArchive,BUILD_SUNEC_JAR,,\
 381                 SRCS:=$(JDK_OUTPUTDIR)/classes, \
 382                 SUFFIXES:=.class,\
 383                 INCLUDES:=sun/security/ec,\
 384                 JAR:=$(SUNEC_JAR_DST), \
 385                 MANIFEST:=$(JCE_MANIFEST), \
 386                 SKIP_METAINF := true))
 387 
 388     $(SUNEC_JAR_DST): $(JCE_MANIFEST)
 389 
 390 endif
 391 
 392 
 393 ##########################################################################################
 394 
 395 $(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR,,\
 396                 SRCS:=$(JDK_OUTPUTDIR)/classes,\
 397                 SUFFIXES:=BeanInfo.class .gif,\
 398                 INCLUDES:=javax/swing sun/swing,\
 399                 EXCLUDES:=javax/swing/plaf,\
 400                 EXTRA_FILES:=javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class,\
 401                 JAR:=$(IMAGES_OUTPUTDIR)/lib/dt.jar,\
 402                 SKIP_METAINF:=true))
 403 
 404 ##########################################################################################
 405 
 406 SUNJCE_PROVIDER_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunjce_provider.jar
 407 
 408 ifndef OPENJDK
 409     SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
 410 
 411     $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_SRC)
 412         @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
 413         $(install-file)
 414 
 415 else
 416 
 417     $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR,,\
 418                 SRCS:=$(JDK_OUTPUTDIR)/classes, \
 419                 SUFFIXES:=.class,\
 420                 INCLUDES:= com/sun/crypto/provider,\
 421                 JAR:=$(SUNJCE_PROVIDER_JAR_DST), \
 422                 MANIFEST:=$(JCE_MANIFEST), \
 423                 SKIP_METAINF := true))
 424 
 425     $(SUNJCE_PROVIDER_JAR_DST): $(JCE_MANIFEST)
 426 
 427 endif
 428 
 429 JCE_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/jce.jar
 430 
 431 ifndef OPENJDK
 432 
 433     JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
 434 
 435     $(JCE_JAR_DST) : $(JCE_JAR_SRC)
 436         @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
 437         $(install-file)
 438 
 439 else
 440 
 441     $(eval $(call SetupArchive,BUILD_JCE_JAR,,\
 442                 SRCS:=$(JDK_OUTPUTDIR)/classes, \
 443                 SUFFIXES:=.class,\
 444                 INCLUDES:= javax/crypto sun/security/internal,\
 445                 JAR:=$(JCE_JAR_DST), \
 446                 MANIFEST:=$(JCE_MANIFEST), \
 447                 SKIP_METAINF := true))
 448 
 449     $(JCE_JAR_DST): $(JCE_MANIFEST)
 450 
 451 endif
 452 
 453 
 454 ##########################################################################################
 455 
 456 US_EXPORT_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/US_export_policy.jar
 457 
 458 ifndef OPENJDK
 459 
 460 
 461     $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
 462         $(ECHO) $(LOG_INFO) Copying $(@F)
 463         $(install-file)
 464 
 465 else
 466 
 467     #
 468     # TODO fix so that SetupArchive does not write files into SRCS
 469     #   then we don't need this extra copying
 470     #
 471     # NOTE:  We currently do not place restrictions on our limited export
 472     # policy.  This was not a typo.
 473     #
 474     US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
 475     US_EXPORT_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/US_export_policy_jar.tmp
 476 
 477     $(US_EXPORT_POLICY_JAR_TMP)/% : $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
 478         $(install-file)
 479 
 480     US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
 481 
 482     $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR,$(US_EXPORT_POLICY_JAR_DEPS),\
 483                 SRCS:=$(US_EXPORT_POLICY_JAR_TMP), \
 484                 SUFFIXES:= .policy,\
 485                 JAR:=$(US_EXPORT_POLICY_JAR_DST), \
 486                 EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
 487                 SKIP_METAINF := true))
 488 
 489 endif
 490 
 491 ##########################################################################################
 492 
 493 LOCAL_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/local_policy.jar
 494 
 495 ifndef OPENJDK
 496 
 497     $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
 498         $(ECHO) $(LOG_INFO) Copying $(@F)
 499         $(install-file)
 500 
 501 else
 502 
 503     #
 504     # TODO fix so that SetupArchive does not write files into SRCS
 505     #   then we don't need this extra copying
 506     #
 507     LOCAL_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/local_policy_jar.tmp
 508 
 509     ifeq ($(UNLIMITED_CRYPTO), true)
 510         LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
 511         LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
 512         LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
 513     else
 514         LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
 515         LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
 516                                  $(LOCAL_POLICY_JAR_TMP)/default_local.policy
 517         LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
 518     endif
 519 
 520     $(LOCAL_POLICY_JAR_TMP)/% : $(LOCAL_POLICY_JAR_SRC_DIR)/%
 521         $(install-file)
 522 
 523     $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR,$(LOCAL_POLICY_JAR_DEPS),\
 524                 SRCS:=$(LOCAL_POLICY_JAR_TMP),\
 525                 SUFFIXES:= .policy,\
 526                 JAR:=$(LOCAL_POLICY_JAR_DST), \
 527                 EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
 528                 SKIP_METAINF := true))
 529 
 530 endif
 531 
 532 ##########################################################################################
 533 
 534 ifeq ($(OPENJDK_TARGET_OS),windows)
 535 
 536 SUNMSCAPI_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar
 537 
 538 ifndef OPENJDK
 539 SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
 540 
 541 $(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_SRC)
 542         @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
 543         $(install-file)
 544 
 545 else
 546 
 547 $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR,,\
 548                 SRCS:=$(JDK_OUTPUTDIR)/classes, \
 549                 SUFFIXES:=.class,\
 550                 INCLUDES:= sun/security/mscapi,\
 551                 JAR:=$(SUNMSCAPI_JAR_DST), \
 552                 SKIP_METAINF:=true))
 553 endif
 554 
 555 endif
 556 
 557 ##########################################################################################
 558 
 559 ifeq ($(OPENJDK_TARGET_OS),solaris)
 560 ifndef OPENJDK
 561 
 562 UCRYPTO_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar
 563 UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
 564 
 565 $(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC)
 566         @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
 567         $(install-file)
 568 
 569 endif
 570 endif
 571 
 572 ##########################################################################################
 573 
 574 # Get the CLDRVERSION
 575 include GensrcCLDR.gmk
 576 
 577 CLDRDATA_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/cldrdata.jar
 578 
 579 $(eval $(call SetupArchive,BUILD_CLDRDATA_JAR,,\
 580                 SRCS:=$(JDK_OUTPUTDIR)/classes,\
 581                 SUFFIXES:=.class,\
 582                 INCLUDES:=sun/text/resources/cldr \
 583                           sun/util/cldr \
 584                           sun/util/resources/cldr,\
 585                 EXCLUDES:=sun/util/cldr/CLDRLocaleProviderAdapter,\
 586                 JAR:=$(CLDRDATA_JAR_DST),\
 587                 EXTRA_MANIFEST_ATTR:=CLDR-Version: $(CLDRVERSION),\
 588                 SKIP_METAINF:=true))
 589 
 590 ##########################################################################################
 591 
 592 TOOLS_JAR_INCLUDES := \
 593         sun/tools/asm           \
 594         sun/tools/jar           \
 595         sun/tools/java          \
 596         sun/tools/javac         \
 597         sun/tools/jcmd          \
 598         sun/tools/jps           \
 599         sun/tools/jstat         \
 600         sun/tools/jstatd        \
 601         sun/tools/native2ascii  \
 602         sun/tools/serialver     \
 603         sun/tools/tree          \
 604         sun/tools/util          \
 605         sun/security/tools/jarsigner \
 606         sun/rmi/rmic            \
 607         sun/applet              \
 608         sun/jvmstat             \
 609         com/sun/javadoc         \
 610         com/sun/jdi             \
 611         com/sun/jarsigner       \
 612         com/sun/source          \
 613         com/sun/tools/classfile \
 614         com/sun/tools/doclets   \
 615         com/sun/tools/example/debug/expr \
 616         com/sun/tools/example/debug/tty  \
 617         com/sun/tools/extcheck  \
 618         com/sun/tools/hat       \
 619         com/sun/tools/javac     \
 620         com/sun/tools/javadoc   \
 621         com/sun/tools/javah     \
 622         com/sun/tools/javap     \
 623         com/sun/tools/corba     \
 624         com/sun/tools/internal/xjc       \
 625         com/sun/tools/internal/ws       \
 626         com/sun/istack/internal/tools       \
 627         com/sun/tools/internal/jxc/ap   \
 628         com/sun/tools/internal/ws/wscompile/plugin/at_generated \
 629         com/sun/codemodel       \
 630         com/sun/tools/internal/jxc             \
 631         com/sun/xml/internal/rngom       \
 632         com/sun/xml/internal/xsom       \
 633         org/relaxng/datatype   \
 634         com/sun/xml/internal/dtdparser \
 635         com/sun/tools/jdi       \
 636         com/sun/tools/script/shell      \
 637         com/sun/tools/attach    \
 638         sun/tools/attach        \
 639         sun/tools/jstack        \
 640         sun/tools/jinfo         \
 641         sun/tools/jmap
 642 
 643 # The sjavac tools is not ready for public consumption.
 644 TOOLS_JAR_EXCLUDES=com/sun/tools/sjavac
 645 
 646 $(eval $(call SetupArchive,BUILD_TOOLS_JAR,,\
 647                 SRCS:=$(JDK_OUTPUTDIR)/classes,\
 648                 SUFFIXES:=.class .prp .gif .properties .xml .css .xsd .js .html .txt .java \
 649                           Tool aliasmap options,\
 650                 INCLUDES:=$(TOOLS_JAR_INCLUDES),\
 651                 EXCLUDES:=$(TOOLS_JAR_EXCLUDES),\
 652                 EXTRA_FILES:=META-INF/services/com.sun.jdi.connect.Connector \
 653                              META-INF/services/com.sun.jdi.connect.spi.TransportService \
 654                              META-INF/services/com.sun.tools.attach.spi.AttachProvider \
 655                              META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
 656                              META-INF/services/com.sun.tools.internal.xjc.Plugin,\
 657                 JAR:=$(IMAGES_OUTPUTDIR)/lib/tools.jar,\
 658                 SKIP_METAINF:=true, \
 659                 CHECK_COMPRESS_JAR:=true))
 660 
 661 
 662 ##########################################################################################
 663 
 664 include javadoc/CORE_PKGS.gmk
 665 include javadoc/NON_CORE_PKGS.gmk
 666 
 667 # The compiler should not issue a "Proprietary" warning when compiling
 668 # classes in the com.sun.java.swing.plaf packages, since we've always
 669 # allowed, and even advocated, extending them (see bug 6476749).
 670 #
 671 # This approach is NOT to be used as a general purpose way to avoid such
 672 # compiler warnings for non-core packages. The correct way is to document
 673 # the packages in NON_CORE_PKGS.gmk, and include them in the NON_CORE_PKGS
 674 # definition.
 675 #
 676 # Swing has taken this approach only as a temporary measure to avoid
 677 # the compiler warnings until we can properly document these packages.
 678 # This is covered under 6491853.
 679 EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows  \
 680                         com.sun.java.swing.plaf.motif    \
 681                         com.sun.java.swing.plaf.gtk
 682 
 683 #
 684 # Include the exported private packages in ct.sym.
 685 # This is an interim solution until the ct.sym is replaced
 686 # with a new module system (being discussed for JDK 8).
 687 #
 688 EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
 689                         com.oracle.net \
 690                         com.oracle.nio
 691 
 692 $(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
 693         $(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
 694         $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
 695         $(JAVA) $(JAVAC_JARS) \
 696             -bootclasspath $(JDK_OUTPUTDIR)/classes \
 697             -XDprocess.packages -proc:only \
 698             -processor com.sun.tools.javac.sym.CreateSymbols \
 699             -Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \
 700             -Acom.sun.tools.javac.sym.Dest=$(IMAGES_OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
 701             -Acom.sun.tools.javac.sym.Profiles=profile-rtjar-includes.txt \
 702             $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
 703         $(TOUCH) $@
 704 
 705 $(shell $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols)
 706 $(eval $(call SetupArchive,BUILD_CT_SYM,$(IMAGES_OUTPUTDIR)/symbols/_the.symbols,\
 707                 SRCS:=$(IMAGES_OUTPUTDIR)/symbols,\
 708                 INCLUDES:=META-INF/sym,\
 709                 JAR:=$(IMAGES_OUTPUTDIR)/lib/ct.sym, \
 710                 CHECK_COMPRESS_JAR:=true))
 711 
 712 
 713 ##########################################################################################
 714 
 715 SRC_ZIP_INCLUDES = \
 716         java/applet                     \
 717         java/awt                        \
 718         java/beans                      \
 719         java/io                         \
 720         java/lang                       \
 721         java/math                       \
 722         java/net                        \
 723         java/nio                        \
 724         java/rmi                        \
 725         java/security                   \
 726         java/sql                        \
 727         java/text                       \
 728         java/util                       \
 729         com/sun/corba                   \
 730         com/sun/image/codec/jpeg        \
 731         com/sun/imageio                 \
 732         com/sun/java/swing              \
 733         com/sun/javadoc                 \
 734         com/sun/jmx                     \
 735         com/sun/source                  \
 736         com/sun/naming                  \
 737         com/sun/security/auth           \
 738         com/sun/security/jgss           \
 739         javax/accessibility             \
 740         javax/annotation                \
 741         javax/script                    \
 742         javax/imageio                   \
 743         javax/lang                      \
 744         javax/management                \
 745         javax/naming                    \
 746         javax/print                     \
 747         javax/rmi                       \
 748         javax/security                  \
 749         javax/sound                     \
 750         javax/sql                       \
 751         javax/swing                     \
 752         javax/tools                     \
 753         javax/xml                       \
 754         com/sun/org/apache              \
 755         com/sun/java_cup                \
 756         com/sun/jlex                    \
 757         org/ietf                        \
 758         org/omg                         \
 759         org/w3c/dom                     \
 760         org/xml/sax                     \
 761         sunw
 762 
 763 SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes
 764 SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
 765 SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/impsrc
 766 SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gendocsrc_rmic
 767 ifndef OPENJDK
 768   SRC_ZIP_SRCS += $(JDK_TOPDIR)/src/closed/share/classes
 769 endif
 770 
 771 # Need to copy launcher src files into desired directory structure
 772 # before zipping the sources.
 773 LAUNCHER_SRC_FILES := $(wildcard $(JDK_TOPDIR)/src/share/bin/*) \
 774                       $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/java_md*)
 775 LAUNCHER_ZIP_SRC := $(patsubst $(JDK_TOPDIR)/src/share/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
 776                     $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
 777                         $(LAUNCHER_SRC_FILES)))
 778 
 779 $(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/share/bin/%
 780         $(install-file)
 781 
 782 $(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%
 783         $(install-file)
 784 
 785 $(IMAGES_OUTPUTDIR)/src.zip: $(LAUNCHER_ZIP_SRC)
 786 
 787 # This dir needs to exist before macro is evaluated to avoid warning from find.
 788 $(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/src))
 789 $(eval $(call SetupZipArchive,BUILD_SRC_ZIP,\
 790                 SRC:=$(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src,\
 791                 INCLUDES:=$(SRC_ZIP_INCLUDES) launcher,\
 792                 EXCLUDES:=javax/swing/beaninfo,\
 793                 SUFFIXES:=.java .c .h,\
 794                 ZIP:=$(IMAGES_OUTPUTDIR)/src.zip,\
 795                 EXTRA_DEPS:=$(LAUNCHER_ZIP_SRC)))
 796 
 797 ##########################################################################################
 798 
 799 #
 800 # This is an empty jar (only contains manifest) and fits poorly into framework...
 801 #   create simple rule instead
 802 #
 803 $(IMAGES_OUTPUTDIR)/lib/management-agent.jar : $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
 804         $(JAR) cfm $@ $<
 805 
 806 ##########################################################################################
 807 
 808 $(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar
 809         $(install-file)
 810 
 811 ##########################################################################################
 812 
 813 ifeq ($(OPENJDK_TARGET_OS),macosx)
 814     $(eval $(call SetupArchive,BUILD_JOBJC_JAR,,\
 815                 SRCS:=$(JDK_OUTPUTDIR)/jobjc_classes,\
 816                 JAR:=$(IMAGES_OUTPUTDIR)/lib/JObjC.jar, \
 817                 JARINDEX:=true))
 818 endif
 819 
 820 ##########################################################################################
 821 
 822 ifndef OPENJDK
 823     $(eval $(call SetupArchive,BUILD_ALT_RT_JAR,,\
 824                 SRCS:=$(JDK_OUTPUTDIR)/altclasses_classes,\
 825                 JAR:=$(IMAGES_OUTPUTDIR)/lib/alt-rt.jar))
 826 
 827 endif
 828 
 829 ##########################################################################################
 830 
 831 # This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
 832 # all jars can be found in one place when creating images in Images.gmk. It needs to be
 833 # done here so that clean targets can be simple and accurate.
 834 $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar: $(JDK_OUTPUTDIR)/lib/sa-jdi.jar
 835         $(install-file)
 836 
 837 ##########################################################################################
 838 
 839 -include $(CUSTOM_MAKE_DIR)/CreateJars.gmk
 840 
 841 ##########################################################################################
 842 
 843 all: $(JARS)
 844 
 845 .PHONY: default all