1 #
   2 # Copyright (c) 2011, 2018, 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 # Prepare the find cache. Only used if running on windows.
  34 $(eval $(call FillCacheFind, $(JDK_OUTPUTDIR)/classes))
  35 
  36 include Tools.gmk
  37 
  38 include Profiles.gmk
  39 
  40 #
  41 # This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
  42 #
  43 MAKEFILE = $(JDK_TOPDIR)/make/CreateJars.gmk
  44 #
  45 # And similarly for the Profiles
  46 PROFILE_MAKEFILES = $(JDK_TOPDIR)/make/Profiles.gmk $(JDK_TOPDIR)/make/profile-rtjar-includes.txt
  47 
  48 MAINMANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf
  49 BEANMANIFEST := $(JDK_TOPDIR)/make/data/swingbeaninfo/manifest.mf
  50 
  51 $(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/lib))
  52 
  53 ##########################################################################################
  54 
  55 $(eval $(call SetupArchive,BUILD_JCONSOLE_JAR, , \
  56     SRCS := $(JDK_OUTPUTDIR)/classes, \
  57     SUFFIXES := .class .gif .png .properties, \
  58     INCLUDES := sun/tools/jconsole com/sun/tools/jconsole, \
  59     JARMAIN := sun.tools.jconsole.JConsole, \
  60     JAR := $(IMAGES_OUTPUTDIR)/lib/jconsole.jar, \
  61     SKIP_METAINF := true))
  62 
  63 
  64 ##########################################################################################
  65 
  66 $(eval $(call SetupArchive,BUILD_DNS_JAR, , \
  67     SRCS := $(JDK_OUTPUTDIR)/classes, \
  68     INCLUDES := sun/net/spi/nameservice/dns, \
  69     EXTRA_FILES := META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor, \
  70     JAR := $(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar, \
  71     SKIP_METAINF := true))
  72 
  73 
  74 ##########################################################################################
  75 
  76 LOCALEDATA_INCLUDE_LOCALES := ar be bg ca cs da de el es et fi fr ga hi hr hu in is it \
  77     iw ja ko lt lv mk ms mt nl no pl pt ro ru sk sl sq sr sv \
  78     th tr uk vi zh
  79 
  80 LOCALEDATA_INCLUDES := $(addprefix sun/text/resources/, $(LOCALEDATA_INCLUDE_LOCALES)) \
  81     $(addprefix sun/util/resources/, $(LOCALEDATA_INCLUDE_LOCALES))
  82 
  83 $(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR, , \
  84     SRCS := $(JDK_OUTPUTDIR)/classes, \
  85     SUFFIXES := .class _dict _th, \
  86     INCLUDES := $(LOCALEDATA_INCLUDES), \
  87     EXCLUDES := sun/text/resources/th/BreakIteratorRules_th.class, \
  88     JAR := $(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar, \
  89     SKIP_METAINF := true))
  90 
  91 ##########################################################################################
  92 #
  93 # Different variants of rt.jar are built based on the current profile. The output
  94 # directory is augmented with the profile name so that the final jar file and all the
  95 # intermediary list files will be in directory. This has the form lib$PROFILE rather than
  96 # lib/$PROFILE so that it won't get copied as part of the image generation process.
  97 # Each profile customizes the RT_JAR_EXCLUDES variable.
  98 #
  99 ##########################################################################################
 100 
 101 # Full JRE exclude list for rt.jar and resources.jar
 102 # This value should exclude types destined for jars other than rt.jar and resources.jar.
 103 # When building a Profile this value augments the profile specific exclusions
 104 RT_JAR_EXCLUDES += \
 105     com/sun/codemodel \
 106     com/sun/crypto/provider \
 107     com/sun/istack/internal/tools \
 108     com/sun/jarsigner \
 109     com/sun/java/accessibility \
 110     com/sun/javadoc \
 111     com/sun/jdi \
 112     com/sun/net/ssl/internal/ssl \
 113     com/sun/source \
 114     com/sun/tools \
 115     com/sun/xml/internal/dtdparser \
 116     com/sun/xml/internal/rngom \
 117     com/sun/xml/internal/xsom \
 118     javax/crypto \
 119     javax/swing/AbstractButtonBeanInfo.class \
 120     javax/swing/beaninfo \
 121     javax/swing/BoxBeanInfo.class \
 122     javax/swing/JAppletBeanInfo.class \
 123     javax/swing/JButtonBeanInfo.class \
 124     javax/swing/JCheckBoxBeanInfo.class \
 125     javax/swing/JCheckBoxMenuItemBeanInfo.class \
 126     javax/swing/JColorChooserBeanInfo.class \
 127     javax/swing/JComboBoxBeanInfo.class \
 128     javax/swing/JComponentBeanInfo.class \
 129     javax/swing/JDesktopPaneBeanInfo.class \
 130     javax/swing/JDialogBeanInfo.class \
 131     javax/swing/JEditorPaneBeanInfo.class \
 132     javax/swing/JFileChooserBeanInfo.class \
 133     javax/swing/JFormattedTextFieldBeanInfo.class \
 134     javax/swing/JFrameBeanInfo.class \
 135     javax/swing/JInternalFrameBeanInfo.class \
 136     javax/swing/JLabelBeanInfo.class \
 137     javax/swing/JLayeredPaneBeanInfo.class \
 138     javax/swing/JListBeanInfo.class \
 139     javax/swing/JMenuBarBeanInfo.class \
 140     javax/swing/JMenuBeanInfo.class \
 141     javax/swing/JMenuItemBeanInfo.class \
 142     javax/swing/JOptionPaneBeanInfo.class \
 143     javax/swing/JPanelBeanInfo.class \
 144     javax/swing/JPasswordFieldBeanInfo.class \
 145     javax/swing/JPopupMenuBeanInfo.class \
 146     javax/swing/JProgressBarBeanInfo.class \
 147     javax/swing/JRadioButtonBeanInfo.class \
 148     javax/swing/JRadioButtonMenuItemBeanInfo.class \
 149     javax/swing/JScrollBarBeanInfo.class \
 150     javax/swing/JScrollPaneBeanInfo.class \
 151     javax/swing/JSeparatorBeanInfo.class \
 152     javax/swing/JSliderBeanInfo.class \
 153     javax/swing/JSpinnerBeanInfo.class \
 154     javax/swing/JSplitPaneBeanInfo.class \
 155     javax/swing/JTabbedPaneBeanInfo.class \
 156     javax/swing/JTableBeanInfo.class \
 157     javax/swing/JTextAreaBeanInfo.class \
 158     javax/swing/JTextFieldBeanInfo.class \
 159     javax/swing/JTextPaneBeanInfo.class \
 160     javax/swing/JToggleButtonBeanInfo.class \
 161     javax/swing/JToolBarBeanInfo.class \
 162     javax/swing/JTreeBeanInfo.class \
 163     javax/swing/JWindowBeanInfo.class \
 164     javax/swing/SwingBeanInfoBase.class \
 165     javax/swing/text/JTextComponentBeanInfo.class \
 166     META-INF/services/com.sun.jdi.connect.Connector \
 167     META-INF/services/com.sun.jdi.connect.spi.TransportService \
 168     META-INF/services/com.sun.tools.attach.spi.AttachProvider \
 169     META-INF/services/com.sun.tools.xjc.Plugin \
 170     META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
 171     org/relaxng/datatype \
 172     sun/awt/HKSCS.class \
 173     sun/awt/motif/X11GB2312.class \
 174     sun/awt/motif/X11GB2312\$$$$Decoder.class \
 175     sun/awt/motif/X11GB2312\$$$$Encoder.class \
 176     sun/awt/motif/X11GBK.class \
 177     sun/awt/motif/X11GBK\$$$$Encoder.class \
 178     sun/awt/motif/X11KSC5601.class \
 179     sun/awt/motif/X11KSC5601\$$$$Decoder.class \
 180     sun/awt/motif/X11KSC5601\$$$$Encoder.class \
 181     sun/jvmstat \
 182     sun/net/spi/nameservice/dns \
 183     sun/nio/cs/ext \
 184     sun/rmi/rmic \
 185     sun/security/ec \
 186     sun/security/internal \
 187     sun/security/mscapi \
 188     sun/security/pkcs11 \
 189     sun/security/provider/Sun.class \
 190     sun/security/rsa/SunRsaSign.class \
 191     sun/security/ssl \
 192     sun/security/tools/jarsigner \
 193     sun/swing/BeanInfoUtils.class \
 194     sun/text/resources/cldr \
 195     sun/tools/asm \
 196     sun/tools/attach \
 197     sun/tools/java \
 198     sun/tools/javac \
 199     sun/tools/jcmd \
 200     sun/tools/jconsole \
 201     sun/tools/jinfo \
 202     sun/tools/jmap \
 203     sun/tools/jps \
 204     sun/tools/jstack \
 205     sun/tools/jstat \
 206     sun/tools/jstatd \
 207     sun/tools/native2ascii \
 208     sun/tools/serialver \
 209     sun/tools/tree \
 210     sun/tools/util \
 211     sun/util/cldr/CLDRLocaleDataMetaInfo.class \
 212     sun/util/resources/cldr \
 213     $(LOCALEDATA_INCLUDES) \
 214     jdk/management/jfr \
 215     jdk/jfr
 216 
 217 # Find all files in the classes dir to use as dependencies. This could be more fine granular.
 218 ALL_FILES_IN_CLASSES := $(call not-containing, _the., $(filter-out %javac_state, \
 219     $(call CacheFind, $(JDK_OUTPUTDIR)/classes)))
 220 
 221 RT_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar_manifest
 222 RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar_manifest
 223 
 224 $(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
 225         $(MKDIR) -p $(@D)
 226         $(RM) $@ $@.tmp
 227         $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
 228             -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
 229             $(MAINMANIFEST) >> $@.tmp
 230         $(ECHO) >> $@.tmp
 231         $(CAT) $(BEANMANIFEST) >> $@.tmp
 232         $(MV) $@.tmp $@
 233 
 234 $(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
 235         $(MKDIR) -p $(@D)
 236         $(RM) $@ $@.tmp
 237         $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
 238             -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
 239             $(MAINMANIFEST) >> $@.tmp
 240         $(MV) $@.tmp $@
 241 
 242 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude: $(MAKEFILE) $(PROFILE_MAKEFILES)
 243         $(MKDIR) -p $(@D)
 244         $(RM) $@ $@.tmp
 245         $(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@.tmp)
 246         $(MV) $@.tmp $@
 247 
 248 $(IMAGES_OUTPUTDIR)/lib/classlist: $(JDK_TOPDIR)/make/data/classlist/classlist.$(OPENJDK_TARGET_OS) \
 249     $(MAKEFILE)
 250         $(MKDIR) -p $(@D)
 251         $(RM) $@ $@.tmp
 252         $(TOOL_ADDJSUM) $< $@.tmp
 253         $(MV) $@.tmp $@
 254 
 255 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents: $(BUILD_TOOLS) $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude \
 256     $(ALL_FILES_IN_CLASSES) $(IMAGES_OUTPUTDIR)/lib/classlist
 257         $(MKDIR) -p $(@D)
 258         $(RM) $@ $@.tmp
 259         ($(CD) $(JDK_OUTPUTDIR)/classes && \
 260         $(TOOL_JARREORDER) \
 261             -o $@.tmp $(IMAGES_OUTPUTDIR)/lib/classlist $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude . )
 262         $(MV) $@.tmp $@
 263 
 264 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
 265         $(MKDIR) -p $(@D)
 266         $(RM) $@ $@.tmp
 267         # Cygwin grep does not match $ as end of line if there are windows line
 268         # endings in the input.
 269         $(TR) -d '\r' < $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents \
 270                | $(GREP) -e '\.class$$' > $@.tmp
 271         ifneq ($(PROFILE), )
 272           ifneq ($(strip $(RT_JAR_INCLUDE_TYPES)), )
 273            # Add back classes from excluded packages (fixing the $ substitution in the process)
 274             for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
 275               $(ECHO) $$type >> $@.tmp ; \
 276             done
 277           endif
 278         endif
 279         $(MV) $@.tmp $@
 280 
 281 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
 282         $(MKDIR) -p $(@D)
 283         $(RM) $@ $@.tmp
 284         # Cygwin grep does not match $ as end of line if there are windows line
 285         # endings in the input.
 286         $(TR) -d '\r' < $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents \
 287                 | $(GREP) -v -e '\.class$$' \
 288                       -e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' > $@.tmp
 289         ifneq ($(PROFILE), )
 290           # Strip out all META-INF/services/ entries
 291           $(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
 292           ifneq ($(strip $(PROFILE_INCLUDE_METAINF_SERVICES)), )
 293             # Add back the required services
 294             for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
 295               $(ECHO) $$service >> $@.tmp2; \
 296             done
 297           endif
 298           $(MV) $@.tmp2 $@.tmp
 299         endif
 300         $(MV) $@.tmp $@
 301 
 302 # This is a hack but I don't know how to make this fit into the existing scheme
 303 $(PROFILE_VERSION_CLASS_TARGETS): $(PROFILE_VERSION_JAVA_TARGETS)
 304         @$(JAVAC) -d $(@D)/../../ $(@D)/$(VERSION_JAVA_FILE)
 305 
 306 
 307 # Support for removing the addPropertyChangeListener and removePropertyChangeListener
 308 # methods from classes that only go into the profile builds.
 309 BEANLESS_CLASSES = $(IMAGES_OUTPUTDIR)/beanless
 310 
 311 # When there are $ characters in filenames we have some very subtle interactions between
 312 # make expansion and shell expansion. In this particular case $< will contain a single $ while
 313 # $@ will contain \$. So we have to pass $< in single-quotes to avoid shell expansion
 314 $(BEANLESS_CLASSES)/%: $(JDK_OUTPUTDIR)/classes/%
 315         $(MKDIR) -p $(@D)
 316         $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
 317 
 318 # Code these targets explicitly because the target "%" expansion does
 319 # not work with the inline "$" in the file name.
 320 $(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Packer.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Packer.class
 321         $(MKDIR) -p $(@D)
 322         $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
 323 $(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Unpacker.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Unpacker.class
 324         $(MKDIR) -p $(@D)
 325         $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
 326 
 327 CLASSES_TO_DEBEAN = \
 328     java/util/logging/LogManager.class \
 329     java/util/jar/Pack200\$$Packer.class \
 330     java/util/jar/Pack200\$$Unpacker.class \
 331     com/sun/java/util/jar/pack/PackerImpl.class \
 332     com/sun/java/util/jar/pack/UnpackerImpl.class
 333 
 334 ifneq ($(PROFILE), )
 335   BEANLESS_CLASSES_TARGETS := $(addprefix $(BEANLESS_CLASSES)/, $(CLASSES_TO_DEBEAN))
 336 endif
 337 
 338 
 339 RT_JAR_CREATE_OPTIONS := c0fm
 340 RT_JAR_UPDATE_OPTIONS := u0f
 341 ifeq ($(COMPRESS_JARS), true)
 342   RT_JAR_CREATE_OPTIONS := cfm
 343   RT_JAR_UPDATE_OPTIONS := uf
 344 endif
 345 
 346 # This defines a target-specific variables to make the shell logic easier to see.
 347 # We need to find the Version.class file for the profile currently being built
 348 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: \
 349     CLASS_FILE = $(if $(PROFILE), $(strip $(foreach class, $(PROFILE_VERSION_CLASS_TARGETS), $(if $(findstring $(PROFILE), $(class)), $(class)))), NO_SUCH_FILE)
 350 # This is the real target
 351 $(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)
 352         $(ECHO) Creating rt.jar $(PROFILE) Compressed=$(COMPRESS_JARS)
 353         $(MKDIR) -p $(@D)
 354         $(RM) $@ $@.tmp
 355         $(CD) $(JDK_OUTPUTDIR)/classes && \
 356         $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RT_JAR_MANIFEST_FILE) \
 357             @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents && \
 358         if [ -f $(CLASS_FILE) ]; then \
 359           $(ECHO) Updating rt.jar $(PROFILE) && \
 360           $(CD) $(patsubst %$(VERSION_CLASS_PATH), %, $(CLASS_FILE)) && \
 361           $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(VERSION_CLASS_PATH); \
 362           $(CD) $(BEANLESS_CLASSES) && \
 363           $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(CLASSES_TO_DEBEAN); \
 364         fi
 365         $(MV) $@.tmp $@
 366 
 367 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/resources.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents \
 368     $(RESOURCE_JAR_MANIFEST_FILE)
 369         $(ECHO) Creating resources.jar
 370         $(MKDIR) -p $(@D)
 371         $(RM) $@ $@.tmp
 372         $(CD) $(JDK_OUTPUTDIR)/classes && \
 373         $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RESOURCE_JAR_MANIFEST_FILE) \
 374             @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents
 375         $(MV) $@.tmp $@
 376 
 377 ##########################################################################################
 378 
 379 ifneq ($(OPENJDK_TARGET_OS), windows)
 380   CHARSETS_EXTRA_FILES := sun/awt/motif/X11GBK.class \
 381       sun/awt/motif/X11GB2312\$$$$Decoder.class \
 382       sun/awt/motif/X11GB2312.class \
 383       sun/awt/motif/X11KSC5601\$$$$Decoder.class \
 384       sun/awt/motif/X11KSC5601\$$$$Encoder.class \
 385       sun/awt/motif/X11GB2312\$$$$Encoder.class \
 386       sun/awt/motif/X11GBK\$$$$Encoder.class \
 387       sun/awt/motif/X11KSC5601.class
 388 endif
 389 
 390 $(eval $(call SetupArchive,BUILD_CHARSETS_JAR, , \
 391     SRCS := $(JDK_OUTPUTDIR)/classes, \
 392     SUFFIXES := .class .dat, \
 393     INCLUDES := sun/nio/cs/ext, \
 394     EXTRA_FILES := sun/awt/HKSCS.class \
 395         $(CHARSETS_EXTRA_FILES), \
 396     JAR := $(IMAGES_OUTPUTDIR)/lib/charsets.jar, \
 397     SKIP_METAINF := true, \
 398     CHECK_COMPRESS_JAR := true))
 399 
 400 ##########################################################################################
 401 
 402 ifeq ($(ENABLE_JFR), true)
 403   $(eval $(call SetupArchive,BUILD_JFR_JAR, , \
 404       SRCS := $(JDK_OUTPUTDIR)/classes $(HOTSPOT_DIST)/jre/lib, \
 405       SUFFIXES := .class .jfc .xsd .xml, \
 406       INCLUDES := jdk/management/jfr \
 407           jdk/jfr, \
 408       JAR := $(IMAGES_OUTPUTDIR)/lib/jfr.jar, \
 409       SKIP_METAINF := true, \
 410       MANIFEST := $(MAINMANIFEST), \
 411       CHECK_COMPRESS_JAR := true))
 412 
 413 endif
 414 
 415 ##########################################################################################
 416 
 417 $(eval $(call SetupArchive,BUILD_JSSE_JAR, , \
 418     SRCS := $(JDK_OUTPUTDIR)/classes, \
 419     INCLUDES := sun/security/provider/Sun.class \
 420         sun/security/rsa/SunRsaSign.class \
 421         sun/security/ssl \
 422         com/sun/net/ssl/internal/ssl, \
 423     JAR := $(IMAGES_OUTPUTDIR)/lib/jsse.jar, \
 424     SKIP_METAINF := true, \
 425     MANIFEST := $(MAINMANIFEST), \
 426     CHECK_COMPRESS_JAR := true))
 427 
 428 ##########################################################################################
 429 
 430 $(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR, , \
 431     SRCS := $(JDK_OUTPUTDIR)/classes, \
 432     SUFFIXES := BeanInfo.class .gif, \
 433     INCLUDES := javax/swing sun/swing, \
 434     EXCLUDES := javax/swing/plaf, \
 435     EXTRA_FILES := javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class, \
 436     JAR := $(IMAGES_OUTPUTDIR)/lib/dt.jar, \
 437     SKIP_METAINF := true))
 438 
 439 ##########################################################################################
 440 
 441 # Get the CLDRVERSION
 442 include gensrc/GensrcCLDR.gmk
 443 
 444 CLDRDATA_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/cldrdata.jar
 445 
 446 $(eval $(call SetupArchive,BUILD_CLDRDATA_JAR, , \
 447     SRCS := $(JDK_OUTPUTDIR)/classes, \
 448     SUFFIXES := .class, \
 449     INCLUDES := sun/text/resources/cldr \
 450         sun/util/cldr \
 451         sun/util/resources/cldr, \
 452     EXCLUDES := sun/util/cldr/CLDRLocaleProviderAdapter, \
 453     JAR := $(CLDRDATA_JAR_DST), \
 454     EXTRA_MANIFEST_ATTR := CLDR-Version: $(CLDRVERSION), \
 455     SKIP_METAINF := true))
 456 
 457 ##########################################################################################
 458 
 459 TOOLS_JAR_INCLUDES := \
 460     com/sun/codemodel \
 461     com/sun/istack/internal/tools \
 462     com/sun/jarsigner \
 463     com/sun/javadoc \
 464     com/sun/jdi \
 465     com/sun/source \
 466     com/sun/tools/attach \
 467     com/sun/tools/classfile \
 468     com/sun/tools/corba \
 469     com/sun/tools/doclets \
 470     com/sun/tools/doclint \
 471     com/sun/tools/example/debug/expr \
 472     com/sun/tools/example/debug/tty \
 473     com/sun/tools/extcheck \
 474     com/sun/tools/hat \
 475     com/sun/tools/internal/jxc \
 476     com/sun/tools/internal/jxc/ap \
 477     com/sun/tools/internal/ws \
 478     com/sun/tools/internal/ws/wscompile/plugin/at_generated \
 479     com/sun/tools/internal/xjc \
 480     com/sun/tools/javac \
 481     com/sun/tools/javadoc \
 482     com/sun/tools/javah \
 483     com/sun/tools/javap \
 484     com/sun/tools/jdeps \
 485     com/sun/tools/jdi \
 486     com/sun/tools/script/shell \
 487     com/sun/xml/internal/dtdparser \
 488     com/sun/xml/internal/rngom \
 489     com/sun/xml/internal/xsom \
 490     org/relaxng/datatype \
 491     sun/applet \
 492     sun/jvmstat \
 493     sun/rmi/rmic \
 494     sun/security/tools/jarsigner \
 495     sun/tools/asm \
 496     sun/tools/attach \
 497     sun/tools/jar \
 498     sun/tools/java \
 499     sun/tools/javac \
 500     sun/tools/jcmd \
 501     sun/tools/jinfo \
 502     sun/tools/jmap \
 503     sun/tools/jps \
 504     sun/tools/jstack \
 505     sun/tools/jstat \
 506     sun/tools/jstatd \
 507     sun/tools/native2ascii \
 508     sun/tools/serialver \
 509     sun/tools/tree \
 510     sun/tools/util
 511 
 512 # The sjavac tools is not ready for public consumption.
 513 TOOLS_JAR_EXCLUDES = com/sun/tools/sjavac
 514 
 515 $(eval $(call SetupArchive,BUILD_TOOLS_JAR, , \
 516     SRCS := $(JDK_OUTPUTDIR)/classes, \
 517     SUFFIXES := .class .prp .gif .properties .xml .css .xsd .js .html .txt .java \
 518         Tool aliasmap options, \
 519     INCLUDES := $(TOOLS_JAR_INCLUDES), \
 520     EXCLUDES := $(TOOLS_JAR_EXCLUDES), \
 521     EXTRA_FILES := META-INF/services/com.sun.jdi.connect.Connector \
 522         META-INF/services/com.sun.jdi.connect.spi.TransportService \
 523         META-INF/services/com.sun.tools.attach.spi.AttachProvider \
 524         META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
 525         META-INF/services/com.sun.tools.internal.xjc.Plugin, \
 526     JAR := $(IMAGES_OUTPUTDIR)/lib/tools.jar, \
 527     SKIP_METAINF := true, \
 528     CHECK_COMPRESS_JAR := true))
 529 
 530 
 531 ##########################################################################################
 532 
 533 include CORE_PKGS.gmk
 534 include NON_CORE_PKGS.gmk
 535 
 536 # The compiler should not issue a "Proprietary" warning when compiling
 537 # classes in the com.sun.java.swing.plaf packages, since we've always
 538 # allowed, and even advocated, extending them (see bug 6476749).
 539 #
 540 # This approach is NOT to be used as a general purpose way to avoid such
 541 # compiler warnings for non-core packages. The correct way is to document
 542 # the packages in NON_CORE_PKGS.gmk, and include them in the NON_CORE_PKGS
 543 # definition.
 544 #
 545 # Swing has taken this approach only as a temporary measure to avoid
 546 # the compiler warnings until we can properly document these packages.
 547 # This is covered under 6491853.
 548 EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows \
 549     com.sun.java.swing.plaf.motif \
 550     com.sun.java.swing.plaf.gtk
 551 
 552 #
 553 # Include the exported private packages in ct.sym.
 554 # This is an interim solution until the ct.sym is replaced
 555 # with a new module system (being discussed for JDK 8).
 556 #
 557 EXPORTED_PRIVATE_PKGS = com.oracle.net \
 558     com.oracle.nio
 559 
 560 $(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
 561         $(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
 562         $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
 563         $(JAVA) $(NEW_JAVAC) \
 564             -bootclasspath $(JDK_OUTPUTDIR)/classes \
 565             -XDprocess.packages -proc:only \
 566             -processor com.sun.tools.javac.sym.CreateSymbols \
 567             -Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \
 568             -Acom.sun.tools.javac.sym.Dest=$(IMAGES_OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
 569             -Acom.sun.tools.javac.sym.Profiles=profile-rtjar-includes.txt \
 570             $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
 571         $(TOUCH) $@
 572 
 573 $(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/symbols))
 574 $(eval $(call SetupArchive,BUILD_CT_SYM, $(IMAGES_OUTPUTDIR)/symbols/_the.symbols, \
 575     SRCS := $(IMAGES_OUTPUTDIR)/symbols, \
 576     INCLUDES := META-INF/sym, \
 577     JAR := $(IMAGES_OUTPUTDIR)/lib/ct.sym, \
 578     CHECK_COMPRESS_JAR := true))
 579 
 580 
 581 ##########################################################################################
 582 
 583 ifdef OPENJDK
 584     SRC_ZIP_INCLUDES = \
 585         com \
 586         java \
 587         javax \
 588         jdk \
 589         org \
 590         sun \
 591         #
 592     SRC_ZIP_EXCLUDES =
 593 else
 594     SRC_ZIP_INCLUDES = \
 595         com/sun/corba \
 596         com/sun/image/codec/jpeg \
 597         com/sun/imageio \
 598         com/sun/java_cup \
 599         com/sun/javadoc \
 600         com/sun/java/swing \
 601         com/sun/jmx \
 602         com/sun/naming \
 603         com/sun/org/apache \
 604         com/sun/security/auth \
 605         com/sun/security/jgss \
 606         com/sun/source \
 607         java \
 608         javax/accessibility \
 609         javax/annotation \
 610         javax/imageio \
 611         javax/lang \
 612         javax/management \
 613         javax/naming \
 614         javax/print \
 615         javax/rmi \
 616         javax/script \
 617         javax/security \
 618         javax/sound \
 619         javax/sql \
 620         javax/swing \
 621         javax/tools \
 622         javax/xml \
 623         org/ietf \
 624         org/omg \
 625         org/w3c/dom \
 626         org/xml/sax \
 627         #
 628     SRC_ZIP_EXCLUDES = javax/swing/beaninfo
 629 endif
 630 
 631 SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes
 632 SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
 633 SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/impsrc
 634 SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gendocsrc_rmic
 635 ifndef OPENJDK
 636   SRC_ZIP_SRCS += $(JDK_TOPDIR)/src/closed/share/classes
 637 endif
 638 
 639 # Need to copy launcher src files into desired directory structure
 640 # before zipping the sources.
 641 LAUNCHER_SRC_FILES := $(wildcard $(JDK_TOPDIR)/src/share/bin/*) \
 642     $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/java_md*)
 643 LAUNCHER_ZIP_SRC := $(patsubst $(JDK_TOPDIR)/src/share/bin/%, $(IMAGES_OUTPUTDIR)/src/launcher/%, \
 644     $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%, $(IMAGES_OUTPUTDIR)/src/launcher/%, \
 645     $(LAUNCHER_SRC_FILES)))
 646 
 647 $(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/share/bin/%
 648         $(install-file)
 649 
 650 $(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%
 651         $(install-file)
 652 
 653 $(IMAGES_OUTPUTDIR)/src.zip: $(LAUNCHER_ZIP_SRC)
 654 
 655 # This dir needs to exist before macro is evaluated to avoid warning from find.
 656 $(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/src))
 657 $(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \
 658     SRC := $(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src, \
 659     INCLUDES := $(SRC_ZIP_INCLUDES) launcher, \
 660     EXCLUDES := $(SRC_ZIP_EXCLUDES), \
 661     SUFFIXES := .java .c .h, \
 662     ZIP := $(IMAGES_OUTPUTDIR)/src.zip, \
 663     EXTRA_DEPS := $(LAUNCHER_ZIP_SRC)))
 664 
 665 ##########################################################################################
 666 
 667 ifeq ($(OPENJDK_TARGET_OS), windows)
 668   ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
 669       $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_32_JAR, , \
 670           SRCS := $(JDK_OUTPUTDIR)/classes_ab/32bit, \
 671           INCLUDES := com/sun/java/accessibility, \
 672           JAR := $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar, \
 673           SKIP_METAINF := true))
 674 
 675       $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_LEGACY_JAR, , \
 676           SRCS := $(JDK_OUTPUTDIR)/classes_ab/legacy, \
 677           INCLUDES := com/sun/java/accessibility, \
 678           JAR := $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar, \
 679           SKIP_METAINF := true))
 680 
 681       JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar \
 682           $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar
 683   else
 684       $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_64_JAR, , \
 685           SRCS := $(JDK_OUTPUTDIR)/classes_ab/64bit, \
 686           INCLUDES := com/sun/java/accessibility, \
 687           JAR := $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar, \
 688           SKIP_METAINF := true))
 689 
 690       JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
 691   endif
 692 endif
 693 
 694 $(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
 695     SRCS := $(JDK_OUTPUTDIR)/classes, \
 696     INCLUDES := com/sun/java/accessibility/util, \
 697     JAR := $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar, \
 698     SKIP_METAINF := true))
 699 
 700 JARS += $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar
 701 
 702 ##########################################################################################
 703 
 704 #
 705 # This is an empty jar (only contains manifest) and fits poorly into framework...
 706 # create simple rule instead
 707 #
 708 $(IMAGES_OUTPUTDIR)/lib/management-agent.jar: $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
 709         $(JAR) cfm $@ $<
 710 
 711 ##########################################################################################
 712 
 713 $(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar: $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar
 714         $(install-file)
 715 
 716 ##########################################################################################
 717 
 718 # This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
 719 # all jars can be found in one place when creating images in Images.gmk. It needs to be
 720 # done here so that clean targets can be simple and accurate.
 721 $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar: $(JDK_OUTPUTDIR)/lib/sa-jdi.jar
 722         $(install-file)
 723 
 724 ##########################################################################################
 725 #
 726 # sec-bin.zip is used by builds where the corresponding sources are not available
 727 #
 728 $(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
 729     SRC := $(JDK_OUTPUTDIR), \
 730     INCLUDES := classes/javax/net \
 731         classes/javax/security/cert \
 732         classes/com/sun/net/ssl \
 733         classes/com/sun/security/cert \
 734         classes/sun/net/www/protocol/https \
 735         classes/sun/security/pkcs12 \
 736         classes/sun/security/ssl \
 737         classes/sun/security/krb5 \
 738         classes/sun/security/krb5/internal \
 739         classes/sun/security/krb5/internal/ccache \
 740         classes/sun/security/krb5/internal/crypto \
 741         classes/sun/security/krb5/internal/ktab \
 742         classes/sun/security/krb5/internal/rcache \
 743         classes/sun/security/krb5/internal/util, \
 744     INCLUDE_FILES := classes/sun/security/jgss/spi/GSSContextSpi.class, \
 745     EXCLUDES := classes/sun/security/krb5/internal/tools, \
 746     ZIP := $(IMAGES_OUTPUTDIR)/sec-bin.zip))
 747 
 748 JARS += $(IMAGES_OUTPUTDIR)/sec-bin.zip
 749 
 750 ##########################################################################################
 751 #
 752 # Windows specific binary security packages.
 753 #
 754 ifeq ($(OPENJDK_TARGET_OS), windows)
 755   # sec-windows-bin.zip is used by builds where the corresponding sources are not available
 756   $(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP, \
 757       SRC := $(JDK_OUTPUTDIR), \
 758       INCLUDES := classes/sun/security/krb5/internal/tools, \
 759       ZIP := $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip))
 760 
 761   JARS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip
 762 
 763   # JGSS files contain the native Kerberos library
 764   ifeq ($(OPENJDK_TARGET_CPU), x86_64)
 765     JGSS_ZIP_NAME = jgss-windows-x64-bin.zip
 766   else
 767     JGSS_ZIP_NAME = jgss-windows-i586-bin.zip
 768   endif
 769 
 770   $(eval $(call SetupZipArchive,BUILD_JGSS_BIN_ZIP, \
 771       SRC := $(JDK_OUTPUTDIR), \
 772       INCLUDE_FILES := bin/w2k_lsa_auth.dll \
 773           bin/w2k_lsa_auth.map \
 774           bin/w2k_lsa_auth.pdb, \
 775       ZIP := $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)))
 776 
 777   JARS += $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)
 778 endif
 779 
 780 ##########################################################################################
 781 
 782 # This rule copies all jars from jdk/lib/... to images/lib/... to avoid having to track 
 783 # which jars are where
 784 $(IMAGES_OUTPUTDIR)/lib/%: $(JDK_OUTPUTDIR)/lib/%
 785         $(install-file)
 786 
 787 ##########################################################################################
 788 
 789 # Import nashorn.jar from nashorn dist dir.
 790 $(IMAGES_OUTPUTDIR)/lib/ext/nashorn.jar: $(NASHORN_DIST)/nashorn.jar
 791         $(install-file)
 792 
 793 ##########################################################################################
 794 
 795 -include $(CUSTOM_MAKE_DIR)/CreateJars.gmk
 796 
 797 ##########################################################################################
 798 
 799 all: $(JARS)
 800 
 801 .PHONY: default all