1 #
   2 # Copyright (c) 1997, 2007, 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 $(JDK_TOPDIR)/make/docs/CORE_PKGS.gmk
  27 include $(JDK_TOPDIR)/make/docs/NON_CORE_PKGS.gmk
  28 
  29 #
  30 # Perform release engineering tasks.
  31 #
  32 # images    An image is what the product looks like when it is
  33 #           installed.
  34 #
  35 
  36 IMAGE_BINDIR = bin
  37 
  38 # The compiler should not issue a "Sun Propietary" warning when compiling
  39 # classes in the com.sun.java.swing.plaf packages, since we've always
  40 # allowed, and even advocated, extending them (see bug 6476749).
  41 #
  42 # This approach is NOT to be used as a general purpose way to avoid such
  43 # compiler warnings for non-core packages. The correct way is to document
  44 # the packages in NON_CORE_PKGS.gmk, and include them in the NON_CORE_PKGS
  45 # definition.
  46 #
  47 # Swing has taken this approach only as a temporary measure to avoid
  48 # the compiler warnings until we can properly document these packages.
  49 # This is covered under 6491853.
  50 EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf          \
  51                         com.sun.java.swing.plaf.windows  \
  52                         com.sun.java.swing.plaf.motif    \
  53                         com.sun.java.swing.plaf.gtk      \
  54                         com.sun.java.swing.plaf.nimbus
  55 
  56 # 64-bit solaris has a few special cases. We define the variable
  57 # SOLARIS64 for use in this Makefile to easily test those cases
  58 ifeq ($(PLATFORM), solaris)
  59   ifeq ($(ARCH_DATA_MODEL), 64)
  60     SOLARIS64 = true
  61     IMAGE_BINDIR = bin/$(ARCH)
  62   endif
  63 endif
  64 
  65 JTG_DOCS            = $(JDK_TOPDIR)/src/solaris/doc
  66 
  67 #We use this for man page header
  68 jdkversion := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
  69 
  70 # Text documents on windows use this suffix
  71 ifeq ($(PLATFORM), windows)
  72   TEXT_SUFFIX = .txt
  73 endif
  74 
  75 # The base names of all the license and document files for the jdk and jre
  76 ifdef OPENJDK
  77   # Where to find these files
  78   SHARE_JDK_DOC_SRC = $(JDK_TOPDIR)
  79   SHARE_JRE_DOC_SRC = $(JDK_TOPDIR)
  80   # Same files for jdk and jre, no name changes
  81   LICENSE_DOCLIST_JDK = LICENSE     ASSEMBLY_EXCEPTION
  82   LICENSE_DOCLIST_JRE = LICENSE     ASSEMBLY_EXCEPTION
  83   OTHER_DOCLIST_JDK   = THIRD_PARTY_README
  84   OTHER_DOCLIST_JRE   = THIRD_PARTY_README
  85 else
  86   # Where to find these files
  87   SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdk
  88   SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jre
  89   # Select the pre-release or FCS license version based on the build milestone.
  90   LICENSE_VERSION=.pre
  91   ifeq ($(MILESTONE), fcs)
  92     LICENSE_VERSION=.fcs
  93   endif
  94   ifeq ($(PLATFORM), windows)
  95     LICENSE_DOCLIST_JDK = $(subst $(LICENSE_VERSION),,\
  96                    $(shell $(CD) $(SHARE_JDK_DOC_SRC) && \
  97                            $(LS) *LICENSE*$(LICENSE_VERSION)))
  98     LICENSE_DOCLIST_JRE = $(subst $(LICENSE_VERSION),,\
  99                    $(shell $(CD) $(SHARE_JRE_DOC_SRC) && \
 100                            $(LS) *LICENSE*$(LICENSE_VERSION)))
 101   else
 102     LICENSE_DOCLIST_JDK = $(subst $(LICENSE_VERSION),,\
 103                  $(shell $(CD) $(SHARE_JDK_DOC_SRC) && \
 104                          $(LS) *LICENSE*$(LICENSE_VERSION) | $(GREP) -v rtf))
 105     LICENSE_DOCLIST_JRE = $(subst $(LICENSE_VERSION),,\
 106                  $(shell $(CD) $(SHARE_JRE_DOC_SRC) && \
 107                          $(LS) *LICENSE*$(LICENSE_VERSION) | $(GREP) -v rtf))
 108   endif
 109   OTHER_DOCLIST_JDK = COPYRIGHT README.html README_ja.html README_zh_CN.html
 110   OTHER_DOCLIST_JRE = COPYRIGHT Welcome.html
 111   JRE_NAMECHANGE_DOCLIST = README
 112 endif
 113 
 114 # Paths to these files we need
 115 JDK_LICENSES   = $(LICENSE_DOCLIST_JDK:%=$(JDK_IMAGE_DIR)/%)
 116 JDK64_LICENSES = $(LICENSE_DOCLIST_JDK:%=$(JDK_IMAGE_DIR)/%64)
 117 JDK_DOCFILES   = $(OTHER_DOCLIST_JDK:%=$(JDK_IMAGE_DIR)/%)
 118 
 119 JRE_LICENSES   = $(LICENSE_DOCLIST_JRE:%=$(JRE_IMAGE_DIR)/%)
 120 JRE64_LICENSES = $(LICENSE_DOCLIST_JRE:%=$(JRE_IMAGE_DIR)/%64)
 121 JRE_DOCFILES   = $(OTHER_DOCLIST_JRE:%=$(JRE_IMAGE_DIR)/%)
 122 JRE_DOCFILES  += $(JRE_NAMECHANGE_DOCLIST:%=$(JRE_IMAGE_DIR)/%$(TEXT_SUFFIX))
 123 
 124 # absolute directory names: note, these must exist prior to build
 125 # time - they are created in the main Makefile.
 126 JRE_IMAGE_BINDIR   = $(JRE_IMAGE_DIR)/bin
 127 JRE_IMAGE_THREADIR = $(JRE_IMAGE_DIR)/bin/*/native_threads
 128 
 129 MAINMANIFEST  = $(JDK_TOPDIR)/make/tools/manifest.mf
 130 BEANMANIFEST  = $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest
 131 
 132 #
 133 # Man pages
 134 #
 135 
 136 JRE_MAN_PAGES =         \
 137         java.1          \
 138         keytool.1       \
 139         orbd.1          \
 140         pack200.1       \
 141         policytool.1    \
 142         rmid.1          \
 143         rmiregistry.1   \
 144         servertool.1    \
 145         tnameserv.1     \
 146         unpack200.1
 147 
 148 ifeq ($(ARCH_DATA_MODEL),32)
 149   JRE_MAN_PAGES += javaws.1
 150 endif
 151 
 152 JDK_MAN_PAGES =            \
 153         $(JRE_MAN_PAGES)   \
 154         appletviewer.1     \
 155         apt.1              \
 156         extcheck.1         \
 157         idlj.1             \
 158         jar.1              \
 159         jarsigner.1        \
 160         javac.1            \
 161         javadoc.1          \
 162         javah.1            \
 163         javap.1            \
 164         jconsole.1         \
 165         jdb.1              \
 166         jhat.1             \
 167         jinfo.1            \
 168         jmap.1             \
 169         jps.1              \
 170         jrunscript.1       \
 171         jsadebugd.1        \
 172         jstack.1           \
 173         jstat.1            \
 174         jstatd.1           \
 175         native2ascii.1     \
 176         rmic.1             \
 177         schemagen.1        \
 178         serialver.1        \
 179         wsgen.1            \
 180         wsimport.1         \
 181         xjc.1
 182 
 183 ifeq ($(PLATFORM), solaris)
 184   MANBASEDIRS=$(JDK_TOPDIR)/src/solaris/doc $(IMPORTDOCDIR)
 185   MAN1SUBDIR=sun/man/man1
 186 endif # solaris
 187 
 188 ifeq ($(PLATFORM), linux)
 189   MANBASEDIRS=$(JDK_TOPDIR)/src/linux/doc $(IMPORTDOCDIR)
 190   MAN1SUBDIR=man
 191   JA_DIRNAME=ja_JP.$(JA_SOURCE_ENCODING)
 192 endif # linux
 193 
 194 define copy-man-pages
 195 $(MKDIR) -p $1/man/man1
 196 for manbase in $(MANBASEDIRS:%=%/$(MAN1SUBDIR)) ; do \
 197   for manpage in $2; do \
 198     if [ -f $${manbase}/$${manpage} ] ; then \
 199       $(CP) $${manbase}/$${manpage} $1/man/man1 ; \
 200       for ja_encoding in $(JA_TARGET_ENCODINGS); do \
 201         ja_dir="ja"; \
 202         if [ "$${ja_encoding}" != "$(JA_SOURCE_ENCODING)" ]; then \
 203           ja_dir="ja_JP.$${ja_encoding}"; \
 204         fi; \
 205         $(MKDIR) -p $1/man/$${ja_dir}/man1; \
 206         $(CAT) $${manbase}/ja/$${manpage} \
 207           | $(NATIVE2ASCII) -encoding $(JA_SOURCE_ENCODING) \
 208           | $(SED) 's/@@VERSION@@/$(jdkversion)/g' \
 209           | $(NATIVE2ASCII) -reverse -encoding $${ja_encoding} \
 210             > $1/man/$${ja_dir}/man1/$${manpage}; \
 211       done; \
 212     fi; \
 213   done; \
 214 done
 215 $(java-vm-cleanup)
 216 if [ "$(JA_DIRNAME)" != "" ] ; then \
 217   $(MV) $1/man/ja $1/man/$(JA_DIRNAME); \
 218   $(CD) $1/man && $(LN) -s $(JA_DIRNAME) ja; \
 219 fi
 220 endef
 221 
 222 #
 223 # Targets.
 224 #
 225 INITIAL_IMAGE_JRE=initial-image-jre
 226 INITIAL_IMAGE_JDK=initial-image-jdk
 227 ifeq ($(PLATFORM), solaris)
 228   ifeq ($(ARCH_DATA_MODEL), 64)
 229     INITIAL_IMAGE_JRE=initial-image-jre-sol64
 230     INITIAL_IMAGE_JDK=initial-image-jdk-sol64
 231   endif
 232 endif
 233 
 234 images images-clobber \
 235 initial-image-jre initial-image-jdk \
 236 initial-image-jre-sol64 initial-image-jdk-sol64 \
 237 trim-image-jre trim-image-jdk \
 238 process-image-jre process-image-jdk \
 239 compare-image \
 240 sec-files sec-files-win jgss-files ::
 241         @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
 242 
 243 #
 244 # Export binary plugs if not building OPENJDK
 245 #
 246 ifdef OPENJDK
 247   EXPORT_BINARY_PLUGS =
 248 else # !OPENJDK
 249   EXPORT_BINARY_PLUGS = export-binary-plugs test-binary-plugs
 250 endif # OPENJDK
 251 
 252 # Order is important here, trim jre after jdk image is created
 253 images:: sanity-images post-sanity-images  \
 254          $(EXPORT_BINARY_PLUGS) \
 255          $(INITIAL_IMAGE_JRE) $(INITIAL_IMAGE_JDK) \
 256          trim-image-jre trim-image-jdk \
 257          process-image-jre process-image-jdk sec-files sec-files-win jgss-files
 258 
 259 # Don't use these
 260 image-jre:: initial-image-jre trim-image-jre process-image-jre
 261 image-jdk:: initial-image-jdk trim-image-jdk process-image-jdk
 262 
 263 #
 264 # Sources we ship in the SDK.
 265 #
 266 SOURCES = \
 267         java/applet                     \
 268         java/awt                        \
 269         java/beans                      \
 270         java/io                         \
 271         java/lang                       \
 272         java/math                       \
 273         java/net                        \
 274         java/nio                        \
 275         java/rmi                        \
 276         java/security                   \
 277         java/sql                        \
 278         java/text                       \
 279         java/util                       \
 280         com/sun/corba                   \
 281         com/sun/image/codec/jpeg        \
 282         com/sun/imageio                 \
 283         com/sun/java/swing              \
 284         com/sun/javadoc                 \
 285         com/sun/jmx                     \
 286         com/sun/mirror                  \
 287         com/sun/source                  \
 288         com/sun/naming                  \
 289         com/sun/security/auth           \
 290         com/sun/security/jgss           \
 291         javax/accessibility             \
 292         javax/annotation                \
 293         javax/script                    \
 294         javax/imageio                   \
 295         javax/lang                      \
 296         javax/management                \
 297         javax/naming                    \
 298         javax/print                     \
 299         javax/rmi                       \
 300         javax/security                  \
 301         javax/sound                     \
 302         javax/sql                       \
 303         javax/swing                     \
 304         javax/tools                     \
 305         javax/xml                       \
 306         com/sun/org/apache              \
 307         com/sun/java_cup                \
 308         com/sun/jlex                    \
 309         org/ietf                        \
 310         org/omg                         \
 311         org/w3c/dom                     \
 312         org/xml/sax                     \
 313         sunw
 314 #
 315 # Directories where sources may be found.  If a file with the same path
 316 # name exists in more than one of these places, the one found last on this
 317 # list wins.
 318 #
 319 SOURCE_DIRS = $(SHARE_SRC)/classes $(PLATFORM_SRC)/classes
 320 SOURCE_DIRS += $(GENSRCDIR)
 321 SOURCE_DIRS += $(IMPORTSRCDIR)
 322 ifndef OPENJDK
 323   SOURCE_DIRS += $(CLOSED_SRC)/share/classes
 324 endif
 325 
 326 
 327 #
 328 # Specific files and directories that will be filtered out from above areas.
 329 #
 330 SOURCE_FILTERs = $(SCM_DIRs) 'X-*' '*-X-*' '*-template.java' ',*'
 331 SOURCE_FILES_filter = $(SOURCE_FILTERs:%=-name % -prune -o)
 332 
 333 #
 334 # Bug 4249883 - excluding some unnecessary packages from com.sun.tools
 335 #
 336 # Bug 5008685 - exclude jconsole from sun/tools
 337 #
 338 TOOLS = \
 339         META-INF/services/com.sun.jdi.connect.Connector \
 340         META-INF/services/com.sun.jdi.connect.spi.TransportService \
 341         sun/tools/asm           \
 342         sun/tools/jar           \
 343         sun/tools/java          \
 344         sun/tools/javac         \
 345         sun/tools/javap         \
 346         sun/tools/jps           \
 347         sun/tools/jstat         \
 348         sun/tools/jstatd        \
 349         sun/tools/native2ascii  \
 350         sun/tools/serialver     \
 351         sun/tools/tree          \
 352         sun/tools/util          \
 353         sun/security/tools/JarBASE64Encoder.class \
 354         sun/security/tools/JarSigner.class \
 355         sun/security/tools/JarSignerParameters.class \
 356         sun/security/tools/JarSignerResources.class \
 357         sun/security/tools/JarSignerResources_ja.class \
 358         sun/security/tools/JarSignerResources_zh_CN.class \
 359         sun/security/tools/SignatureFile\$$Block.class \
 360         sun/security/tools/SignatureFile.class \
 361         sun/security/tools/TimestampedSigner.class \
 362         sun/rmi/rmic            \
 363         sun/applet              \
 364         sun/jvmstat             \
 365         com/sun/javadoc         \
 366         com/sun/jdi             \
 367         com/sun/jarsigner       \
 368         com/sun/mirror          \
 369         com/sun/source          \
 370         com/sun/tools/doclets   \
 371         com/sun/tools/example/debug/expr \
 372         com/sun/tools/example/debug/tty  \
 373         com/sun/tools/extcheck  \
 374         com/sun/tools/hat       \
 375         com/sun/tools/javac     \
 376         com/sun/tools/javadoc   \
 377         com/sun/tools/apt       \
 378         com/sun/tools/javah     \
 379         com/sun/tools/corba     \
 380         com/sun/tools/internal/xjc       \
 381         com/sun/tools/internal/ws       \
 382         META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \
 383         META-INF/services/com.sun.tools.internal.xjc.Plugin \
 384         com/sun/istack/internal/tools       \
 385         com/sun/istack/internal/ws       \
 386         com/sun/codemodel       \
 387         com/sun/tools/internal/jxc             \
 388         com/sun/xml/internal/rngom       \
 389         com/sun/xml/internal/xsom       \
 390         org/relaxng/datatype   \
 391         com/sun/xml/internal/dtdparser \
 392         com/sun/tools/jdi       \
 393         com/sun/tools/script/shell      \
 394         META-INF/services/com.sun.tools.attach.spi.AttachProvider \
 395         com/sun/tools/attach    \
 396         sun/tools/attach        \
 397         sun/tools/jstack        \
 398         sun/tools/jinfo         \
 399         sun/tools/jmap
 400         
 401 # classes that go into jsse.jar
 402 JSSE_CLASSES_DIRS = \
 403         sun/security/provider/Sun.class \
 404         sun/security/rsa/SunRsaSign.class \
 405         sun/security/ssl \
 406         com/sun/net/ssl/internal/ssl
 407 
 408 # files under $(OUTPUTDIR) that need to go into sec-bin.zip for builds
 409 # where the corresponding sources are not available
 410 SEC_FILES_DIRS = \
 411         classes/javax/net \
 412         classes/javax/security/cert \
 413         classes/com/sun/net/ssl \
 414         classes/com/sun/security/cert \
 415         classes/sun/net/www/protocol/https \
 416         classes/sun/security/pkcs12 \
 417         classes/sun/security/ssl \
 418         classes/sun/security/krb5/*.class \
 419         classes/sun/security/krb5/internal/*.class \
 420         classes/sun/security/krb5/internal/ccache \
 421         classes/sun/security/krb5/internal/crypto \
 422         classes/sun/security/krb5/internal/ktab \
 423         classes/sun/security/krb5/internal/rcache \
 424         classes/sun/security/krb5/internal/util \
 425         classes/sun/security/jgss/spi/GSSContextSpi.class
 426 
 427 # files under $(OUTPUTDIR) that need to go into sec-windows-win.zip for builds
 428 # where the corresponding sources are not available
 429 SEC_FILES_WIN_DIRS = \
 430         classes/sun/security/krb5/internal/tools
 431 
 432 # files under $(BINDIR) that need to go into jgss_files.zip for builds
 433 # where the corresponding sources are not available
 434 JGSS_FILES_DIRS = \
 435         bin/w2k_lsa_auth.dll \
 436         bin/w2k_lsa_auth.map \
 437         bin/w2k_lsa_auth.pdb
 438 
 439 # The following get removed from the SDK image.
 440 NOTJDKTOOLS = \
 441         java_vm
 442 
 443 # The following get removed from the JRE after the bulk-copy of BINDIR...
 444 NOTJRETOOLS = \
 445         appletviewer$(EXE_SUFFIX) \
 446         extcheck$(EXE_SUFFIX) \
 447         idlj$(EXE_SUFFIX) \
 448         jar$(EXE_SUFFIX) \
 449         jarsigner$(EXE_SUFFIX) \
 450         java-rmi.cgi \
 451         javac$(EXE_SUFFIX) \
 452         javadoc$(EXE_SUFFIX) \
 453         apt$(EXE_SUFFIX) \
 454         javah$(EXE_SUFFIX) \
 455         javap$(EXE_SUFFIX) \
 456         jdb$(EXE_SUFFIX) \
 457         jps$(EXE_SUFFIX) \
 458         jrunscript$(EXE_SUFFIX) \
 459         jstat$(EXE_SUFFIX) \
 460         jstatd$(EXE_SUFFIX) \
 461         jstack$(EXE_SUFFIX) \
 462         packagebean$(SCRIPT_SUFFIX) \
 463         rmic$(EXE_SUFFIX) \
 464         serialver$(EXE_SUFFIX) \
 465         unregbean$(EXE_SUFFIX) \
 466         jconsole$(EXE_SUFFIX) \
 467         jinfo$(EXE_SUFFIX) \
 468         jmap$(EXE_SUFFIX) \
 469         native2ascii$(EXE_SUFFIX) \
 470         xjc$(EXE_SUFFIX) \
 471         wsgen$(EXE_SUFFIX) \
 472         wsimport$(EXE_SUFFIX) \
 473         schemagen$(EXE_SUFFIX) \
 474         jsadebugd$(EXE_SUFFIX) \
 475         jhat$(EXE_SUFFIX)
 476 
 477 # The following get removed from the JRE after the bulk-copy of LIBDIR...
 478 NOTJRELIBS = tools.jar \
 479         jconsole.jar
 480 
 481 ifeq ($(INCLUDE_SA), true)
 482   NOTJRELIBS += sa-jdi.jar
 483 
 484   # The following get removed from the JRE after the bulk-copy of LIBDIR...
 485   NOTJRE_SHARED_LIBS = $(SALIB_NAME)
 486 else
 487   NOTJRE_SHARED_LIBS =
 488 endif
 489 
 490 # Attach library is JDK only
 491 NOTJRE_SHARED_LIBS += $(LIB_PREFIX)attach.$(LIBRARY_SUFFIX)
 492 
 493 #
 494 ###### RULES
 495 
 496 # Processing license files from source area to image area
 497 #    These will be modified to have the platform specific EOL chars.
 498 define process-doc-file
 499 $(prep-target)
 500 $(SED) 's/$$//g' $< > $@
 501 $(CHMOD) 444 $@
 502 endef
 503 
 504 # JDK files
 505 $(JDK_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%
 506         $(process-doc-file)
 507 # Removes LICENSE_VERSION or not
 508 ifdef LICENSE_VERSION
 509 $(JDK_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION)
 510         $(process-doc-file)
 511 $(JDK_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION)
 512         $(process-doc-file)
 513 else
 514 $(JDK_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/%
 515         $(process-doc-file)
 516 endif
 517 
 518 # JRE files 
 519 $(JRE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%
 520         $(process-doc-file)
 521 # Add $(TEXT_SUFFIX) suffix
 522 ifdef TEXT_SUFFIX
 523 $(JRE_IMAGE_DIR)/%$(TEXT_SUFFIX): $(SHARE_JRE_DOC_SRC)/%
 524         $(process-doc-file)
 525 endif
 526 # Removes LICENSE_VERSION or not
 527 ifdef LICENSE_VERSION
 528 $(JRE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION)
 529         $(process-doc-file)
 530 $(JRE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION)
 531         $(process-doc-file)
 532 else
 533 $(JRE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/%
 534         $(process-doc-file)
 535 endif
 536 
 537 # Differences tool
 538 DIRDIFF_JARFILE = $(BUILDTOOLJARDIR)/dirdiff.jar
 539 
 540 ######################################################
 541 # List of directories in classes directory that should NOT be in rt.jar
 542 ######################################################
 543 
 544 NOT_RT_JAR_LIST = $(ABS_TEMPDIR)/not_rt_jar.list
 545 
 546 $(NOT_RT_JAR_LIST): FRC
 547         $(prep-target)
 548         $(ECHO) "#\n" >> $@
 549         $(ECHO) "# List of subdirectories not in include in rt.jar" >> $@
 550         $(ECHO) "# Directories must contain trailing '/'." >> $@
 551         $(ECHO) "com/sun/javadoc/" >> $@
 552         $(ECHO) "com/sun/jdi/" >> $@
 553         $(ECHO) "com/sun/jarsigner/" >> $@
 554         $(ECHO) "com/sun/mirror/" >> $@
 555         $(ECHO) "com/sun/source/" >> $@
 556         $(ECHO) "com/sun/istack/internal/tools/" >> $@
 557         $(ECHO) "com/sun/istack/internal/ws/" >> $@
 558         $(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@
 559         $(ECHO) "META-INF/services/com.sun.jdi.connect.spi.TransportService" >> $@
 560         $(ECHO) "META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory" >> $@
 561         $(ECHO) "META-INF/services/com.sun.tools.internal.xjc.Plugin" >> $@
 562         $(ECHO) "com/sun/tools/" >> $@
 563         $(ECHO) "sun/jvmstat/" >> $@
 564         $(ECHO) "sun/rmi/rmic/" >> $@
 565         $(ECHO) "sun/tools/asm/" >> $@
 566         $(ECHO) "sun/tools/java/" >> $@
 567         $(ECHO) "sun/tools/javac/" >> $@
 568         $(ECHO) "sun/tools/javap/" >> $@
 569         $(ECHO) "sun/tools/jconsole/" >> $@
 570         $(ECHO) "sun/tools/jps/" >> $@
 571         $(ECHO) "sun/tools/jstat/" >> $@
 572         $(ECHO) "sun/tools/jstatd/" >> $@
 573         $(ECHO) "sun/tools/native2ascii/" >> $@
 574         $(ECHO) "sun/tools/serialver/" >> $@
 575         $(ECHO) "sun/tools/tree/" >> $@
 576         $(ECHO) "sun/tools/util/" >> $@
 577         $(ECHO) "sun/security/tools/JarBASE64Encoder.class" >> $@
 578         $(ECHO) "sun/security/tools/JarSigner.class" >> $@
 579         $(ECHO) "sun/security/tools/JarSignerParameters.class" >> $@
 580         $(ECHO) "sun/security/tools/JarSignerResources.class" >> $@
 581         $(ECHO) "sun/security/tools/JarSignerResources_ja.class" >> $@
 582         $(ECHO) "sun/security/tools/JarSignerResources_zh_CN.class" >> $@
 583         $(ECHO) "sun/security/tools/SignatureFile\$$Block.class" >> $@
 584         $(ECHO) "sun/security/tools/SignatureFile.class" >> $@
 585         $(ECHO) "sun/security/tools/TimestampedSigner.class" >> $@
 586         $(ECHO) "sun/security/provider/Sun.class" >> $@
 587         $(ECHO) "sun/security/rsa/SunRsaSign.class" >> $@
 588         $(ECHO) "sun/security/ssl/" >> $@
 589         $(ECHO) "com/sun/net/ssl/internal/ssl/" >> $@
 590         $(ECHO) "javax/crypto/" >> $@
 591         $(ECHO) "sun/security/internal/" >> $@
 592         $(ECHO) "com/sun/crypto/provider/" >> $@
 593         $(ECHO) "META-INF/services/com.sun.tools.attach.spi.AttachProvider" >> $@
 594         $(ECHO) "com/sun/tools/attach/" >> $@
 595         $(ECHO) "org/relaxng/datatype/" >> $@
 596         $(ECHO) "com/sun/codemodel/" >> $@
 597         $(ECHO) "com/sun/xml/internal/dtdparser/" >> $@
 598         $(ECHO) "com/sun/xml/internal/rngom/" >> $@
 599         $(ECHO) "com/sun/xml/internal/xsom/" >> $@
 600         $(ECHO) "com/sun/tools/script/shell/" >> $@
 601         $(ECHO) "sun/tools/attach/" >> $@
 602         $(ECHO) "sun/tools/jstack/" >> $@
 603         $(ECHO) "sun/tools/jinfo/" >> $@
 604         $(ECHO) "sun/tools/jmap/" >> $@
 605 
 606 
 607 # File order list for rt.jar
 608 #     - sun.applet is included, till hotjava stops relying on it.
 609 #     - sun.tools.jar is included, needs cleanup.
 610 #
 611 REORDER_TEMPDIR=$(ABS_TEMPDIR)/reorder
 612 TOTAL_JAR_FILELIST=$(REORDER_TEMPDIR)/file_list
 613 
 614 JARFILELISTS_TEMPDIR=$(ABS_TEMPDIR)/jarfilelists
 615 RT_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/rt_jar_list
 616 RES_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/resources_jar_list
 617 
 618 JARREORDER_JARFILE = $(ABS_BUILDTOOLJARDIR)/jarreorder.jar
 619 
 620 $(TOTAL_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_RT_JAR_LIST)
 621         $(prep-target)
 622         $(RM) $@.temp
 623         ($(CD) $(CLASSBINDIR) && \
 624             $(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
 625                 -o  $@.temp $(ABS_LIBDIR)/classlist $(NOT_RT_JAR_LIST) . )
 626         $(MV) $@.temp $@
 627         @($(CD) $(CLASSBINDIR) && $(java-vm-cleanup))
 628 
 629 # Create the rt.jar file list & non-class files list
 630 
 631 JARSPLIT_JARFILE = $(BUILDTOOLJARDIR)/jarsplit.jar
 632 
 633 $(RT_JAR_FILELIST) + $(RES_JAR_FILELIST): \
 634     $(TOTAL_JAR_FILELIST) $(JARSPLIT_JARFILE)
 635         @$(RM) $(RT_JAR_FILELIST) $(RES_JAR_FILELIST)
 636         $(MKDIR) -p $(JARFILELISTS_TEMPDIR)
 637         $(BOOT_JAVA_CMD) -jar $(JARSPLIT_JARFILE) \
 638                 $(TOTAL_JAR_FILELIST) \
 639                 -o  $(RT_JAR_FILELIST) $(RES_JAR_FILELIST)
 640         @$(java-vm-cleanup)
 641 
 642 # Create the manifest file.
 643 JAR_MANIFEST_FILE=$(TEMPDIR)/manifest.tmp
 644 $(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
 645         $(prep-target)
 646         $(SED) -e "s#@@RELEASE@@#$(RELEASE)#"           \
 647                -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
 648                $(MAINMANIFEST) >> $@
 649         $(ECHO) >> $@
 650         $(CAT) $(BEANMANIFEST) >> $@
 651 
 652 # Create resources.jar containing non-class files
 653 RESOURCES_JAR=$(TEMPDIR)/resources-orig.jar
 654 RES_JAR_ARGLIST=$(RES_JAR_FILELIST)_args
 655 $(RES_JAR_ARGLIST): $(RES_JAR_FILELIST)
 656         $(prep-target)
 657         $(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@
 658 $(RESOURCES_JAR): $(RES_JAR_ARGLIST) $(JAR_MANIFEST_FILE)
 659         $(prep-target)
 660         $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
 661             @$(RES_JAR_ARGLIST) $(JAR_JFLAGS)
 662         @$(java-vm-cleanup)
 663 
 664 # Create jsse.jar containing SunJSSE implementation classes
 665 JSSE_JAR=$(TEMPDIR)/jsse-orig.jar
 666 $(JSSE_JAR): $(JAR_MANIFEST_FILE)
 667         $(prep-target)
 668         $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
 669                 $(JSSE_CLASSES_DIRS:%=-C $(CLASSBINDIR) %) \
 670                 $(JAR_JFLAGS)
 671         @$(java-vm-cleanup)
 672 
 673 # Create sec-bin.zip
 674 SEC_FILES_ZIP=$(ABS_TEMPDIR)/sec-bin.zip
 675 sec-files::
 676         $(prep-target)
 677         $(RM) $(SEC_FILES_ZIP)
 678         $(CD) $(OUTPUTDIR) && \
 679                 $(ZIPEXE) -rq9 $(SEC_FILES_ZIP) $(SEC_FILES_DIRS)
 680         @$(java-vm-cleanup)
 681 
 682 # Create sec-windows-bin.zip
 683 SEC_FILES_WIN_ZIP=$(ABS_TEMPDIR)/sec-windows-bin.zip
 684 sec-files-win::
 685 ifeq ($(PLATFORM), windows)
 686         $(prep-target)
 687         $(RM) $(SEC_FILES_WIN_ZIP)
 688         $(CD) $(OUTPUTDIR) && \
 689                 $(ZIPEXE) -rq9 $(SEC_FILES_WIN_ZIP) $(SEC_FILES_WIN_DIRS)
 690         @$(java-vm-cleanup)
 691 endif
 692 
 693 # Create JGSS files that contains the native Kerberos library
 694 JGSS_WIN32_FILES_ZIP=$(ABS_TEMPDIR)/jgss-windows-i586-bin.zip
 695 JGSS_WIN64_FILES_ZIP=$(ABS_TEMPDIR)/jgss-windows-x64-bin.zip
 696 jgss-files::
 697 ifeq ($(PLATFORM), windows)
 698         $(prep-target)
 699   ifeq ($(ARCH_DATA_MODEL), 32)
 700         $(RM) $(JGSS_WIN32_FILES_ZIP)
 701         $(CD) $(OUTPUTDIR) && \
 702                 $(ZIPEXE) -rq9 $(JGSS_WIN32_FILES_ZIP) $(JGSS_FILES_DIRS)
 703   else
 704         $(RM) $(JGSS_WIN64_FILES_ZIP)
 705         $(CD) $(OUTPUTDIR) && \
 706                 $(ZIPEXE) -rq9 $(JGSS_WIN64_FILES_ZIP) $(JGSS_FILES_DIRS)
 707   endif
 708         @$(java-vm-cleanup)
 709 endif
 710 
 711 # Create rt.jar
 712 RT_JAR=$(ABS_TEMPDIR)/rt-orig.jar
 713 RT_JAR_ARGLIST=$(RT_JAR_FILELIST)_args
 714 $(RT_JAR_ARGLIST): $(RT_JAR_FILELIST)
 715         $(prep-target)
 716         $(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@
 717 $(RT_JAR): $(RT_JAR_ARGLIST) $(JAR_MANIFEST_FILE)
 718         $(prep-target)
 719         $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
 720             @$(RT_JAR_ARGLIST) $(JAR_JFLAGS)
 721         @$(java-vm-cleanup)
 722 
 723 # Meta-index construction to make core class loaders lazier
 724 
 725 BUILDMETAINDEX_JARFILE = $(ABS_BUILDTOOLJARDIR)/buildmetaindex.jar
 726 
 727 ######################################################
 728 # JRE Image
 729 ######################################################
 730 
 731 initial-image-jre-setup:
 732         $(RM) -r $(JRE_IMAGE_DIR)
 733         $(MKDIR) -p $(JRE_IMAGE_DIR)
 734 
 735 # 64-bit solaris jre image contains only the 64-bit add-on files.
 736 initial-image-jre-sol64:: initial-image-jre-setup \
 737                           $(JRE_LICENSES) $(JRE64_LICENSES)
 738         @# Use tar instead of cp to preserve the symbolic links
 739         for dir in bin lib ; do \
 740           ( $(CD) $(OUTPUTDIR) && \
 741                 $(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \
 742                 ($(CD) $(JRE_IMAGE_DIR) && $(TAR) xf -) ) ; \
 743         done
 744         @# Remove some files from the jre area
 745         for t in $(NOTJRETOOLS) ; do \
 746             $(RM) $(JRE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
 747         done
 748         for l in $(NOTJRELIBS) ; do \
 749             $(RM) $(JRE_IMAGE_DIR)/lib/$$l ; \
 750         done
 751         $(RM) `$(FIND) $(JRE_IMAGE_DIR)/lib -name 'orb.idl'`
 752         $(RM) `$(FIND) $(JRE_IMAGE_DIR)/lib -name 'ir.idl'`
 753 
 754 # Construct an initial jre image (initial jdk jre) no trimming or stripping
 755 initial-image-jre:: initial-image-jre-setup \
 756                     $(JRE_LICENSES) $(JRE_DOCFILES) \
 757                     $(RT_JAR) $(RESOURCES_JAR) $(JSSE_JAR) \
 758                     $(BUILDMETAINDEX_JARFILE)
 759         @# Copy in bin directory
 760         $(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR)
 761         @# CTE plugin security change require new empty directory lib/applet
 762         $(MKDIR) -p $(JRE_IMAGE_DIR)/lib/applet
 763         @# Copy in lib directory
 764         $(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR)
 765         @# Make sure all directories are read/execute for everyone
 766         $(CHMOD) a+rx `$(FIND) $(JRE_IMAGE_DIR) -type d`
 767         @# Remove some files from the jre area
 768         for t in $(NOTJRETOOLS) ; do \
 769             $(RM) $(JRE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
 770         done
 771         for l in $(NOTJRELIBS) ; do \
 772             $(RM) $(JRE_IMAGE_DIR)/lib/$$l ; \
 773         done
 774         @# Remove orb.idl and ir.idl from jre
 775         $(FIND) $(JRE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \;
 776         $(FIND) $(JRE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \;
 777         @# Copy in rt.jar & resources.jar file
 778         $(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
 779         $(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
 780         $(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
 781         @# Generate meta-index to make boot and extension class loaders lazier
 782         $(CD) $(JRE_IMAGE_DIR)/lib && \
 783             $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
 784                 -o meta-index *.jar
 785         @$(CD) $(JRE_IMAGE_DIR)/lib && $(java-vm-cleanup)
 786         $(CD) $(JRE_IMAGE_DIR)/lib/ext && \
 787             $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
 788                 -o meta-index *.jar
 789         @$(CD) $(JRE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup)
 790 ifeq ($(PLATFORM), windows)
 791         @# Remove certain *.lib files
 792         $(CD) $(JRE_IMAGE_DIR)/lib && \
 793             $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \
 794                   hpi.$(LIB_SUFFIX) awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX)
 795 endif # Windows
 796 ifneq ($(PLATFORM), windows)
 797         $(call copy-man-pages,$(JRE_IMAGE_DIR),$(JRE_MAN_PAGES))
 798 endif # !windows
 799 
 800 # Trim out any extra files not for the jre shipment but wanted in the jdk jre.
 801 #   (Note the jdk WILL want the jre image before this trimming)
 802 #   Removes server VM on Windows 32bit.
 803 #   Remove certain shared libraries that should not be in the jre image
 804 #      but should be in the jdk jre image.
 805 trim-image-jre::
 806 ifeq ($(PLATFORM), windows)
 807   ifeq ($(ARCH_DATA_MODEL), 32)
 808         $(RM) -r $(JRE_IMAGE_DIR)/bin/server
 809   endif
 810   ifdef NOTJRE_SHARED_LIBS
 811         for l in $(NOTJRE_SHARED_LIBS) ; do \
 812             $(RM) $(JRE_IMAGE_DIR)/bin/$$l ; \
 813         done ;
 814   endif
 815 else # PLATFORM
 816   ifdef NOTJRE_SHARED_LIBS
 817         for l in $(NOTJRE_SHARED_LIBS) ; do \
 818             $(RM) $(JRE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \
 819         done ;
 820   endif
 821 endif # PLATFORM
 822 
 823 # Get list of all Elf files in the jre
 824 JRE_ELF_LIST=$(TEMPDIR)/jre-elf-files.list
 825 $(JRE_ELF_LIST):
 826 ifneq ($(PLATFORM), windows)
 827         $(RM) $@
 828         $(FIND) $(JRE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@
 829         $(FILE) `$(FIND) $(JRE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
 830             | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
 831 endif
 832 
 833 # Post process the image (strips and mcs on Elf files we are shipping)
 834 #   (Note the jdk WILL want the jre image before this processing)
 835 process-image-jre:: $(JRE_ELF_LIST)
 836 ifneq ($(POST_STRIP_PROCESS), )
 837         for f in `$(CAT) $(JRE_ELF_LIST)`; do \
 838           $(CHMOD) u+w $${f}; \
 839           $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
 840           $(POST_STRIP_PROCESS) $${f}; \
 841           $(CHMOD) go-w $${f}; \
 842         done
 843 endif
 844 ifneq ($(POST_MCS_PROCESS), )
 845         for f in `$(CAT) $(JRE_ELF_LIST)`; do \
 846           $(CHMOD) u+w $${f}; \
 847           $(ECHO) $(POST_MCS_PROCESS) $${f}; \
 848           $(POST_MCS_PROCESS) $${f}; \
 849           $(CHMOD) go-w $${f}; \
 850         done
 851 endif
 852         $(RM) $(JRE_ELF_LIST)
 853 
 854 ######################################################
 855 # JDK Image
 856 ######################################################
 857 # Note: cpio ($(CPIO)) sometimes leaves directories without rx access.
 858 
 859 initial-image-jdk-setup:
 860         $(RM) -r $(JDK_IMAGE_DIR)
 861         $(MKDIR) -p $(JDK_IMAGE_DIR)/jre
 862         ($(CD) $(JRE_IMAGE_DIR) && $(FIND) . -depth -print \
 863               | $(CPIO) -pdum $(JDK_IMAGE_DIR)/jre )
 864         $(RM) -rf $(JDK_IMAGE_DIR)/jre/man
 865         $(CHMOD) a+rx `$(FIND) $(JDK_IMAGE_DIR) -type d`
 866 
 867 initial-image-jdk64-bindemos:
 868         for dir in bin demo ; do \
 869           ( $(CD) $(OUTPUTDIR) && \
 870                 $(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \
 871                 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) xf -) ) ; \
 872         done
 873 
 874 # Solaris 64 bit image is special
 875 initial-image-jdk-sol64:: initial-image-jdk-setup \
 876                           initial-image-jdk64-bindemos \
 877                           $(JDK_LICENSES) $(JDK64_LICENSES)
 878 
 879 # DB files to add
 880 ifdef OPENJDK
 881 
 882 initial-image-jdk-db:
 883 
 884 else
 885 
 886 # Create the list of db *.zip files to bundle with jdk
 887 ABS_DB_PATH  :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
 888 DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null)
 889 
 890 initial-image-jdk-db: $(DB_ZIP_LIST)
 891         $(MKDIR) -p $(JDK_IMAGE_DIR)/db
 892         for d in $(DB_ZIP_LIST); do \
 893           ($(CD) $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
 894         done
 895 
 896 endif
 897 
 898 # Standard jdk image
 899 initial-image-jdk:: initial-image-jdk-setup \
 900                     initial-image-jdk-db \
 901                     $(JDK_LICENSES) $(JDK_DOCFILES)
 902         $(MKDIR) $(JDK_IMAGE_DIR)/lib
 903         @#
 904         @# Copy in the jars in lib that only belong in the JDK
 905         @#
 906         for l in $(NOTJRELIBS); do \
 907             if [ -r $(LIBDIR)/$$l ]; then \
 908                 $(CP) $(LIBDIR)/$$l $(JDK_IMAGE_DIR)/lib; \
 909             fi; \
 910         done
 911   ifeq ($(PLATFORM), windows)
 912         @#
 913         @# lib/
 914         @#
 915         $(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_IMAGE_DIR)/lib
 916         $(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_IMAGE_DIR)/lib
 917         @#
 918         @# bin/
 919         @#
 920         @# copy all EXE files and only certain DLL files from BINDIR
 921         $(MKDIR) -p $(JDK_IMAGE_DIR)/bin
 922         $(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_IMAGE_DIR)/bin
 923         $(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
 924     ifeq ($(ARCH_DATA_MODEL), 32)
 925       ifeq ($(COMPILER_VERSION), VS2003)
 926         $(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
 927       endif
 928     endif
 929   else # PLATFORM
 930         @#
 931         @# bin/
 932         @#
 933         ($(CD) $(BINDIR)/.. && $(TAR) cf - \
 934             `$(FIND) bin \( -type f -o -type l \) -print `) | \
 935             ($(CD) $(JDK_IMAGE_DIR) && $(TAR) xf -)
 936   endif # PLATFORM
 937         @#
 938         @# files that might not exist need to be touched.
 939         @#
 940         $(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.internal.xjc.Plugin
 941         @#
 942         @# lib/tools.jar
 943         @#
 944         $(BOOT_JAR_CMD) c0f $(LIBDIR)/tools.jar $(addprefix \
 945                 -C $(CLASSBINDIR) , $(TOOLS)) \
 946                 $(JAR_JFLAGS)
 947         @$(java-vm-cleanup)
 948         $(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar
 949         @#
 950         @# lib/ct.sym
 951         @#
 952         $(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym
 953         $(JAVAC_CMD) -XDprocess.packages -proc:only \
 954             -processor com.sun.tools.javac.sym.CreateSymbols \
 955             -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
 956             -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
 957             $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
 958         $(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
 959             -C $(OUTPUTDIR)/symbols META-INF $(JAR_JFLAGS)
 960         @$(java-vm-cleanup)
 961         $(CP) $(LIBDIR)/ct.sym $(JDK_IMAGE_DIR)/lib/ct.sym
 962         @#
 963         @# CORBA supported orb.idl and ir.idl should be copied to lib
 964         @#
 965         $(CP) $(LIBDIR)/orb.idl $(JDK_IMAGE_DIR)/lib/orb.idl
 966         $(CP) $(LIBDIR)/ir.idl $(JDK_IMAGE_DIR)/lib/ir.idl
 967   ifeq ($(PLATFORM), linux)
 968         @#
 969         @# on Linux copy jexec from jre/lib to /lib
 970         @#
 971         $(CP) $(LIBDIR)/jexec $(JDK_IMAGE_DIR)/lib/jexec
 972   endif # PLATFORM
 973         @#
 974         @# src.zip
 975         @#
 976         $(MKDIR) -p $(JDK_IMAGE_DIR)/src
 977         @#
 978         @# The '*-*' pattern in the find command excludes files named with dashes,
 979         @# such as the java.nio templates for generated classes
 980         @#
 981         @# The Linux 'tar' command cannot handle the huge command line argument
 982         @# generated by the more efficient solaris/windows method of copying files.
 983         @# So for Linux, make use of the -T option (like Solaris' -I option) of
 984         @# obtaining the list of files from a file. MKS tar has no such option.
 985   ifeq ($(PLATFORM), linux)
 986         for d in $(SOURCE_DIRS); do \
 987           $(RM) $(ABS_TEMPDIR)/src-files.list; \
 988           ($(CD) $$d &&  \
 989             for sd in $(SOURCES) ; do \
 990               if [ -d $$sd ] ; then \
 991                 $(FIND) $$sd $(SOURCE_FILES_filter) \
 992                         -name '*.java' -print \
 993                         >> $(ABS_TEMPDIR)/src-files.list ; \
 994               fi; \
 995             done ; \
 996           ) ; \
 997           if [ -f  $(ABS_TEMPDIR)/src-files.list ] ; then \
 998             ($(CD) $$d && $(TAR) cf - -T $(ABS_TEMPDIR)/src-files.list ) \
 999                | ($(CD) $(JDK_IMAGE_DIR)/src && $(TAR) xf -); \
1000           fi; \
1001         done
1002   else
1003         for d in $(SOURCE_DIRS); do \
1004           $(RM) $(ABS_TEMPDIR)/src-files.list; \
1005           ($(CD) $$d && \
1006             for sd in $(SOURCES) ; do \
1007               if [ -d $$sd ] ; then \
1008                 $(FIND) $$sd $(SOURCE_FILES_filter) \
1009                         -name '*.java' -print \
1010                         >> $(ABS_TEMPDIR)/src-files.list ; \
1011               fi; \
1012             done ; \
1013           ) ; \
1014           if [ -f  $(ABS_TEMPDIR)/src-files.list ] ; then \
1015             ($(CD) $$d && $(TAR) cf - `$(CAT) $(ABS_TEMPDIR)/src-files.list`) \
1016               | ($(CD) $(JDK_IMAGE_DIR)/src && $(TAR) xf -); \
1017           fi; \
1018         done
1019   endif
1020         $(RM) $(ABS_TEMPDIR)/src-files.list
1021         $(CHMOD) -R +w $(JDK_IMAGE_DIR)/src
1022         $(MKDIR) -p $(JDK_IMAGE_DIR)/src/launcher
1023         $(CP) $(SHARE_SRC)/bin/java.c $(JDK_IMAGE_DIR)/src/launcher
1024         $(CP) $(SHARE_SRC)/bin/java.h $(JDK_IMAGE_DIR)/src/launcher
1025         $(CP) $(SHARE_SRC)/bin/manifest_info.h $(JDK_IMAGE_DIR)/src/launcher
1026         $(CP) $(SHARE_SRC)/bin/parse_manifest.c $(JDK_IMAGE_DIR)/src/launcher
1027         $(CP) $(SHARE_SRC)/bin/version_comp.c $(JDK_IMAGE_DIR)/src/launcher
1028         $(CP) $(SHARE_SRC)/bin/version_comp.h $(JDK_IMAGE_DIR)/src/launcher
1029         $(CP) $(SHARE_SRC)/bin/wildcard.h $(JDK_IMAGE_DIR)/src/launcher
1030         $(CP) $(SHARE_SRC)/bin/wildcard.c $(JDK_IMAGE_DIR)/src/launcher
1031         $(CP) $(SHARE_SRC)/bin/jli_util.h $(JDK_IMAGE_DIR)/src/launcher
1032         $(CP) $(SHARE_SRC)/bin/jli_util.c $(JDK_IMAGE_DIR)/src/launcher
1033         $(CP) $(SHARE_SRC)/bin/splashscreen_stubs.c $(JDK_IMAGE_DIR)/src/launcher
1034         $(CP) $(SHARE_SRC)/bin/splashscreen.h $(JDK_IMAGE_DIR)/src/launcher
1035         $(CP) $(PLATFORM_SRC)/bin/java_md.c $(JDK_IMAGE_DIR)/src/launcher
1036         $(CP) $(PLATFORM_SRC)/bin/java_md.h $(JDK_IMAGE_DIR)/src/launcher
1037         $(CD) $(JDK_IMAGE_DIR)/src && $(ZIPEXE) -qr ../src.zip *
1038         $(RM) -r $(JDK_IMAGE_DIR)/src
1039         @#
1040         @# demo, include
1041         @#
1042         $(CP) -r -f $(DEMODIR) $(JDK_IMAGE_DIR)
1043         $(CP) -r -f $(SAMPLEDIR) $(JDK_IMAGE_DIR)
1044         $(CP) -r $(INCLUDEDIR) $(JDK_IMAGE_DIR)
1045         @#
1046         @# Swing BeanInfo generation
1047         @#
1048         $(CD) javax/swing/beaninfo && $(MAKE) swing-1.2-beans
1049 ifneq ($(PLATFORM), windows)
1050         $(call copy-man-pages,$(JDK_IMAGE_DIR),$(JDK_MAN_PAGES))
1051 endif # !windows
1052 
1053 # Trim out files we don't want to ship
1054 trim-image-jdk::
1055         @# Remove tools that should not be part of SDK.
1056         for t in $(NOTJDKTOOLS); do \
1057             $(RM) $(JDK_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX) \
1058                   $(JDK_IMAGE_DIR)/bin/*/native_threads/$${t}$(EXE_SUFFIX); \
1059         done
1060 
1061 # Get list of Elf files in the jdk
1062 JDK_ELF_LIST=$(TEMPDIR)/jdk-elf-files.list
1063 $(JDK_ELF_LIST):
1064 ifneq ($(PLATFORM), windows)
1065         $(RM) $@
1066         $(FIND) $(JDK_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@
1067         $(FILE) `$(FIND) $(JDK_IMAGE_DIR)/jre/bin -type f -name \*$(EXE_SUFFIX)` \
1068             | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
1069         file `$(FIND) $(JDK_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
1070             | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
1071 endif
1072 
1073 # Post process the image (strips and mcs on files we are shipping)
1074 process-image-jdk:: $(JDK_ELF_LIST)
1075 ifneq ($(POST_STRIP_PROCESS), )
1076         for f in `$(CAT) $(JDK_ELF_LIST)`; do \
1077           $(CHMOD) u+w $${f}; \
1078           $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
1079           $(POST_STRIP_PROCESS) $${f}; \
1080           $(CHMOD) go-w $${f}; \
1081         done
1082 endif
1083 ifneq ($(POST_MCS_PROCESS), )
1084         for f in `$(CAT) $(JDK_ELF_LIST)`; do \
1085           $(CHMOD) u+w $${f}; \
1086           $(ECHO) $(POST_MCS_PROCESS) $${f}; \
1087           $(POST_MCS_PROCESS) $${f}; \
1088           $(CHMOD) go-w $${f}; \
1089         done
1090 endif
1091         $(RM) $(JDK_ELF_LIST)
1092 
1093 ###################################################################
1094 # What do we compare against
1095 ###################################################################
1096 
1097 # The temporary files and areas created
1098 TEMP_PREV_JRE_BASE_DIR=$(TEMPDIR)/previous_jre
1099 TEMP_PREV_JDK_BASE_DIR=$(TEMPDIR)/previous_jdk
1100 TEMP_PREV_JRE_COMPARISON=$(TEMP_PREV_JRE_BASE_DIR)/previous_jre_comparison.txt
1101 TEMP_PREV_JDK_COMPARISON=$(TEMP_PREV_JDK_BASE_DIR)/previous_jdk_comparison.txt
1102 TEMP_PREV_JRE_IMAGE_DIR=$(TEMP_PREV_JRE_BASE_DIR)/jre$(PREVIOUS_JDK_VERSION)
1103 TEMP_PREV_JDK_IMAGE_DIR=$(TEMP_PREV_JDK_BASE_DIR)/jdk$(PREVIOUS_JDK_VERSION)
1104 
1105 # unbundle(sourcedir,bundlename,destdir)
1106 #    logic is slightly different if a .tar.gz file (linux)
1107 define unbundle
1108 $(RM) -r $3
1109 $(MKDIR) -p $3
1110 $(CP) $1 $3
1111 if [ "`$(BASENAME) $2 .gz`" != "$2" ] ; then \
1112   ( $(CD) $3 && ( $(GUNZIP) -dc $2 | $(TAR) xf - ) && $(RM) $2 ); \
1113 else \
1114   ( $(CD) $3 && $(TAR) xf $2 && $(RM) $2 ); \
1115 fi
1116 ( $(CD) $3 && $(RM) $2 )
1117 endef
1118 
1119 # In general, ignore the fastdebug tree, and changes in the demo and sample area
1120 COMPARE_FILTER = | $(EGREP) -v /fastdebug/ | $(EGREP) -v /demo/ | $(EGREP) -v /sample/
1121 
1122 # If a previuous image is provided, no need to install it.
1123 ifdef PREVIOUS_JDK_IMAGE
1124 
1125   # Just use the pre-installed images
1126   PREV_JRE_IMAGE_DIR=$(PREVIOUS_JDK_IMAGE)/jre
1127   PREV_JDK_IMAGE_DIR=$(PREVIOUS_JDK_IMAGE)
1128 
1129 else
1130 
1131   # Use the temp images we will create
1132   PREV_JRE_IMAGE_DIR=$(TEMP_PREV_JRE_IMAGE_DIR)
1133   PREV_JDK_IMAGE_DIR=$(TEMP_PREV_JDK_IMAGE_DIR)
1134 
1135 # Force the installation in this case
1136 compare-image:: install-previous-sanity install-previous-jre install-previous-jdk
1137 
1138 # Unbundle the jre
1139 $(TEMP_PREV_JRE_IMAGE_DIR)/bin/java$(EXE_SUFFIX): $(PREVIOUS_JRE_BUNDLE)
1140         $(call unbundle,$(PREVIOUS_JRE_BUNDLE),$(PREVIOUS_JRE_FILE),$(TEMP_PREV_JRE_BASE_DIR))
1141         $(TOUCH) $@
1142 
1143 # Unbundle the jdk
1144 $(TEMP_PREV_JDK_IMAGE_DIR)/bin/java$(EXE_SUFFIX): $(PREVIOUS_JDK_BUNDLE)
1145         $(call unbundle,$(PREVIOUS_JDK_BUNDLE),$(PREVIOUS_JDK_FILE),$(TEMP_PREV_JDK_BASE_DIR))
1146         $(TOUCH) $@
1147 
1148 endif
1149 
1150 # Make sure all images have a java in them (used as the touch file)
1151 install-previous-sanity:
1152         @if [ ! -f $(PREVIOUS_JRE_BUNDLE) ]; then \
1153           $(ECHO) "ERROR: You do not have access to the previous java release jre bundles. \n" \
1154             "      Please check your access to \n" \
1155             "          $(PREVIOUS_JRE_BUNDLE) \n" \
1156             "      and/or check your value of ALT_PREVIOUS_RELEASE_PATH or ALT_PREVIOUS_JRE_FILE \n" \
1157             "      This will affect you if you build the images target. \n" \
1158             "" >> $(ERROR_FILE) ; \
1159         fi
1160         @if [ ! -f $(PREVIOUS_JDK_BUNDLE) ]; then \
1161           $(ECHO) "ERROR: You do not have access to the previous java release sdk bundles. \n" \
1162           "      Please check your access to \n" \
1163           "          $(PREVIOUS_sdk_BUNDLE) \n" \
1164           "      and/or check your value of ALT_PREVIOUS_RELEASE_PATH or ALT_PREVIOUS_JDK_FILE. \n" \
1165           "      This will affect you if you build the images target. \n" \
1166           "" >> $(ERROR_FILE) ; \
1167         fi
1168 install-previous-jre: $(PREV_JRE_IMAGE_DIR)/bin/java$(EXE_SUFFIX)
1169 install-previous-jdk: $(PREV_JDK_IMAGE_DIR)/bin/java$(EXE_SUFFIX)
1170 
1171 # Create the jre comparison report
1172 $(TEMP_PREV_JRE_COMPARISON): install-previous-jre $(DIRDIFF_JARFILE)
1173         $(prep-target)
1174         $(BOOT_JAVA_CMD) -jar $(DIRDIFF_JARFILE) \
1175            $(PREV_JRE_IMAGE_DIR) $(JRE_IMAGE_DIR) | $(SORT) > $@
1176         @$(java-vm-cleanup)
1177 
1178 # Create the jdk comparison report
1179 $(TEMP_PREV_JDK_COMPARISON): install-previous-jdk $(DIRDIFF_JARFILE)
1180         $(prep-target)
1181         $(BOOT_JAVA_CMD) -jar $(DIRDIFF_JARFILE) \
1182            $(PREV_JDK_IMAGE_DIR) $(JDK_IMAGE_DIR) | $(SORT) > $@
1183         @$(java-vm-cleanup)
1184 
1185 # Clean up names in the messages printed out
1186 CAT_FILTER = $(SED) -e "s@$(JDK_IMAGE_DIR)@JDK_IMAGE@g" \
1187                     -e "s@$(JRE_IMAGE_DIR)@JRE_IMAGE@g"
1188 
1189 # Report on the jre image comparison
1190 compare-image-jre: $(TEMP_PREV_JRE_COMPARISON)
1191         @$(ECHO) "JRE Image Comparison to version $(PREVIOUS_JDK_VERSION)"
1192         @$(ECHO) "  Previous: $(PREV_JRE_IMAGE_DIR)"
1193         @$(ECHO) "  Current:  $(JRE_IMAGE_DIR)"
1194         @$(CAT) $< $(COMPARE_FILTER) | $(CAT_FILTER)
1195         ( $(ECHO) " " ; $(CAT) $< | $(CAT_FILTER) ; $(ECHO) " " ) >> $(WARNING_FILE)
1196 
1197 # Report on the jdk image comparison
1198 compare-image-jdk: $(TEMP_PREV_JDK_COMPARISON)
1199         @$(ECHO) "JDK Image Comparison to version $(PREVIOUS_JDK_VERSION)"
1200         @$(ECHO) "  Previous: $(PREV_JDK_IMAGE_DIR)"
1201         @$(ECHO) "  Current:  $(JDK_IMAGE_DIR)"
1202         $(CAT) $< $(COMPARE_FILTER) | $(CAT_FILTER)
1203         ( $(ECHO) " " ; $(CAT) $< | $(CAT_FILTER) ; $(ECHO) " " ) >> $(WARNING_FILE)
1204 
1205 # Do both image comparisons
1206 compare-image:: compare-image-jre compare-image-jdk
1207 
1208 # Clean up any temp images and reports
1209 compare-image-clobber:
1210         $(RM) -r $(TEMP_PREV_JRE_BASE_DIR)
1211         $(RM) -r $(TEMP_PREV_JDK_BASE_DIR)
1212 
1213 ######################################################
1214 # clobber
1215 ######################################################
1216 images-clobber::
1217         $(RM) -r $(REORDER_TEMPDIR)
1218         $(RM) -r $(JARFILELISTS_TEMPDIR)
1219 ifeq ($(ARCH_DATA_MODEL), 32)
1220         $(CD) javax/swing/beaninfo && $(MAKE) swingbeans.clobber
1221         $(RM) -r $(CLASSBINDIR)/META-INF
1222         $(RM) $(TEMPDIR)/tmp.jar
1223 endif
1224 ifeq ($(PLATFORM), linux)
1225         $(RM) -r $(OUTPUTDIR)/$(ARCH)
1226 endif
1227 ifeq ($(PLATFORM), windows)
1228         $(RM) $(TEMPDIR)/rebase.input
1229 endif
1230         $(RM) -r $(JDK_IMAGE_DIR)
1231         $(RM) -r $(JDK_DEBUG_IMAGE_DIR)
1232         $(RM) -r $(JRE_IMAGE_DIR)
1233 
1234 images images-clobber::
1235         @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
1236         @$(java-vm-cleanup)
1237 
1238 .PHONY: images image-jre image-jdk \
1239         initial-image-jre initial-image-jdk \
1240         initial-image-jre-sol64 initial-image-jdk-sol64 \
1241         initial-image-jdk-setup \
1242         initial-image-jdk-db \
1243         initial-image-jdk64-bindemos \
1244         initial-image-jre-setup \
1245         trim-image-jre trim-image-jdk \
1246         process-image-jre process-image-jdk \
1247         install-previous-jre install-previous-jdk \
1248         compare-image-jre compare-image-jdk \
1249         compare-image compare-image-clobber \
1250         images-clobber
1251 
1252 # Force rule
1253 FRC:
1254