source: trunk/openjdk/jdk/make/common/Release.gmk @ 158

Last change on this file since 158 was 158, checked in by dmik, 10 years ago

jdk/make: Enabled packaging security classes.

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