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