Release.gmk 45.5 KB
Newer Older
D
duke 已提交
1
#
2
# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.  Oracle designates this
D
duke 已提交
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
D
duke 已提交
10 11 12 13 14 15 16 17 18 19 20
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
21 22 23
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
D
duke 已提交
24 25 26 27 28
#

include $(JDK_TOPDIR)/make/docs/CORE_PKGS.gmk
include $(JDK_TOPDIR)/make/docs/NON_CORE_PKGS.gmk

29 30 31
# What jdk version are we building
THIS_JDK_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)

D
duke 已提交
32 33 34 35 36 37 38 39 40
#
# Perform release engineering tasks.
#
# images    An image is what the product looks like when it is
#           installed.
#

IMAGE_BINDIR = bin

41
# The compiler should not issue a "Proprietary" warning when compiling
D
duke 已提交
42 43 44 45 46 47 48 49 50 51 52
# classes in the com.sun.java.swing.plaf packages, since we've always
# allowed, and even advocated, extending them (see bug 6476749).
#
# This approach is NOT to be used as a general purpose way to avoid such
# compiler warnings for non-core packages. The correct way is to document
# the packages in NON_CORE_PKGS.gmk, and include them in the NON_CORE_PKGS
# definition.
#
# Swing has taken this approach only as a temporary measure to avoid
# the compiler warnings until we can properly document these packages.
# This is covered under 6491853.
53
EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows  \
D
duke 已提交
54 55 56
                        com.sun.java.swing.plaf.motif    \
                        com.sun.java.swing.plaf.gtk

57 58 59
#
# Include the exported private packages in ct.sym.
# This is an interim solution until the ct.sym is replaced
60
# with a new module system (being discussed for JDK 8).
61
#
M
mchung 已提交
62
EXPORTED_PRIVATE_PKGS = com.oracle.net \
63
                        com.oracle.nio
64

D
duke 已提交
65 66 67 68 69 70 71 72 73 74 75
# 64-bit solaris has a few special cases. We define the variable
# SOLARIS64 for use in this Makefile to easily test those cases
ifeq ($(PLATFORM), solaris)
  ifeq ($(ARCH_DATA_MODEL), 64)
    SOLARIS64 = true
    IMAGE_BINDIR = bin/$(ARCH)
  endif
endif

JTG_DOCS            = $(JDK_TOPDIR)/src/solaris/doc

76 77 78 79
ifeq ($(PLATFORM), macosx)
  include $(JDK_TOPDIR)/make/common/Release-$(PLATFORM).gmk
endif

D
duke 已提交
80
# The base names of all the license and document files for the jdk and jre
81
#   (These files get placed in the jdk and jre install images)
D
duke 已提交
82
ifdef OPENJDK
83 84 85
  # Where to find these files
  SHARE_JDK_DOC_SRC = $(JDK_TOPDIR)
  SHARE_JRE_DOC_SRC = $(JDK_TOPDIR)
D
duke 已提交
86
  # Same files for jdk and jre, no name changes
87
  IMAGE_DOCLIST_JDK = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
C
cgruszka 已提交
88
  IMAGE_DOCLIST_JDK_DEMOS_AND_SAMPLES =
89
  IMAGE_DOCLIST_JRE = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
D
duke 已提交
90
else
91
  # make/closed/common/Defs.gmk for closed location of SHARE_JDK_DOC_SRC
92

93
  IMAGE_DOCLIST_JDK = COPYRIGHT README.html  LICENSE THIRDPARTYLICENSEREADME.txt
C
cgruszka 已提交
94
  IMAGE_DOCLIST_JDK_DEMOS_AND_SAMPLES = demo/DEMOS_LICENSE sample/SAMPLES_LICENSE
95
  IMAGE_DOCLIST_JRE = COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
D
duke 已提交
96
  ifeq ($(PLATFORM), windows)
97
    IMAGE_DOCLIST_JRE += README.txt
D
duke 已提交
98
  else
99
    IMAGE_DOCLIST_JRE += README
D
duke 已提交
100 101 102 103
  endif
endif

# Paths to these files we need
104 105
JDK_DOCFILES   = $(IMAGE_DOCLIST_JDK:%=$(JDK_IMAGE_DIR)/%)
JRE_DOCFILES   = $(IMAGE_DOCLIST_JRE:%=$(JRE_IMAGE_DIR)/%)
C
cgruszka 已提交
106
JDK_DEMOS_AND_SAMPLES_DOCFILES = $(IMAGE_DOCLIST_JDK_DEMOS_AND_SAMPLES:%=$(JDK_IMAGE_DIR)/%)
D
duke 已提交
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130

# absolute directory names: note, these must exist prior to build
# time - they are created in the main Makefile.
JRE_IMAGE_BINDIR   = $(JRE_IMAGE_DIR)/bin

MAINMANIFEST  = $(JDK_TOPDIR)/make/tools/manifest.mf
BEANMANIFEST  = $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest

#
# Man pages
#

JRE_MAN_PAGES =         \
	java.1		\
	keytool.1	\
	orbd.1          \
	pack200.1	\
	policytool.1    \
	rmid.1		\
	rmiregistry.1	\
	servertool.1    \
	tnameserv.1     \
	unpack200.1

131
ifndef OPENJDK
D
duke 已提交
132 133 134 135 136 137 138 139 140 141 142 143 144 145
  JRE_MAN_PAGES += javaws.1
endif

JDK_MAN_PAGES =            \
	$(JRE_MAN_PAGES)   \
	appletviewer.1     \
	extcheck.1         \
	idlj.1             \
	jar.1              \
	jarsigner.1        \
	javac.1            \
	javadoc.1          \
	javah.1            \
	javap.1            \
146
	jcmd.1             \
D
duke 已提交
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
	jconsole.1         \
	jdb.1              \
	jhat.1             \
        jinfo.1            \
        jmap.1             \
        jps.1              \
	jrunscript.1       \
        jsadebugd.1        \
        jstack.1           \
        jstat.1            \
        jstatd.1           \
	native2ascii.1     \
	rmic.1             \
        schemagen.1        \
	serialver.1        \
        wsgen.1            \
        wsimport.1         \
        xjc.1

166 167 168 169
ifndef OPENJDK
  JDK_MAN_PAGES += jvisualvm.1
endif

D
duke 已提交
170 171 172 173 174 175 176 177
ifeq ($(PLATFORM), solaris)
  MANBASEDIRS=$(JDK_TOPDIR)/src/solaris/doc $(IMPORTDOCDIR)
  MAN1SUBDIR=sun/man/man1
endif # solaris

ifeq ($(PLATFORM), linux)
  MANBASEDIRS=$(JDK_TOPDIR)/src/linux/doc $(IMPORTDOCDIR)
  MAN1SUBDIR=man
178
  JA_DIRNAME=ja_JP.UTF-8
D
duke 已提交
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
endif # linux

define copy-man-pages
$(MKDIR) -p $1/man/man1
for manbase in $(MANBASEDIRS:%=%/$(MAN1SUBDIR)) ; do \
  for manpage in $2; do \
    if [ -f $${manbase}/$${manpage} ] ; then \
      $(CP) $${manbase}/$${manpage} $1/man/man1 ; \
      for ja_encoding in $(JA_TARGET_ENCODINGS); do \
        ja_dir="ja"; \
        if [ "$${ja_encoding}" != "$(JA_SOURCE_ENCODING)" ]; then \
          ja_dir="ja_JP.$${ja_encoding}"; \
	fi; \
        $(MKDIR) -p $1/man/$${ja_dir}/man1; \
        $(CAT) $${manbase}/ja/$${manpage} \
          | $(NATIVE2ASCII) -encoding $(JA_SOURCE_ENCODING) \
195
          | $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \
D
duke 已提交
196 197 198 199 200 201 202 203
          | $(NATIVE2ASCII) -reverse -encoding $${ja_encoding} \
            > $1/man/$${ja_dir}/man1/$${manpage}; \
      done; \
    fi; \
  done; \
done
$(java-vm-cleanup)
if [ "$(JA_DIRNAME)" != "" ] ; then \
204
  $(CD) $1/man && $(RM) ja && $(LN) -s $(JA_DIRNAME) ja; \
D
duke 已提交
205 206 207
fi
endef

208 209 210 211 212 213 214 215 216 217

# no compression unless requested
ifndef COMPRESS_JARS
  CREATE_JAR_OPTS = c0mf
  CREATE_JAR_OPTS_NOMANIFEST = c0f
else
  CREATE_JAR_OPTS = cmf
  CREATE_JAR_OPTS_NOMANIFEST = cf
endif

D
duke 已提交
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
#
# Targets.
#
INITIAL_IMAGE_JRE=initial-image-jre
INITIAL_IMAGE_JDK=initial-image-jdk
ifeq ($(PLATFORM), solaris)
  ifeq ($(ARCH_DATA_MODEL), 64)
    INITIAL_IMAGE_JRE=initial-image-jre-sol64
    INITIAL_IMAGE_JDK=initial-image-jdk-sol64
  endif
endif

images images-clobber \
initial-image-jre initial-image-jdk \
initial-image-jre-sol64 initial-image-jdk-sol64 \
trim-image-jre trim-image-jdk \
234
identify-image-jre identify-image-jdk \
D
duke 已提交
235 236 237 238 239 240
process-image-jre process-image-jdk \
compare-image \
sec-files sec-files-win jgss-files ::
	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."

# Order is important here, trim jre after jdk image is created
241 242 243 244 245 246 247 248 249 250
ifeq ($(PLATFORM), macosx)

images:: sanity-images post-sanity-images  \
	 $(INITIAL_IMAGE_JRE) $(EXTRA_JRE_TARGETS) $(INITIAL_IMAGE_JDK) \
	 trim-image-jre trim-image-jdk \
     identify-image-jre identify-image-jdk \
	 process-image-jre process-image-jdk sec-files sec-files-win jgss-files \
	 $(EXTRA_IMAGE_TARGETS)
else

D
duke 已提交
251 252 253
images:: sanity-images post-sanity-images  \
	 $(INITIAL_IMAGE_JRE) $(INITIAL_IMAGE_JDK) \
	 trim-image-jre trim-image-jdk \
254
         identify-image-jre identify-image-jdk \
255
	 process-image-jre process-image-jdk sec-files sec-files-win jgss-files
256
endif
D
duke 已提交
257 258

# Don't use these
259 260
image-jre:: initial-image-jre trim-image-jre identify-image-jre process-image-jre
image-jdk:: initial-image-jdk trim-image-jdk identify-image-jdk process-image-jdk
D
duke 已提交
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309

#
# Sources we ship in the SDK.
#
SOURCES = \
	java/applet			\
	java/awt			\
	java/beans			\
	java/io				\
	java/lang			\
	java/math			\
	java/net			\
	java/nio			\
	java/rmi			\
	java/security			\
	java/sql			\
	java/text			\
	java/util			\
	com/sun/corba			\
	com/sun/image/codec/jpeg	\
	com/sun/imageio                 \
	com/sun/java/swing		\
	com/sun/javadoc			\
	com/sun/jmx			\
	com/sun/source			\
	com/sun/naming			\
	com/sun/security/auth		\
	com/sun/security/jgss		\
	javax/accessibility		\
	javax/annotation		\
	javax/script			\
	javax/imageio			\
	javax/lang			\
	javax/management		\
	javax/naming			\
	javax/print			\
	javax/rmi			\
	javax/security			\
	javax/sound			\
	javax/sql			\
	javax/swing			\
	javax/tools			\
	javax/xml			\
	com/sun/org/apache		\
	com/sun/java_cup		\
	com/sun/jlex	        	\
	org/ietf			\
	org/omg				\
	org/w3c/dom			\
310
	org/xml/sax
D
duke 已提交
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
#
# Directories where sources may be found.  If a file with the same path
# name exists in more than one of these places, the one found last on this
# list wins.
#
SOURCE_DIRS = $(SHARE_SRC)/classes $(PLATFORM_SRC)/classes
SOURCE_DIRS += $(GENSRCDIR)
SOURCE_DIRS += $(IMPORTSRCDIR)
ifndef OPENJDK
  SOURCE_DIRS += $(CLOSED_SRC)/share/classes
endif


#
# Specific files and directories that will be filtered out from above areas.
#
327
SOURCE_FILTERs = $(SCM_DIRs) ',*'
D
duke 已提交
328 329 330 331 332 333 334 335 336 337 338 339 340 341
SOURCE_FILES_filter = $(SOURCE_FILTERs:%=-name % -prune -o)

#
# Bug 4249883 - excluding some unnecessary packages from com.sun.tools
#
# Bug 5008685 - exclude jconsole from sun/tools
#
TOOLS = \
	META-INF/services/com.sun.jdi.connect.Connector \
	META-INF/services/com.sun.jdi.connect.spi.TransportService \
	sun/tools/asm		\
	sun/tools/jar		\
	sun/tools/java		\
	sun/tools/javac		\
342
	sun/tools/jcmd		\
D
duke 已提交
343 344 345 346 347 348 349
	sun/tools/jps		\
	sun/tools/jstat		\
	sun/tools/jstatd	\
	sun/tools/native2ascii	\
	sun/tools/serialver	\
	sun/tools/tree		\
	sun/tools/util		\
350 351 352 353 354 355 356 357
	sun/security/tools/jarsigner/Main.class \
	sun/security/tools/jarsigner/JarSignerParameters.class \
	sun/security/tools/jarsigner/Resources.class \
	sun/security/tools/jarsigner/Resources_ja.class \
	sun/security/tools/jarsigner/Resources_zh_CN.class \
	sun/security/tools/jarsigner/SignatureFile\$$Block.class \
	sun/security/tools/jarsigner/SignatureFile.class \
	sun/security/tools/jarsigner/TimestampedSigner.class \
D
duke 已提交
358 359 360 361 362 363 364
	sun/rmi/rmic		\
	sun/applet		\
	sun/jvmstat		\
	com/sun/javadoc		\
	com/sun/jdi		\
	com/sun/jarsigner	\
	com/sun/source          \
365
	com/sun/tools/classfile \
D
duke 已提交
366
	com/sun/tools/doclets   \
J
jjg 已提交
367
	com/sun/tools/doclint   \
D
duke 已提交
368 369 370 371 372 373 374
	com/sun/tools/example/debug/expr \
	com/sun/tools/example/debug/tty  \
	com/sun/tools/extcheck  \
	com/sun/tools/hat       \
	com/sun/tools/javac     \
	com/sun/tools/javadoc   \
	com/sun/tools/javah     \
375
	com/sun/tools/javap     \
376
	com/sun/tools/jdeps     \
D
duke 已提交
377 378 379
	com/sun/tools/corba     \
	com/sun/tools/internal/xjc       \
	com/sun/tools/internal/ws       \
380 381
	META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
	META-INF/services/com.sun.tools.internal.xjc.Plugin \
D
duke 已提交
382
	com/sun/istack/internal/tools       \
383 384
	com/sun/tools/internal/jxc/ap   \
	com/sun/tools/internal/ws/wscompile/plugin/at_generated \
D
duke 已提交
385 386 387 388 389 390 391 392 393 394 395 396 397 398
        com/sun/codemodel       \
        com/sun/tools/internal/jxc             \
        com/sun/xml/internal/rngom       \
        com/sun/xml/internal/xsom       \
        org/relaxng/datatype   \
	com/sun/xml/internal/dtdparser \
	com/sun/tools/jdi	\
	com/sun/tools/script/shell	\
	META-INF/services/com.sun.tools.attach.spi.AttachProvider \
	com/sun/tools/attach	\
	sun/tools/attach	\
	sun/tools/jstack        \
	sun/tools/jinfo         \
	sun/tools/jmap
399

400 401 402
# classes that go into jfr.jar
JFR_CLASSES_DIRS= \
	com/oracle/jrockit/jfr \
403 404
	oracle/jrockit/jfr \
	jdk/jfr
405

D
duke 已提交
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459
# classes that go into jsse.jar
JSSE_CLASSES_DIRS = \
	sun/security/provider/Sun.class \
	sun/security/rsa/SunRsaSign.class \
	sun/security/ssl \
	com/sun/net/ssl/internal/ssl

# files under $(OUTPUTDIR) that need to go into sec-bin.zip for builds
# where the corresponding sources are not available
SEC_FILES_DIRS = \
	classes/javax/net \
	classes/javax/security/cert \
	classes/com/sun/net/ssl \
	classes/com/sun/security/cert \
	classes/sun/net/www/protocol/https \
	classes/sun/security/pkcs12 \
	classes/sun/security/ssl \
	classes/sun/security/krb5/*.class \
	classes/sun/security/krb5/internal/*.class \
	classes/sun/security/krb5/internal/ccache \
	classes/sun/security/krb5/internal/crypto \
	classes/sun/security/krb5/internal/ktab \
	classes/sun/security/krb5/internal/rcache \
	classes/sun/security/krb5/internal/util \
	classes/sun/security/jgss/spi/GSSContextSpi.class

# files under $(OUTPUTDIR) that need to go into sec-windows-win.zip for builds
# where the corresponding sources are not available
SEC_FILES_WIN_DIRS = \
	classes/sun/security/krb5/internal/tools

# files under $(BINDIR) that need to go into jgss_files.zip for builds
# where the corresponding sources are not available
JGSS_FILES_DIRS = \
	bin/w2k_lsa_auth.dll \
	bin/w2k_lsa_auth.map \
	bin/w2k_lsa_auth.pdb

# The following get removed from the SDK image.
NOTJDKTOOLS = \
	java_vm

# The following get removed from the JRE after the bulk-copy of BINDIR...
NOTJRETOOLS = \
	appletviewer$(EXE_SUFFIX) \
	extcheck$(EXE_SUFFIX) \
	idlj$(EXE_SUFFIX) \
	jar$(EXE_SUFFIX) \
	jarsigner$(EXE_SUFFIX) \
	java-rmi.cgi \
	javac$(EXE_SUFFIX) \
	javadoc$(EXE_SUFFIX) \
	javah$(EXE_SUFFIX) \
	javap$(EXE_SUFFIX) \
460
	jdeps$(EXE_SUFFIX) \
461
	jcmd$(EXE_SUFFIX) \
D
duke 已提交
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
	jdb$(EXE_SUFFIX) \
	jps$(EXE_SUFFIX) \
	jrunscript$(EXE_SUFFIX) \
	jstat$(EXE_SUFFIX) \
	jstatd$(EXE_SUFFIX) \
	jstack$(EXE_SUFFIX) \
	packagebean$(SCRIPT_SUFFIX) \
	rmic$(EXE_SUFFIX) \
	serialver$(EXE_SUFFIX) \
	unregbean$(EXE_SUFFIX) \
	jconsole$(EXE_SUFFIX) \
	jinfo$(EXE_SUFFIX) \
	jmap$(EXE_SUFFIX) \
	native2ascii$(EXE_SUFFIX) \
	xjc$(EXE_SUFFIX) \
	wsgen$(EXE_SUFFIX) \
	wsimport$(EXE_SUFFIX) \
        schemagen$(EXE_SUFFIX) \
	jsadebugd$(EXE_SUFFIX) \
	jhat$(EXE_SUFFIX)

# The following get removed from the JRE after the bulk-copy of LIBDIR...
NOTJRELIBS = tools.jar \
        jconsole.jar

ifeq ($(INCLUDE_SA), true)
  NOTJRELIBS += sa-jdi.jar

  # The following get removed from the JRE after the bulk-copy of LIBDIR...
  NOTJRE_SHARED_LIBS = $(SALIB_NAME)
else
  NOTJRE_SHARED_LIBS =
endif

# Attach library is JDK only
NOTJRE_SHARED_LIBS += $(LIB_PREFIX)attach.$(LIBRARY_SUFFIX)

#
###### RULES

# Processing license files from source area to image area
#    These will be modified to have the platform specific EOL chars.
define process-doc-file
$(prep-target)
$(SED) 's/$$//g' $< > $@
$(CHMOD) 444 $@
endef

# JDK files
$(JDK_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%
	$(process-doc-file)

514 515 516 517 518 519
$(JDK_IMAGE_DIR)/demo/DEMOS_LICENSE: $(SHARE_JDK_DOC_SRC)/DEMOS_LICENSE
	$(process-doc-file)

$(JDK_IMAGE_DIR)/sample/SAMPLES_LICENSE: $(SHARE_JDK_DOC_SRC)/SAMPLES_LICENSE
	$(process-doc-file)

520
# JRE files
D
duke 已提交
521 522
$(JRE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%
	$(process-doc-file)
523 524
ifeq ($(PLATFORM), windows)
$(JRE_IMAGE_DIR)/README.txt: $(SHARE_JRE_DOC_SRC)/README
D
duke 已提交
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
	$(process-doc-file)
endif

# Differences tool
DIRDIFF_JARFILE = $(BUILDTOOLJARDIR)/dirdiff.jar

######################################################
# List of directories in classes directory that should NOT be in rt.jar
######################################################

NOT_RT_JAR_LIST = $(ABS_TEMPDIR)/not_rt_jar.list

$(NOT_RT_JAR_LIST): FRC
	$(prep-target)
	$(ECHO) "#\n" >> $@
	$(ECHO) "# List of subdirectories not in include in rt.jar" >> $@
	$(ECHO) "# Directories must contain trailing '/'." >> $@
	$(ECHO) "com/sun/javadoc/" >> $@
	$(ECHO) "com/sun/jdi/" >> $@
	$(ECHO) "com/sun/jarsigner/" >> $@
	$(ECHO) "com/sun/source/" >> $@
	$(ECHO) "com/sun/istack/internal/tools/" >> $@
	$(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@
	$(ECHO) "META-INF/services/com.sun.jdi.connect.spi.TransportService" >> $@
	$(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@
	$(ECHO) "com/sun/tools/" >> $@
	$(ECHO) "sun/jvmstat/" >> $@
552 553
	$(ECHO) "sun/nio/cs/ext/" >> $@
	$(ECHO) "sun/awt/HKSCS.class" >> $@
554 555
	$(ECHO) "sun/awt/motif/X11GB2312\$$Decoder.class" >> $@
	$(ECHO) "sun/awt/motif/X11GB2312\$$Encoder.class" >> $@
556
	$(ECHO) "sun/awt/motif/X11GB2312.class" >> $@
557
	$(ECHO) "sun/awt/motif/X11GBK\$$Encoder.class" >> $@
558
	$(ECHO) "sun/awt/motif/X11GBK.class" >> $@
559 560
	$(ECHO) "sun/awt/motif/X11KSC5601\$$Decoder.class" >> $@
	$(ECHO) "sun/awt/motif/X11KSC5601\$$Encoder.class" >> $@
561
	$(ECHO) "sun/awt/motif/X11KSC5601.class" >> $@
D
duke 已提交
562 563 564 565
	$(ECHO) "sun/rmi/rmic/" >> $@
	$(ECHO) "sun/tools/asm/" >> $@
	$(ECHO) "sun/tools/java/" >> $@
	$(ECHO) "sun/tools/javac/" >> $@
566 567
	$(ECHO) "com/sun/tools/classfile/" >> $@
	$(ECHO) "com/sun/tools/javap/" >> $@
568
	$(ECHO) "com/sun/tools/jdeps/" >> $@
569
	$(ECHO) "sun/tools/jcmd/" >> $@
D
duke 已提交
570 571 572 573 574 575 576 577
	$(ECHO) "sun/tools/jconsole/" >> $@
	$(ECHO) "sun/tools/jps/" >> $@
	$(ECHO) "sun/tools/jstat/" >> $@
	$(ECHO) "sun/tools/jstatd/" >> $@
	$(ECHO) "sun/tools/native2ascii/" >> $@
	$(ECHO) "sun/tools/serialver/" >> $@
	$(ECHO) "sun/tools/tree/" >> $@
	$(ECHO) "sun/tools/util/" >> $@
578 579 580 581 582 583 584 585
	$(ECHO) "sun/security/tools/jarsigner/Main.class" >> $@
	$(ECHO) "sun/security/tools/jarsigner/JarSignerParameters.class" >> $@
	$(ECHO) "sun/security/tools/jarsigner/Resources.class" >> $@
	$(ECHO) "sun/security/tools/jarsigner/Resources_ja.class" >> $@
	$(ECHO) "sun/security/tools/jarsigner/Resources_zh_CN.class" >> $@
	$(ECHO) "sun/security/tools/jarsigner/SignatureFile\$$Block.class" >> $@
	$(ECHO) "sun/security/tools/jarsigner/SignatureFile.class" >> $@
	$(ECHO) "sun/security/tools/jarsigner/TimestampedSigner.class" >> $@
D
duke 已提交
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604
	$(ECHO) "sun/security/provider/Sun.class" >> $@
	$(ECHO) "sun/security/rsa/SunRsaSign.class" >> $@
	$(ECHO) "sun/security/ssl/" >> $@
	$(ECHO) "com/sun/net/ssl/internal/ssl/" >> $@
	$(ECHO) "javax/crypto/" >> $@
	$(ECHO) "sun/security/internal/" >> $@
	$(ECHO) "com/sun/crypto/provider/" >> $@
	$(ECHO) "META-INF/services/com.sun.tools.attach.spi.AttachProvider" >> $@
	$(ECHO) "com/sun/tools/attach/" >> $@
	$(ECHO) "org/relaxng/datatype/" >> $@
	$(ECHO) "com/sun/codemodel/" >> $@
	$(ECHO) "com/sun/xml/internal/dtdparser/" >> $@
	$(ECHO) "com/sun/xml/internal/rngom/" >> $@
	$(ECHO) "com/sun/xml/internal/xsom/" >> $@
	$(ECHO) "com/sun/tools/script/shell/" >> $@
	$(ECHO) "sun/tools/attach/" >> $@
	$(ECHO) "sun/tools/jstack/" >> $@
	$(ECHO) "sun/tools/jinfo/" >> $@
	$(ECHO) "sun/tools/jmap/" >> $@
605 606 607 608 609 610 611 612 613 614 615
ifndef OPENJDK
ifndef JAVASE_EMBEDDED
	$(ECHO) "com/oracle/jrockit/jfr/" >> $@
	$(ECHO) "com/oracle/jrockit/jfr/client/" >> $@
	$(ECHO) "com/oracle/jrockit/jfr/management/" >> $@
	$(ECHO) "oracle/jrockit/jfr/" >> $@
	$(ECHO) "oracle/jrockit/jfr/events/" >> $@
	$(ECHO) "oracle/jrockit/jfr/openmbean/" >> $@
	$(ECHO) "oracle/jrockit/jfr/parser/" >> $@
	$(ECHO) "oracle/jrockit/jfr/settings/" >> $@
	$(ECHO) "oracle/jrockit/jfr/tools/" >> $@
616
	$(ECHO) "jdk/jfr/" >> $@
617 618
endif
endif
D
duke 已提交
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642


# File order list for rt.jar
#     - sun.applet is included, till hotjava stops relying on it.
#     - sun.tools.jar is included, needs cleanup.
#
REORDER_TEMPDIR=$(ABS_TEMPDIR)/reorder
TOTAL_JAR_FILELIST=$(REORDER_TEMPDIR)/file_list

JARFILELISTS_TEMPDIR=$(ABS_TEMPDIR)/jarfilelists
RT_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/rt_jar_list
RES_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/resources_jar_list

JARREORDER_JARFILE = $(ABS_BUILDTOOLJARDIR)/jarreorder.jar

$(TOTAL_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_RT_JAR_LIST)
	$(prep-target)
	$(RM) $@.temp
	($(CD) $(CLASSBINDIR) && \
	    $(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
		-o  $@.temp $(ABS_LIBDIR)/classlist $(NOT_RT_JAR_LIST) . )
	$(MV) $@.temp $@
	@($(CD) $(CLASSBINDIR) && $(java-vm-cleanup))

643
# Create jfr.jar
644 645 646 647 648 649 650 651 652 653 654 655 656
JFR_JAR=
ifndef OPENJDK
ifndef JAVASE_EMBEDDED
JFR_JAR=$(ABS_TEMPDIR)/jfr-orig.jar
$(JFR_JAR): $(OTHER_JAR_MANIFEST_FILE)
	$(prep-target)
	$(CD) $(CLASSBINDIR) && \
	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(OTHER_JAR_MANIFEST_FILE) $@ \
		$(JFR_CLASSES_DIRS) $(BOOT_JAR_JFLAGS)
	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
endif
endif

D
duke 已提交
657 658 659 660 661 662 663 664 665 666 667 668 669 670
# Create the rt.jar file list & non-class files list

JARSPLIT_JARFILE = $(BUILDTOOLJARDIR)/jarsplit.jar

$(RT_JAR_FILELIST) + $(RES_JAR_FILELIST): \
    $(TOTAL_JAR_FILELIST) $(JARSPLIT_JARFILE)
	@$(RM) $(RT_JAR_FILELIST) $(RES_JAR_FILELIST)
	$(MKDIR) -p $(JARFILELISTS_TEMPDIR)
	$(BOOT_JAVA_CMD) -jar $(JARSPLIT_JARFILE) \
		$(TOTAL_JAR_FILELIST) \
		-o  $(RT_JAR_FILELIST) $(RES_JAR_FILELIST)
	@$(java-vm-cleanup)

# Create the manifest file.
671 672
RT_JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/rt_manifest.tmp
$(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
D
duke 已提交
673
	$(prep-target)
674 675 676
	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
	       $(MAINMANIFEST) >> $@
D
duke 已提交
677 678 679
	$(ECHO) >> $@
	$(CAT) $(BEANMANIFEST) >> $@

680 681 682 683 684 685 686
OTHER_JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/other_manifest.tmp
$(OTHER_JAR_MANIFEST_FILE): $(MAINMANIFEST)
	$(prep-target)
	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
	       $(MAINMANIFEST) >> $@

D
duke 已提交
687
# Create resources.jar containing non-class files
688
RESOURCES_JAR=$(ABS_TEMPDIR)/resources-orig.jar
689
$(RESOURCES_JAR): $(RES_JAR_FILELIST) $(OTHER_JAR_MANIFEST_FILE)
D
duke 已提交
690
	$(prep-target)
691
	$(CD) $(CLASSBINDIR) && \
692
	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(OTHER_JAR_MANIFEST_FILE) $@ \
693 694
	        @$(RES_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
D
duke 已提交
695 696

# Create jsse.jar containing SunJSSE implementation classes
697
JSSE_JAR=$(ABS_TEMPDIR)/jsse-orig.jar
698
$(JSSE_JAR): $(OTHER_JAR_MANIFEST_FILE)
D
duke 已提交
699
	$(prep-target)
700
	$(CD) $(CLASSBINDIR) && \
701
	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(OTHER_JAR_MANIFEST_FILE) $@ \
702 703
		$(JSSE_CLASSES_DIRS) $(BOOT_JAR_JFLAGS)
	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
D
duke 已提交
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744

# Create sec-bin.zip
SEC_FILES_ZIP=$(ABS_TEMPDIR)/sec-bin.zip
sec-files::
	$(prep-target)
	$(RM) $(SEC_FILES_ZIP)
	$(CD) $(OUTPUTDIR) && \
		$(ZIPEXE) -rq9 $(SEC_FILES_ZIP) $(SEC_FILES_DIRS)
	@$(java-vm-cleanup)

# Create sec-windows-bin.zip
SEC_FILES_WIN_ZIP=$(ABS_TEMPDIR)/sec-windows-bin.zip
sec-files-win::
ifeq ($(PLATFORM), windows)
	$(prep-target)
	$(RM) $(SEC_FILES_WIN_ZIP)
	$(CD) $(OUTPUTDIR) && \
		$(ZIPEXE) -rq9 $(SEC_FILES_WIN_ZIP) $(SEC_FILES_WIN_DIRS)
	@$(java-vm-cleanup)
endif

# Create JGSS files that contains the native Kerberos library
JGSS_WIN32_FILES_ZIP=$(ABS_TEMPDIR)/jgss-windows-i586-bin.zip
JGSS_WIN64_FILES_ZIP=$(ABS_TEMPDIR)/jgss-windows-x64-bin.zip
jgss-files::
ifeq ($(PLATFORM), windows)
	$(prep-target)
  ifeq ($(ARCH_DATA_MODEL), 32)
	$(RM) $(JGSS_WIN32_FILES_ZIP)
	$(CD) $(OUTPUTDIR) && \
		$(ZIPEXE) -rq9 $(JGSS_WIN32_FILES_ZIP) $(JGSS_FILES_DIRS)
  else
	$(RM) $(JGSS_WIN64_FILES_ZIP)
	$(CD) $(OUTPUTDIR) && \
		$(ZIPEXE) -rq9 $(JGSS_WIN64_FILES_ZIP) $(JGSS_FILES_DIRS)
  endif
	@$(java-vm-cleanup)
endif

# Create rt.jar
RT_JAR=$(ABS_TEMPDIR)/rt-orig.jar
745
$(RT_JAR): $(RT_JAR_FILELIST) $(RT_JAR_MANIFEST_FILE)
D
duke 已提交
746
	$(prep-target)
747
	$(CD) $(CLASSBINDIR) && \
748
	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(RT_JAR_MANIFEST_FILE) $@ \
749 750
	        @$(RT_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
D
duke 已提交
751 752 753 754 755 756 757 758 759 760 761 762 763 764

# Meta-index construction to make core class loaders lazier

BUILDMETAINDEX_JARFILE = $(ABS_BUILDTOOLJARDIR)/buildmetaindex.jar

######################################################
# JRE Image
######################################################

initial-image-jre-setup:
	$(RM) -r $(JRE_IMAGE_DIR)
	$(MKDIR) -p $(JRE_IMAGE_DIR)

# 64-bit solaris jre image contains only the 64-bit add-on files.
765
initial-image-jre-sol64:: initial-image-jre-setup
D
duke 已提交
766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782
	@# Use tar instead of cp to preserve the symbolic links
	for dir in bin lib ; do \
	  ( $(CD) $(OUTPUTDIR) && \
		$(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \
		($(CD) $(JRE_IMAGE_DIR) && $(TAR) xf -) ) ; \
	done
	@# Remove some files from the jre area
	for t in $(NOTJRETOOLS) ; do \
	    $(RM) $(JRE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
	done
	for l in $(NOTJRELIBS) ; do \
	    $(RM) $(JRE_IMAGE_DIR)/lib/$$l ; \
	done
	$(RM) `$(FIND) $(JRE_IMAGE_DIR)/lib -name 'orb.idl'`
	$(RM) `$(FIND) $(JRE_IMAGE_DIR)/lib -name 'ir.idl'`

# Construct an initial jre image (initial jdk jre) no trimming or stripping
783 784
# See "initial-image-jdk-setup" for an explanation of the rm of
# drive names like C:
D
duke 已提交
785
initial-image-jre:: initial-image-jre-setup \
786
		    $(JRE_DOCFILES) \
787
		    $(RT_JAR) $(RESOURCES_JAR) $(JSSE_JAR) $(JFR_JAR) \
D
duke 已提交
788 789
		    $(BUILDMETAINDEX_JARFILE)
	@# Copy in bin directory
790 791 792 793
ifeq ($(USING_MSYS),true)
        # No cpio in MinGW/MSYS
	$(CD) $(OUTPUTDIR) && $(TAR) -cf - bin | ($(CD) $(JRE_IMAGE_DIR) && $(TAR) -xpf -)
else
D
duke 已提交
794
	$(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR)
795
endif
D
duke 已提交
796 797 798
	@# CTE plugin security change require new empty directory lib/applet
	$(MKDIR) -p $(JRE_IMAGE_DIR)/lib/applet
	@# Copy in lib directory
799 800 801 802
ifeq ($(USING_MSYS),true)
        # No cpio in MinGW/MSYS
	$(CD) $(OUTPUTDIR) && $(TAR) -cf - lib | ($(CD) $(JRE_IMAGE_DIR) && $(TAR) -xpf -)
else
D
duke 已提交
803
	$(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR)
804 805
endif

806 807 808 809
  ifeq ($(USING_CYGWIN),true)
	  $(RM) -rf $(JRE_IMAGE_DIR)/[A-Za-z]:
	  $(RM) -rf $(OUTPUTDIR)/[A-Za-z]:
  endif
D
duke 已提交
810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825
	@# Make sure all directories are read/execute for everyone
	$(CHMOD) a+rx `$(FIND) $(JRE_IMAGE_DIR) -type d`
	@# Remove some files from the jre area
	for t in $(NOTJRETOOLS) ; do \
	    $(RM) $(JRE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
	done
	for l in $(NOTJRELIBS) ; do \
	    $(RM) $(JRE_IMAGE_DIR)/lib/$$l ; \
	done
	@# Remove orb.idl and ir.idl from jre
	$(FIND) $(JRE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \;
	$(FIND) $(JRE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \;
	@# Copy in rt.jar & resources.jar file
	$(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
	$(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
	$(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
826 827 828
ifneq ($(JFR_JAR),)
	$(CP) $(JFR_JAR) $(JRE_IMAGE_DIR)/lib/jfr.jar
endif
D
duke 已提交
829 830 831 832 833 834 835 836 837 838 839 840 841
	@# Generate meta-index to make boot and extension class loaders lazier
	$(CD) $(JRE_IMAGE_DIR)/lib && \
	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
		-o meta-index *.jar
	@$(CD) $(JRE_IMAGE_DIR)/lib && $(java-vm-cleanup)
	$(CD) $(JRE_IMAGE_DIR)/lib/ext && \
	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
		-o meta-index *.jar
	@$(CD) $(JRE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup)
ifeq ($(PLATFORM), windows)
	@# Remove certain *.lib files
	$(CD) $(JRE_IMAGE_DIR)/lib && \
            $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \
A
alanb 已提交
842
                  awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX)
843 844 845 846 847
  ifeq ($(ARCH_DATA_MODEL), 32)
	@# The Java Kernel JRE image ships with a special VM.  It is not included
	@# in the full JRE image, so remove it.  Also, is it only for 32-bit windows.
	$(CD) $(JRE_IMAGE_DIR)/bin && $(RM) -r kernel
  endif
D
duke 已提交
848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875
endif # Windows
ifneq ($(PLATFORM), windows)
	$(call copy-man-pages,$(JRE_IMAGE_DIR),$(JRE_MAN_PAGES))
endif # !windows

# Trim out any extra files not for the jre shipment but wanted in the jdk jre.
#   (Note the jdk WILL want the jre image before this trimming)
#   Removes server VM on Windows 32bit.
#   Remove certain shared libraries that should not be in the jre image
#      but should be in the jdk jre image.
trim-image-jre::
ifeq ($(PLATFORM), windows)
  ifeq ($(ARCH_DATA_MODEL), 32)
	$(RM) -r $(JRE_IMAGE_DIR)/bin/server
  endif
  ifdef NOTJRE_SHARED_LIBS
	for l in $(NOTJRE_SHARED_LIBS) ; do \
	    $(RM) $(JRE_IMAGE_DIR)/bin/$$l ; \
	done ;
  endif
else # PLATFORM
  ifdef NOTJRE_SHARED_LIBS
	for l in $(NOTJRE_SHARED_LIBS) ; do \
	    $(RM) $(JRE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \
	done ;
  endif
endif # PLATFORM

876 877 878
# Get list of all binary (COFF or Elf) files in the jre
JRE_BIN_LIST=$(TEMPDIR)/jre-bin-files.list
$(JRE_BIN_LIST):
D
duke 已提交
879
	$(RM) $@
880 881 882 883
ifeq ($(PLATFORM), windows)
	$(FIND) $(JRE_IMAGE_DIR)/bin -type f -name \*.exe \
	   -o -name \*.dll | $(EGREP) -v -i "$(MSVCRNN_DLL)" > $@
else
D
duke 已提交
884
	$(FIND) $(JRE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@
D
dcubed 已提交
885 886 887
# The FILE command reports .debuginfo files as "ELF", but we don't want
# those files in the JRE_BIN_LIST file. EXE_SUFFIX is empty on non-Windows.
	$(FILE) `$(FIND) $(JRE_IMAGE_DIR)/bin -type f ! -name '*.debuginfo' -name \*$(EXE_SUFFIX)` \
D
duke 已提交
888 889 890 891 892
	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
endif

# Post process the image (strips and mcs on Elf files we are shipping)
#   (Note the jdk WILL want the jre image before this processing)
893
process-image-jre:: $(JRE_BIN_LIST)
D
duke 已提交
894
ifneq ($(POST_STRIP_PROCESS), )
895
	@for f in `$(CAT) $(JRE_BIN_LIST)`; do \
D
duke 已提交
896 897 898 899 900 901 902
	  $(CHMOD) u+w $${f}; \
	  $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
	  $(POST_STRIP_PROCESS) $${f}; \
	  $(CHMOD) go-w $${f}; \
	done
endif
ifneq ($(POST_MCS_PROCESS), )
903
	@for f in `$(CAT) $(JRE_BIN_LIST)`; do \
D
duke 已提交
904 905 906 907 908 909
	  $(CHMOD) u+w $${f}; \
	  $(ECHO) $(POST_MCS_PROCESS) $${f}; \
	  $(POST_MCS_PROCESS) $${f}; \
	  $(CHMOD) go-w $${f}; \
	done
endif
910 911 912 913
	@for f in `$(CAT) $(JRE_BIN_LIST)`; do \
	  $(call binary_file_verification,$${f}); \
	done
	$(RM) $(JRE_BIN_LIST)
D
duke 已提交
914 915 916 917 918 919

######################################################
# JDK Image
######################################################
# Note: cpio ($(CPIO)) sometimes leaves directories without rx access.

920 921 922 923 924 925 926 927 928 929 930 931
# REMIND: the $(RM) calls for patterns like c:, d: following $(CPIO)
# are because the 1.7.x versions of cygwin's cpio command drops these
# in the working directory if the output path begins with that pattern
# The one for the output jre subdirectory gets there because cpio sees its
# own dropping in the input jre subdirectory. Need to remove both of these.
# We can remove these RM's if someone figures out how to stop cpio from
# leaving these there.
# Note that its a real problem not because this directory can end up in the
# bundle (I think it won't since it not in bin or lib and those are the
# only places from which we copy everything), but because the presence
# of this file causes cygwin's find to bomb out, thus breaking the build
# in "install".
932

D
duke 已提交
933 934 935
initial-image-jdk-setup:
	$(RM) -r $(JDK_IMAGE_DIR)
	$(MKDIR) -p $(JDK_IMAGE_DIR)/jre
936 937 938 939
ifeq ($(USING_MSYS),true)
	($(CD) $(JRE_IMAGE_DIR) && $(TAR) -cf - . \
	      | ($(CD) $(JDK_IMAGE_DIR)/jre && $(TAR) -xpf -))
else
D
duke 已提交
940 941
	($(CD) $(JRE_IMAGE_DIR) && $(FIND) . -depth -print \
	      | $(CPIO) -pdum $(JDK_IMAGE_DIR)/jre )
942
endif
943 944 945 946
  ifeq ($(USING_CYGWIN),true)
	  $(RM) -rf $(JRE_IMAGE_DIR)/[A-Za-z]:
	  $(RM) -rf $(JDK_IMAGE_DIR)/jre/[A-Za-z]:
  endif
D
duke 已提交
947 948 949 950 951 952 953 954 955 956 957 958
	$(RM) -rf $(JDK_IMAGE_DIR)/jre/man
	$(CHMOD) a+rx `$(FIND) $(JDK_IMAGE_DIR) -type d`

initial-image-jdk64-bindemos:
	for dir in bin demo ; do \
	  ( $(CD) $(OUTPUTDIR) && \
		$(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \
		($(CD) $(JDK_IMAGE_DIR) && $(TAR) xf -) ) ; \
        done

# Solaris 64 bit image is special
initial-image-jdk-sol64:: initial-image-jdk-setup \
959
			  initial-image-jdk64-bindemos
D
duke 已提交
960 961 962 963 964 965 966 967 968 969

# DB files to add
ifdef OPENJDK

initial-image-jdk-db:

else

# Create the list of db *.zip files to bundle with jdk
ABS_DB_PATH  :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
970
DB_BINARY_BUNDLE = $(shell $(LS) $(ABS_DB_PATH)/db-derby-*-bin.zip 2>/dev/null)
D
duke 已提交
971

972 973
# Java DB image. Move the Java DB demo directory into the JDK's demo
# dir and in the process, rename it to db.  Also remove index.html,
974 975 976
# since it presumes docs are co-located, javadoc, docs and tests and
# update the copyright year of the JDK READMEs to that of the release.
initial-image-jdk-db: $(DB_BINARY_BUNDLE)
D
duke 已提交
977
	$(MKDIR) -p $(JDK_IMAGE_DIR)/db
978 979 980 981 982 983 984 985 986
	$(CD) $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $(DB_BINARY_BUNDLE)
	$(CD) $(JDK_IMAGE_DIR)/db && $(MV) db-derby-*-bin/* .
	$(CD) $(JDK_IMAGE_DIR)/db && $(RM) -r db-derby-*-bin
	$(CAT) $(ABS_DB_PATH)/README-JDK.html  | \
		$(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > \
		$(JDK_IMAGE_DIR)/db/README-JDK.html
	$(CAT) $(ABS_DB_PATH)/3RDPARTY  | \
		$(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > \
		$(JDK_IMAGE_DIR)/db/3RDPARTY
987
ifndef NO_DEMOS
988
	$(RM) -r $(DEMODIR)/db
989
	$(MV) $(JDK_IMAGE_DIR)/db/demo $(DEMODIR)/db
990 991 992
	$(CAT) $(ABS_DB_PATH)/README-JDK-DEMOS.html  | \
		$(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > \
		$(DEMODIR)/db/README-JDK-DEMOS.html
993
else
994
	$(RM) -r $(JDK_IMAGE_DIR)/db/demo
995
endif
996 997 998
	@# remove stuff from original distro we don't want
	$(RM) $(JDK_IMAGE_DIR)/db/index.html $(JDK_IMAGE_DIR)/db/KEYS
	$(RM) -r $(JDK_IMAGE_DIR)/db/{docs,javadoc,test}
D
duke 已提交
999 1000
endif

1001 1002 1003 1004
# The launcher source files we need for src.zip
FILES_launcher = $(wildcard $(SHARE_SRC)/bin/*) \
                 $(wildcard $(PLATFORM_SRC)/bin/java_md*)

D
duke 已提交
1005 1006 1007
# Standard jdk image
initial-image-jdk:: initial-image-jdk-setup \
		    initial-image-jdk-db \
1008 1009
		    $(JDK_DOCFILES) \
		    $(JDK_DEMOS_AND_SAMPLES_DOCFILES)
D
duke 已提交
1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031
	$(MKDIR) $(JDK_IMAGE_DIR)/lib
	@#
	@# Copy in the jars in lib that only belong in the JDK
	@#
	for l in $(NOTJRELIBS); do \
	    if [ -r $(LIBDIR)/$$l ]; then \
	        $(CP) $(LIBDIR)/$$l $(JDK_IMAGE_DIR)/lib; \
	    fi; \
	done
  ifeq ($(PLATFORM), windows)
	@#
	@# lib/
	@#
	$(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_IMAGE_DIR)/lib
	$(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_IMAGE_DIR)/lib
	@#
	@# bin/
	@#
	@# copy all EXE files and only certain DLL files from BINDIR
	$(MKDIR) -p $(JDK_IMAGE_DIR)/bin
	$(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_IMAGE_DIR)/bin
	$(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
1032 1033 1034
    ifeq ($(COMPILER_VERSION), VS2010)
	$(CP) $(BINDIR)/msvc*100.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
    endif
D
duke 已提交
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045
  else # PLATFORM
	@#
	@# bin/
	@#
	($(CD) $(BINDIR)/.. && $(TAR) cf - \
	    `$(FIND) bin \( -type f -o -type l \) -print `) | \
	    ($(CD) $(JDK_IMAGE_DIR) && $(TAR) xf -)
  endif # PLATFORM
	@#
	@# files that might not exist need to be touched.
	@#
1046
	$(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.internal.xjc.Plugin
D
duke 已提交
1047 1048 1049
	@#
	@# lib/tools.jar
	@#
1050
	$(CD) $(CLASSBINDIR) && \
1051
	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(ABS_LIBDIR)/tools.jar \
1052 1053
	        $(TOOLS) $(BOOT_JAR_JFLAGS)
	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
D
duke 已提交
1054 1055 1056 1057 1058 1059 1060 1061 1062
	$(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar
	@#
	@# lib/ct.sym
	@#
	$(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym
	$(JAVAC_CMD) -XDprocess.packages -proc:only \
	    -processor com.sun.tools.javac.sym.CreateSymbols \
	    -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
	    -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
1063
	    -Acom.sun.tools.javac.sym.Profiles=$(JDK_TOPDIR)/makefiles/profile-rtjar-includes.txt \
1064
	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
1065
	$(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(LIBDIR)/ct.sym \
1066
	    -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
D
duke 已提交
1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091
	@$(java-vm-cleanup)
	$(CP) $(LIBDIR)/ct.sym $(JDK_IMAGE_DIR)/lib/ct.sym
	@#
	@# CORBA supported orb.idl and ir.idl should be copied to lib
	@#
	$(CP) $(LIBDIR)/orb.idl $(JDK_IMAGE_DIR)/lib/orb.idl
	$(CP) $(LIBDIR)/ir.idl $(JDK_IMAGE_DIR)/lib/ir.idl
  ifeq ($(PLATFORM), linux)
	@#
	@# on Linux copy jexec from jre/lib to /lib
	@#
	$(CP) $(LIBDIR)/jexec $(JDK_IMAGE_DIR)/lib/jexec
  endif # PLATFORM
	@#
	@# src.zip
	@#
	$(MKDIR) -p $(JDK_IMAGE_DIR)/src
	@#
	@# The '*-*' pattern in the find command excludes files named with dashes,
	@# such as the java.nio templates for generated classes
	@#
	@# The Linux 'tar' command cannot handle the huge command line argument
	@# generated by the more efficient solaris/windows method of copying files.
	@# So for Linux, make use of the -T option (like Solaris' -I option) of
	@# obtaining the list of files from a file. MKS tar has no such option.
1092 1093

  ifneq (,$(findstring $(PLATFORM), linux macosx))
D
duke 已提交
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
	for d in $(SOURCE_DIRS); do \
	  $(RM) $(ABS_TEMPDIR)/src-files.list; \
	  ($(CD) $$d &&  \
	    for sd in $(SOURCES) ; do \
              if [ -d $$sd ] ; then \
	        $(FIND) $$sd $(SOURCE_FILES_filter) \
		        -name '*.java' -print \
		        >> $(ABS_TEMPDIR)/src-files.list ; \
	      fi; \
	    done ; \
	  ) ; \
	  if [ -f  $(ABS_TEMPDIR)/src-files.list ] ; then \
	    ($(CD) $$d && $(TAR) cf - -T $(ABS_TEMPDIR)/src-files.list ) \
	       | ($(CD) $(JDK_IMAGE_DIR)/src && $(TAR) xf -); \
	  fi; \
	done
  else
	for d in $(SOURCE_DIRS); do \
	  $(RM) $(ABS_TEMPDIR)/src-files.list; \
	  ($(CD) $$d && \
	    for sd in $(SOURCES) ; do \
              if [ -d $$sd ] ; then \
	        $(FIND) $$sd $(SOURCE_FILES_filter) \
		        -name '*.java' -print \
		        >> $(ABS_TEMPDIR)/src-files.list ; \
	      fi; \
	    done ; \
	  ) ; \
	  if [ -f  $(ABS_TEMPDIR)/src-files.list ] ; then \
	    ($(CD) $$d && $(TAR) cf - `$(CAT) $(ABS_TEMPDIR)/src-files.list`) \
	      | ($(CD) $(JDK_IMAGE_DIR)/src && $(TAR) xf -); \
	  fi; \
	done
  endif
	$(RM) $(ABS_TEMPDIR)/src-files.list
	$(CHMOD) -R +w $(JDK_IMAGE_DIR)/src
	$(MKDIR) -p $(JDK_IMAGE_DIR)/src/launcher
1131
	$(CP) $(FILES_launcher) $(JDK_IMAGE_DIR)/src/launcher
D
duke 已提交
1132 1133 1134 1135 1136
	$(CD) $(JDK_IMAGE_DIR)/src && $(ZIPEXE) -qr ../src.zip *
	$(RM) -r $(JDK_IMAGE_DIR)/src
	@#
	@# demo, include
	@#
1137
ifndef NO_DEMOS
D
duke 已提交
1138
	$(CP) -r -f $(DEMODIR) $(JDK_IMAGE_DIR)
1139 1140
endif
ifndef NO_SAMPLES
D
duke 已提交
1141
	$(CP) -r -f $(SAMPLEDIR) $(JDK_IMAGE_DIR)
1142
endif
D
duke 已提交
1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155
	$(CP) -r $(INCLUDEDIR) $(JDK_IMAGE_DIR)
	@#
	@# Swing BeanInfo generation
	@#
	$(CD) javax/swing/beaninfo && $(MAKE) swing-1.2-beans
ifneq ($(PLATFORM), windows)
	$(call copy-man-pages,$(JDK_IMAGE_DIR),$(JDK_MAN_PAGES))
endif # !windows

# Trim out files we don't want to ship
trim-image-jdk::
	@# Remove tools that should not be part of SDK.
	for t in $(NOTJDKTOOLS); do \
A
alanb 已提交
1156
	    $(RM) $(JDK_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX); \
D
duke 已提交
1157 1158
	done

1159 1160 1161 1162 1163 1164 1165 1166 1167
# Get list of binary (COFF or Elf) files in the jdk
JDK_BIN_LIST=$(TEMPDIR)/jdk-bin-files.list
$(JDK_BIN_LIST):
ifeq ($(PLATFORM), windows)
	$(FIND) $(JDK_IMAGE_DIR)/jre/bin -type f -name \*.exe \
	   -o -name \*.dll | $(EGREP) -v -i "$(MSVCRNN_DLL)" > $@
	$(FIND) $(JDK_IMAGE_DIR)/bin -type f -name \*.exe \
	   -o -name \*.dll | $(EGREP) -v -i "$(MSVCRNN_DLL)" >> $@
else
D
duke 已提交
1168 1169
	$(RM) $@
	$(FIND) $(JDK_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@
D
dcubed 已提交
1170 1171 1172
# The FILE command reports .debuginfo files as "ELF", but we don't want
# those files in the JDK_BIN_LIST file. EXE_SUFFIX is empty on non-Windows.
	$(FILE) `$(FIND) $(JDK_IMAGE_DIR)/jre/bin -type f ! -name '*.debuginfo' -name \*$(EXE_SUFFIX)` \
D
duke 已提交
1173
	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
D
dcubed 已提交
1174
	file `$(FIND) $(JDK_IMAGE_DIR)/bin -type f ! -name '*.debuginfo' -name \*$(EXE_SUFFIX)` \
D
duke 已提交
1175 1176 1177 1178
	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
endif

# Post process the image (strips and mcs on files we are shipping)
1179
process-image-jdk:: $(JDK_BIN_LIST)
D
duke 已提交
1180
ifneq ($(POST_STRIP_PROCESS), )
1181
	@for f in `$(CAT) $(JDK_BIN_LIST)`; do \
D
duke 已提交
1182 1183 1184 1185 1186 1187 1188
	  $(CHMOD) u+w $${f}; \
	  $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
	  $(POST_STRIP_PROCESS) $${f}; \
	  $(CHMOD) go-w $${f}; \
	done
endif
ifneq ($(POST_MCS_PROCESS), )
1189
	@for f in `$(CAT) $(JDK_BIN_LIST)`; do \
D
duke 已提交
1190 1191 1192 1193 1194 1195
	  $(CHMOD) u+w $${f}; \
	  $(ECHO) $(POST_MCS_PROCESS) $${f}; \
	  $(POST_MCS_PROCESS) $${f}; \
	  $(CHMOD) go-w $${f}; \
	done
endif
1196 1197 1198 1199
	@for f in `$(CAT) $(JDK_BIN_LIST)`; do \
	  $(call binary_file_verification,$${f}); \
	done
	$(RM) $(JDK_BIN_LIST)
D
duke 已提交
1200

1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211
###################################################################
# What did we build
###################################################################

# The jdk text info file that lives at the root of the install image.

JDK_INFO_FILE = $(JDK_IMAGE_DIR)/release
JRE_INFO_FILE = $(JRE_IMAGE_DIR)/release

# Common way to emit a line into the release or info file
define info-file-item # name value
1212
$(PRINTF) '%s="%s"\n' $1 $2 >> $@
1213 1214 1215 1216 1217 1218
endef

# Values to emit
MINIMUM_OS_NAME    := $(REQUIRED_OS_NAME)
MINIMUM_OS_VERSION := $(REQUIRED_OS_VERSION)
MINIMUM_OS_ARCH    := $(ARCH)
1219 1220 1221 1222
ALL_SOURCE_TIPS     = $(shell \
  if [ -f $(SOURCE_TIPS) ] ; then \
    $(CAT) $(SOURCE_TIPS) ; \
  fi)
1223 1224 1225 1226 1227 1228 1229

$(JDK_INFO_FILE): FRC
	$(prep-target)
	$(call info-file-item, "JAVA_VERSION", "$(THIS_JDK_VERSION)")
	$(call info-file-item, "OS_NAME",      "$(MINIMUM_OS_NAME)")
	$(call info-file-item, "OS_VERSION",   "$(MINIMUM_OS_VERSION)")
	$(call info-file-item, "OS_ARCH",      "$(MINIMUM_OS_ARCH)")
1230
	$(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
1231 1232 1233 1234 1235 1236 1237 1238 1239 1240

# Create release file to identify this image
identify-image-jdk:: $(JDK_INFO_FILE)

$(JRE_INFO_FILE): FRC
	$(prep-target)
	$(call info-file-item, "JAVA_VERSION", "$(THIS_JDK_VERSION)")
	$(call info-file-item, "OS_NAME",      "$(MINIMUM_OS_NAME)")
	$(call info-file-item, "OS_VERSION",   "$(MINIMUM_OS_VERSION)")
	$(call info-file-item, "OS_ARCH",      "$(MINIMUM_OS_ARCH)")
1241
	$(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
1242 1243 1244

# Create release file to identify this image
identify-image-jre:: $(JRE_INFO_FILE)
D
duke 已提交
1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275

###################################################################
# What do we compare against
###################################################################

# The temporary files and areas created
TEMP_PREV_JRE_BASE_DIR=$(TEMPDIR)/previous_jre
TEMP_PREV_JDK_BASE_DIR=$(TEMPDIR)/previous_jdk
TEMP_PREV_JRE_COMPARISON=$(TEMP_PREV_JRE_BASE_DIR)/previous_jre_comparison.txt
TEMP_PREV_JDK_COMPARISON=$(TEMP_PREV_JDK_BASE_DIR)/previous_jdk_comparison.txt
TEMP_PREV_JRE_IMAGE_DIR=$(TEMP_PREV_JRE_BASE_DIR)/jre$(PREVIOUS_JDK_VERSION)
TEMP_PREV_JDK_IMAGE_DIR=$(TEMP_PREV_JDK_BASE_DIR)/jdk$(PREVIOUS_JDK_VERSION)

# unbundle(sourcedir,bundlename,destdir)
#    logic is slightly different if a .tar.gz file (linux)
define unbundle
$(RM) -r $3
$(MKDIR) -p $3
$(CP) $1 $3
if [ "`$(BASENAME) $2 .gz`" != "$2" ] ; then \
  ( $(CD) $3 && ( $(GUNZIP) -dc $2 | $(TAR) xf - ) && $(RM) $2 ); \
else \
  ( $(CD) $3 && $(TAR) xf $2 && $(RM) $2 ); \
fi
( $(CD) $3 && $(RM) $2 )
endef

# In general, ignore the fastdebug tree, and changes in the demo and sample area
COMPARE_FILTER = | $(EGREP) -v /fastdebug/ | $(EGREP) -v /demo/ | $(EGREP) -v /sample/

# If a previuous image is provided, no need to install it.
1276
ifdef PREVIOUS_RELEASE_IMAGE
D
duke 已提交
1277 1278

  # Just use the pre-installed images
1279 1280
  PREV_JRE_IMAGE_DIR=$(PREVIOUS_RELEASE_IMAGE)/jre
  PREV_JDK_IMAGE_DIR=$(PREVIOUS_RELEASE_IMAGE)
D
duke 已提交
1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338

else

  # Use the temp images we will create
  PREV_JRE_IMAGE_DIR=$(TEMP_PREV_JRE_IMAGE_DIR)
  PREV_JDK_IMAGE_DIR=$(TEMP_PREV_JDK_IMAGE_DIR)

# Force the installation in this case
compare-image:: install-previous-sanity install-previous-jre install-previous-jdk

# Unbundle the jre
$(TEMP_PREV_JRE_IMAGE_DIR)/bin/java$(EXE_SUFFIX): $(PREVIOUS_JRE_BUNDLE)
	$(call unbundle,$(PREVIOUS_JRE_BUNDLE),$(PREVIOUS_JRE_FILE),$(TEMP_PREV_JRE_BASE_DIR))
	$(TOUCH) $@

# Unbundle the jdk
$(TEMP_PREV_JDK_IMAGE_DIR)/bin/java$(EXE_SUFFIX): $(PREVIOUS_JDK_BUNDLE)
	$(call unbundle,$(PREVIOUS_JDK_BUNDLE),$(PREVIOUS_JDK_FILE),$(TEMP_PREV_JDK_BASE_DIR))
	$(TOUCH) $@

endif

# Make sure all images have a java in them (used as the touch file)
install-previous-sanity:
	@if [ ! -f $(PREVIOUS_JRE_BUNDLE) ]; then \
          $(ECHO) "ERROR: You do not have access to the previous java release jre bundles. \n" \
            "      Please check your access to \n" \
            "          $(PREVIOUS_JRE_BUNDLE) \n" \
            "      and/or check your value of ALT_PREVIOUS_RELEASE_PATH or ALT_PREVIOUS_JRE_FILE \n" \
            "      This will affect you if you build the images target. \n" \
            "" >> $(ERROR_FILE) ; \
	fi
	@if [ ! -f $(PREVIOUS_JDK_BUNDLE) ]; then \
          $(ECHO) "ERROR: You do not have access to the previous java release sdk bundles. \n" \
          "      Please check your access to \n" \
          "          $(PREVIOUS_sdk_BUNDLE) \n" \
          "      and/or check your value of ALT_PREVIOUS_RELEASE_PATH or ALT_PREVIOUS_JDK_FILE. \n" \
          "      This will affect you if you build the images target. \n" \
          "" >> $(ERROR_FILE) ; \
	fi
install-previous-jre: $(PREV_JRE_IMAGE_DIR)/bin/java$(EXE_SUFFIX)
install-previous-jdk: $(PREV_JDK_IMAGE_DIR)/bin/java$(EXE_SUFFIX)

# Create the jre comparison report
$(TEMP_PREV_JRE_COMPARISON): install-previous-jre $(DIRDIFF_JARFILE)
	$(prep-target)
	$(BOOT_JAVA_CMD) -jar $(DIRDIFF_JARFILE) \
	   $(PREV_JRE_IMAGE_DIR) $(JRE_IMAGE_DIR) | $(SORT) > $@
	@$(java-vm-cleanup)

# Create the jdk comparison report
$(TEMP_PREV_JDK_COMPARISON): install-previous-jdk $(DIRDIFF_JARFILE)
	$(prep-target)
	$(BOOT_JAVA_CMD) -jar $(DIRDIFF_JARFILE) \
	   $(PREV_JDK_IMAGE_DIR) $(JDK_IMAGE_DIR) | $(SORT) > $@
	@$(java-vm-cleanup)

# Clean up names in the messages printed out
1339 1340
CAT_FILTER = $(SED) -e "s|$(JDK_IMAGE_DIR)|JDK_IMAGE|g" \
	            -e "s|$(JRE_IMAGE_DIR)|JRE_IMAGE|g"
D
duke 已提交
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398

# Report on the jre image comparison
compare-image-jre: $(TEMP_PREV_JRE_COMPARISON)
	@$(ECHO) "JRE Image Comparison to version $(PREVIOUS_JDK_VERSION)"
	@$(ECHO) "  Previous: $(PREV_JRE_IMAGE_DIR)"
	@$(ECHO) "  Current:  $(JRE_IMAGE_DIR)"
	@$(CAT) $< $(COMPARE_FILTER) | $(CAT_FILTER)
	( $(ECHO) " " ; $(CAT) $< | $(CAT_FILTER) ; $(ECHO) " " ) >> $(WARNING_FILE)

# Report on the jdk image comparison
compare-image-jdk: $(TEMP_PREV_JDK_COMPARISON)
	@$(ECHO) "JDK Image Comparison to version $(PREVIOUS_JDK_VERSION)"
	@$(ECHO) "  Previous: $(PREV_JDK_IMAGE_DIR)"
	@$(ECHO) "  Current:  $(JDK_IMAGE_DIR)"
	$(CAT) $< $(COMPARE_FILTER) | $(CAT_FILTER)
	( $(ECHO) " " ; $(CAT) $< | $(CAT_FILTER) ; $(ECHO) " " ) >> $(WARNING_FILE)

# Do both image comparisons
compare-image:: compare-image-jre compare-image-jdk

# Clean up any temp images and reports
compare-image-clobber:
	$(RM) -r $(TEMP_PREV_JRE_BASE_DIR)
	$(RM) -r $(TEMP_PREV_JDK_BASE_DIR)

######################################################
# clobber
######################################################
images-clobber::
	$(RM) -r $(REORDER_TEMPDIR)
	$(RM) -r $(JARFILELISTS_TEMPDIR)
ifeq ($(ARCH_DATA_MODEL), 32)
	$(CD) javax/swing/beaninfo && $(MAKE) swingbeans.clobber
	$(RM) -r $(CLASSBINDIR)/META-INF
	$(RM) $(TEMPDIR)/tmp.jar
endif
ifeq ($(PLATFORM), linux)
	$(RM) -r $(OUTPUTDIR)/$(ARCH)
endif
ifeq ($(PLATFORM), windows)
	$(RM) $(TEMPDIR)/rebase.input
endif
	$(RM) -r $(JDK_IMAGE_DIR)
	$(RM) -r $(JRE_IMAGE_DIR)

images images-clobber::
	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
	@$(java-vm-cleanup)

.PHONY: images image-jre image-jdk \
	initial-image-jre initial-image-jdk \
	initial-image-jre-sol64 initial-image-jdk-sol64 \
        initial-image-jdk-setup \
	initial-image-jdk-db \
        initial-image-jdk64-bindemos \
        initial-image-jre-setup \
	trim-image-jre trim-image-jdk \
	process-image-jre process-image-jdk \
1399
	identify-image-jre identify-image-jdk \
D
duke 已提交
1400 1401 1402 1403 1404 1405 1406
	install-previous-jre install-previous-jdk \
	compare-image-jre compare-image-jdk \
	compare-image compare-image-clobber \
	images-clobber

# Force rule
FRC: