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