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