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

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

jdk/make: Fixed jsse.jar dependencies to make sure it is rebuilt when containing classes change.

File size: 40.5 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): $(JSSE_CLASSES_DIRS:%=$(CLASSBINDIR)/%) \
695             $(wildcard $(JSSE_CLASSES_DIRS:%=$(CLASSBINDIR)/%/*)) \
696                         $(JAR_MANIFEST_FILE)
697        $(prep-target)
698        $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
699                $(JSSE_CLASSES_DIRS:%=-C $(CLASSBINDIR) %) \
700                $(JAR_JFLAGS)
701        @$(java-vm-cleanup)
702
703# Create sec-bin.zip
704SEC_FILES_ZIP=$(ABS_TEMPDIR)/sec-bin.zip
705sec-files::
706        $(prep-target)
707        $(RM) $(SEC_FILES_ZIP)
708        $(CD) $(OUTPUTDIR) && \
709                $(ZIPEXE) -rq9 $(SEC_FILES_ZIP) $(SEC_FILES_DIRS)
710        @$(java-vm-cleanup)
711
712# Create sec-windows-bin.zip
713SEC_FILES_WIN_ZIP=$(ABS_TEMPDIR)/sec-windows-bin.zip
714sec-files-win::
715ifeq ($(PLATFORM), windows)
716        $(prep-target)
717        $(RM) $(SEC_FILES_WIN_ZIP)
718        $(CD) $(OUTPUTDIR) && \
719                $(ZIPEXE) -rq9 $(SEC_FILES_WIN_ZIP) $(SEC_FILES_WIN_DIRS)
720        @$(java-vm-cleanup)
721endif
722
723# Create JGSS files that contains the native Kerberos library
724JGSS_WIN32_FILES_ZIP=$(ABS_TEMPDIR)/jgss-windows-i586-bin.zip
725JGSS_WIN64_FILES_ZIP=$(ABS_TEMPDIR)/jgss-windows-x64-bin.zip
726jgss-files::
727ifeq ($(PLATFORM), windows)
728        $(prep-target)
729  ifeq ($(ARCH_DATA_MODEL), 32)
730        $(RM) $(JGSS_WIN32_FILES_ZIP)
731        $(CD) $(OUTPUTDIR) && \
732                $(ZIPEXE) -rq9 $(JGSS_WIN32_FILES_ZIP) $(JGSS_FILES_DIRS)
733  else
734        $(RM) $(JGSS_WIN64_FILES_ZIP)
735        $(CD) $(OUTPUTDIR) && \
736                $(ZIPEXE) -rq9 $(JGSS_WIN64_FILES_ZIP) $(JGSS_FILES_DIRS)
737  endif
738        @$(java-vm-cleanup)
739endif
740
741# Create rt.jar
742RT_JAR=$(ABS_TEMPDIR)/rt-orig.jar
743RT_JAR_ARGLIST=$(RT_JAR_FILELIST)_args
744$(RT_JAR_ARGLIST): $(RT_JAR_FILELIST)
745        $(prep-target)
746        $(SED) -e "s@^@-C $(CLASSBINDIR) @" $< > $@
747$(RT_JAR): $(RT_JAR_ARGLIST) $(JAR_MANIFEST_FILE)
748        $(prep-target)
749        $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
750            @$(RT_JAR_ARGLIST) $(JAR_JFLAGS)
751        @$(java-vm-cleanup)
752
753# Meta-index construction to make core class loaders lazier
754
755BUILDMETAINDEX_JARFILE = $(ABS_BUILDTOOLJARDIR)/buildmetaindex.jar
756
757######################################################
758# JRE Image
759######################################################
760
761initial-image-jre-setup:
762        $(RM) -r $(JRE_IMAGE_DIR)
763        $(MKDIR) -p $(JRE_IMAGE_DIR)
764
765# 64-bit solaris jre image contains only the 64-bit add-on files.
766initial-image-jre-sol64:: initial-image-jre-setup \
767                          $(JRE_LICENSES) $(JRE64_LICENSES)
768        @# Use tar instead of cp to preserve the symbolic links
769        for dir in bin lib ; do \
770          ( $(CD) $(OUTPUTDIR) && \
771                $(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \
772                ($(CD) $(JRE_IMAGE_DIR) && $(TAR) xf -) ) ; \
773        done
774        @# Remove some files from the jre area
775        for t in $(NOTJRETOOLS) ; do \
776            $(RM) $(JRE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
777        done
778        for l in $(NOTJRELIBS) ; do \
779            $(RM) $(JRE_IMAGE_DIR)/lib/$$l ; \
780        done
781        $(RM) `$(FIND) $(JRE_IMAGE_DIR)/lib -name 'orb.idl'`
782        $(RM) `$(FIND) $(JRE_IMAGE_DIR)/lib -name 'ir.idl'`
783
784# Construct an initial jre image (initial jdk jre) no trimming or stripping
785initial-image-jre:: initial-image-jre-setup \
786                    $(JRE_LICENSES) $(JRE_DOCFILES) \
787                    $(RT_JAR) $(RESOURCES_JAR) $(JSSE_JAR) \
788                    $(BUILDMETAINDEX_JARFILE)
789        @# Copy in bin directory
790        $(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR)
791        @# CTE plugin security change require new empty directory lib/applet
792        $(MKDIR) -p $(JRE_IMAGE_DIR)/lib/applet
793        @# Copy in lib directory
794        $(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR)
795        @# Make sure all directories are read/execute for everyone
796        $(CHMOD) a+rx `$(FIND) $(JRE_IMAGE_DIR) -type d`
797        @# Remove some files from the jre area
798        for t in $(NOTJRETOOLS) ; do \
799            $(RM) $(JRE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
800        done
801        for l in $(NOTJRELIBS) ; do \
802            $(RM) $(JRE_IMAGE_DIR)/lib/$$l ; \
803        done
804        @# Remove orb.idl and ir.idl from jre
805        $(FIND) $(JRE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \;
806        $(FIND) $(JRE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \;
807        @# Copy in rt.jar & resources.jar file
808        $(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
809        $(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
810        $(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
811        @# Generate meta-index to make boot and extension class loaders lazier
812        $(CD) $(JRE_IMAGE_DIR)/lib && \
813            $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
814                -o meta-index *.jar
815        @$(CD) $(JRE_IMAGE_DIR)/lib && $(java-vm-cleanup)
816        $(CD) $(JRE_IMAGE_DIR)/lib/ext && \
817            $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
818                -o meta-index *.jar
819        @$(CD) $(JRE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup)
820ifeq ($(filter-out windows os2, $(PLATFORM)),)
821        @# Remove certain *.lib files
822        $(CD) $(JRE_IMAGE_DIR)/lib && \
823            $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \
824                  hpi.$(LIB_SUFFIX) awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX)
825else
826        $(call copy-man-pages,$(JRE_IMAGE_DIR),$(JRE_MAN_PAGES))
827endif # windows || OS/2
828
829# Trim out any extra files not for the jre shipment but wanted in the jdk jre.
830#   (Note the jdk WILL want the jre image before this trimming)
831#   Removes server VM on Windows 32bit.
832#   Remove certain shared libraries that should not be in the jre image
833#      but should be in the jdk jre image.
834trim-image-jre::
835ifeq ($(PLATFORM), windows)
836  ifeq ($(ARCH_DATA_MODEL), 32)
837        $(RM) -r $(JRE_IMAGE_DIR)/bin/server
838  endif
839  ifdef NOTJRE_SHARED_LIBS
840        for l in $(NOTJRE_SHARED_LIBS) ; do \
841            $(RM) $(JRE_IMAGE_DIR)/bin/$$l ; \
842        done ;
843  endif
844else # PLATFORM
845  ifdef NOTJRE_SHARED_LIBS
846        for l in $(NOTJRE_SHARED_LIBS) ; do \
847            $(RM) $(JRE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \
848        done ;
849  endif
850endif # PLATFORM
851
852# Get list of all Elf files in the jre
853JRE_ELF_LIST=$(TEMPDIR)/jre-elf-files.list
854$(JRE_ELF_LIST):
855ifneq ($(filter-out windows os2, $(PLATFORM)),)
856        $(RM) $@
857        $(FIND) $(JRE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@
858        $(FILE) `$(FIND) $(JRE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
859            | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
860endif
861
862# Post process the image (strips and mcs on Elf files we are shipping)
863#   (Note the jdk WILL want the jre image before this processing)
864process-image-jre:: $(JRE_ELF_LIST)
865ifneq ($(POST_STRIP_PROCESS), )
866        for f in `$(CAT) $(JRE_ELF_LIST)`; do \
867          $(CHMOD) u+w $${f}; \
868          $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
869          $(POST_STRIP_PROCESS) $${f}; \
870          $(CHMOD) go-w $${f}; \
871        done
872endif
873ifneq ($(POST_MCS_PROCESS), )
874        for f in `$(CAT) $(JRE_ELF_LIST)`; do \
875          $(CHMOD) u+w $${f}; \
876          $(ECHO) $(POST_MCS_PROCESS) $${f}; \
877          $(POST_MCS_PROCESS) $${f}; \
878          $(CHMOD) go-w $${f}; \
879        done
880endif
881        $(RM) $(JRE_ELF_LIST)
882
883######################################################
884# JDK Image
885######################################################
886# Note: cpio ($(CPIO)) sometimes leaves directories without rx access.
887
888initial-image-jdk-setup:
889        $(RM) -r $(JDK_IMAGE_DIR)
890        $(MKDIR) -p $(JDK_IMAGE_DIR)/jre
891        ($(CD) $(JRE_IMAGE_DIR) && $(FIND) . -depth -print \
892              | $(CPIO) -pdum $(JDK_IMAGE_DIR)/jre )
893        $(RM) -rf $(JDK_IMAGE_DIR)/jre/man
894        $(CHMOD) a+rx `$(FIND) $(JDK_IMAGE_DIR) -type d`
895
896initial-image-jdk64-bindemos:
897        for dir in bin demo ; do \
898          ( $(CD) $(OUTPUTDIR) && \
899                $(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \
900                ($(CD) $(JDK_IMAGE_DIR) && $(TAR) xf -) ) ; \
901        done
902
903# Solaris 64 bit image is special
904initial-image-jdk-sol64:: initial-image-jdk-setup \
905                          initial-image-jdk64-bindemos \
906                          $(JDK_LICENSES) $(JDK64_LICENSES)
907
908# DB files to add
909ifdef OPENJDK
910
911initial-image-jdk-db:
912
913else
914
915# Create the list of db *.zip files to bundle with jdk
916ABS_DB_PATH  :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
917DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null)
918
919initial-image-jdk-db: $(DB_ZIP_LIST)
920        $(MKDIR) -p $(JDK_IMAGE_DIR)/db
921        for d in $(DB_ZIP_LIST); do \
922          ($(CD) $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
923        done
924
925endif
926
927# Standard jdk image
928initial-image-jdk:: initial-image-jdk-setup \
929                    initial-image-jdk-db \
930                    $(JDK_LICENSES) $(JDK_DOCFILES)
931        $(MKDIR) $(JDK_IMAGE_DIR)/lib
932        @#
933        @# Copy in the jars in lib that only belong in the JDK
934        @#
935        for l in $(NOTJRELIBS); do \
936            if [ -r $(LIBDIR)/$$l ]; then \
937                $(CP) $(LIBDIR)/$$l $(JDK_IMAGE_DIR)/lib; \
938            fi; \
939        done
940  ifeq ($(filter-out windows os2, $(PLATFORM)),)
941        @#
942        @# lib/
943        @#
944        $(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_IMAGE_DIR)/lib
945ifndef OS2_TEMP # GUI stuff
946        $(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_IMAGE_DIR)/lib
947endif
948        @#
949        @# bin/
950        @#
951        @# copy all EXE files and only certain DLL files from BINDIR
952        $(MKDIR) -p $(JDK_IMAGE_DIR)/bin
953        $(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_IMAGE_DIR)/bin
954        $(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
955    ifeq ($(ARCH_DATA_MODEL), 32)
956      ifeq ($(COMPILER_VERSION), VS2003)
957        $(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_IMAGE_DIR)/bin
958      endif
959    endif
960  else # PLATFORM
961        @#
962        @# bin/
963        @#
964        ($(CD) $(BINDIR)/.. && $(TAR) cf - \
965            `$(FIND) bin \( -type f -o -type l \) -print `) | \
966            ($(CD) $(JDK_IMAGE_DIR) && $(TAR) xf -)
967  endif # PLATFORM
968        @#
969        @# files that might not exist need to be touched.
970        @#
971        $(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.internal.xjc.Plugin
972        @#
973        @# lib/tools.jar
974        @#
975        $(BOOT_JAR_CMD) c0f $(LIBDIR)/tools.jar $(addprefix \
976                -C $(CLASSBINDIR) , $(TOOLS)) \
977                $(JAR_JFLAGS)
978        @$(java-vm-cleanup)
979        $(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar
980        @#
981        @# lib/ct.sym
982        @#
983        $(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym
984        $(JAVAC_CMD) -XDprocess.packages -proc:only \
985            -processor com.sun.tools.javac.sym.CreateSymbols \
986            -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
987            -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
988            $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
989        $(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
990            -C $(OUTPUTDIR)/symbols META-INF $(JAR_JFLAGS)
991        @$(java-vm-cleanup)
992        $(CP) $(LIBDIR)/ct.sym $(JDK_IMAGE_DIR)/lib/ct.sym
993        @#
994        @# CORBA supported orb.idl and ir.idl should be copied to lib
995        @#
996        $(CP) $(LIBDIR)/orb.idl $(JDK_IMAGE_DIR)/lib/orb.idl
997        $(CP) $(LIBDIR)/ir.idl $(JDK_IMAGE_DIR)/lib/ir.idl
998  ifeq ($(PLATFORM), linux)
999        @#
1000        @# on Linux copy jexec from jre/lib to /lib
1001        @#
1002        $(CP) $(LIBDIR)/jexec $(JDK_IMAGE_DIR)/lib/jexec
1003  endif # PLATFORM
1004        @#
1005        @# src.zip
1006        @#
1007        $(MKDIR) -p $(JDK_IMAGE_DIR)/src
1008        @#
1009        @# The '*-*' pattern in the find command excludes files named with dashes,
1010        @# such as the java.nio templates for generated classes
1011        @#
1012        @# The Linux 'tar' command cannot handle the huge command line argument
1013        @# generated by the more efficient solaris/windows method of copying files.
1014        @# So for Linux, make use of the -T option (like Solaris' -I option) of
1015        @# obtaining the list of files from a file. MKS tar has no such option.
1016  ifeq ($(filter-out linux os2, $(PLATFORM)),)
1017        for d in $(SOURCE_DIRS); do \
1018          $(RM) $(ABS_TEMPDIR)/src-files.list; \
1019          ($(CD) $$d &&  \
1020            for sd in $(SOURCES) ; do \
1021              if [ -d $$sd ] ; then \
1022                $(FIND) $$sd $(SOURCE_FILES_filter) \
1023                        -name '*.java' -print \
1024                        >> $(ABS_TEMPDIR)/src-files.list ; \
1025              fi; \
1026            done ; \
1027          ) ; \
1028          if [ -f  $(ABS_TEMPDIR)/src-files.list ] ; then \
1029            ($(CD) $$d && $(TAR) cf - -T $(ABS_TEMPDIR)/src-files.list ) \
1030               | ($(CD) $(JDK_IMAGE_DIR)/src && $(TAR) xf -); \
1031          fi; \
1032        done
1033  else
1034        for d in $(SOURCE_DIRS); do \
1035          $(RM) $(ABS_TEMPDIR)/src-files.list; \
1036          ($(CD) $$d && \
1037            for sd in $(SOURCES) ; do \
1038              if [ -d $$sd ] ; then \
1039                $(FIND) $$sd $(SOURCE_FILES_filter) \
1040                        -name '*.java' -print \
1041                        >> $(ABS_TEMPDIR)/src-files.list ; \
1042              fi; \
1043            done ; \
1044          ) ; \
1045          if [ -f  $(ABS_TEMPDIR)/src-files.list ] ; then \
1046            ($(CD) $$d && $(TAR) cf - `$(CAT) $(ABS_TEMPDIR)/src-files.list`) \
1047              | ($(CD) $(JDK_IMAGE_DIR)/src && $(TAR) xf -); \
1048          fi; \
1049        done
1050  endif
1051        $(RM) $(ABS_TEMPDIR)/src-files.list
1052        $(CHMOD) -R +w $(JDK_IMAGE_DIR)/src
1053        $(MKDIR) -p $(JDK_IMAGE_DIR)/src/launcher
1054        $(CP) $(SHARE_SRC)/bin/java.c $(JDK_IMAGE_DIR)/src/launcher
1055        $(CP) $(SHARE_SRC)/bin/java.h $(JDK_IMAGE_DIR)/src/launcher
1056        $(CP) $(SHARE_SRC)/bin/manifest_info.h $(JDK_IMAGE_DIR)/src/launcher
1057        $(CP) $(SHARE_SRC)/bin/parse_manifest.c $(JDK_IMAGE_DIR)/src/launcher
1058        $(CP) $(SHARE_SRC)/bin/version_comp.c $(JDK_IMAGE_DIR)/src/launcher
1059        $(CP) $(SHARE_SRC)/bin/version_comp.h $(JDK_IMAGE_DIR)/src/launcher
1060        $(CP) $(SHARE_SRC)/bin/wildcard.h $(JDK_IMAGE_DIR)/src/launcher
1061        $(CP) $(SHARE_SRC)/bin/wildcard.c $(JDK_IMAGE_DIR)/src/launcher
1062        $(CP) $(SHARE_SRC)/bin/jli_util.h $(JDK_IMAGE_DIR)/src/launcher
1063        $(CP) $(SHARE_SRC)/bin/jli_util.c $(JDK_IMAGE_DIR)/src/launcher
1064        $(CP) $(SHARE_SRC)/bin/splashscreen_stubs.c $(JDK_IMAGE_DIR)/src/launcher
1065        $(CP) $(SHARE_SRC)/bin/splashscreen.h $(JDK_IMAGE_DIR)/src/launcher
1066        $(CP) $(PLATFORM_SRC)/bin/java_md.c $(JDK_IMAGE_DIR)/src/launcher
1067        $(CP) $(PLATFORM_SRC)/bin/java_md.h $(JDK_IMAGE_DIR)/src/launcher
1068        $(CD) $(JDK_IMAGE_DIR)/src && $(ZIPEXE) -qr ../src.zip *
1069        $(RM) -r $(JDK_IMAGE_DIR)/src
1070        @#
1071        @# demo, include
1072        @#
1073ifndef OS2_TEMP # later
1074        $(CP) -r -f $(DEMODIR) $(JDK_IMAGE_DIR)
1075        $(CP) -r -f $(SAMPLEDIR) $(JDK_IMAGE_DIR)
1076endif
1077        $(CP) -r $(INCLUDEDIR) $(JDK_IMAGE_DIR)
1078ifndef OS2_TEMP # GUI stuff
1079        @#
1080        @# Swing BeanInfo generation
1081        @#
1082        $(CD) javax/swing/beaninfo && $(MAKE) swing-1.2-beans
1083endif
1084ifneq ($(filter-out windows os2, $(PLATFORM)),)
1085        $(call copy-man-pages,$(JDK_IMAGE_DIR),$(JDK_MAN_PAGES))
1086endif # !windows
1087
1088# Trim out files we don't want to ship
1089trim-image-jdk::
1090        @# Remove tools that should not be part of SDK.
1091        for t in $(NOTJDKTOOLS); do \
1092            $(RM) $(JDK_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX) \
1093                  $(JDK_IMAGE_DIR)/bin/*/native_threads/$${t}$(EXE_SUFFIX); \
1094        done
1095
1096# Get list of Elf files in the jdk
1097JDK_ELF_LIST=$(TEMPDIR)/jdk-elf-files.list
1098$(JDK_ELF_LIST):
1099ifneq ($(filter-out windows os2, $(PLATFORM)),)
1100        $(RM) $@
1101        $(FIND) $(JDK_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@
1102        $(FILE) `$(FIND) $(JDK_IMAGE_DIR)/jre/bin -type f -name \*$(EXE_SUFFIX)` \
1103            | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
1104        file `$(FIND) $(JDK_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
1105            | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
1106endif
1107
1108# Post process the image (strips and mcs on files we are shipping)
1109process-image-jdk:: $(JDK_ELF_LIST)
1110ifneq ($(POST_STRIP_PROCESS), )
1111        for f in `$(CAT) $(JDK_ELF_LIST)`; do \
1112          $(CHMOD) u+w $${f}; \
1113          $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
1114          $(POST_STRIP_PROCESS) $${f}; \
1115          $(CHMOD) go-w $${f}; \
1116        done
1117endif
1118ifneq ($(POST_MCS_PROCESS), )
1119        for f in `$(CAT) $(JDK_ELF_LIST)`; do \
1120          $(CHMOD) u+w $${f}; \
1121          $(ECHO) $(POST_MCS_PROCESS) $${f}; \
1122          $(POST_MCS_PROCESS) $${f}; \
1123          $(CHMOD) go-w $${f}; \
1124        done
1125endif
1126        $(RM) $(JDK_ELF_LIST)
1127
1128###################################################################
1129# What do we compare against
1130###################################################################
1131
1132# The temporary files and areas created
1133TEMP_PREV_JRE_BASE_DIR=$(TEMPDIR)/previous_jre
1134TEMP_PREV_JDK_BASE_DIR=$(TEMPDIR)/previous_jdk
1135TEMP_PREV_JRE_COMPARISON=$(TEMP_PREV_JRE_BASE_DIR)/previous_jre_comparison.txt
1136TEMP_PREV_JDK_COMPARISON=$(TEMP_PREV_JDK_BASE_DIR)/previous_jdk_comparison.txt
1137TEMP_PREV_JRE_IMAGE_DIR=$(TEMP_PREV_JRE_BASE_DIR)/jre$(PREVIOUS_JDK_VERSION)
1138TEMP_PREV_JDK_IMAGE_DIR=$(TEMP_PREV_JDK_BASE_DIR)/jdk$(PREVIOUS_JDK_VERSION)
1139
1140# unbundle(sourcedir,bundlename,destdir)
1141#    logic is slightly different if a .tar.gz file (linux)
1142define unbundle
1143$(RM) -r $3
1144$(MKDIR) -p $3
1145$(CP) $1 $3
1146if [ "`$(BASENAME) $2 .gz`" != "$2" ] ; then \
1147  ( $(CD) $3 && ( $(GUNZIP) -dc $2 | $(TAR) xf - ) && $(RM) $2 ); \
1148else \
1149  ( $(CD) $3 && $(TAR) xf $2 && $(RM) $2 ); \
1150fi
1151( $(CD) $3 && $(RM) $2 )
1152endef
1153
1154# In general, ignore the fastdebug tree, and changes in the demo and sample area
1155COMPARE_FILTER = | $(EGREP) -v /fastdebug/ | $(EGREP) -v /demo/ | $(EGREP) -v /sample/
1156
1157# If a previuous image is provided, no need to install it.
1158ifdef PREVIOUS_JDK_IMAGE
1159
1160  # Just use the pre-installed images
1161  PREV_JRE_IMAGE_DIR=$(PREVIOUS_JDK_IMAGE)/jre
1162  PREV_JDK_IMAGE_DIR=$(PREVIOUS_JDK_IMAGE)
1163
1164else
1165
1166  # Use the temp images we will create
1167  PREV_JRE_IMAGE_DIR=$(TEMP_PREV_JRE_IMAGE_DIR)
1168  PREV_JDK_IMAGE_DIR=$(TEMP_PREV_JDK_IMAGE_DIR)
1169
1170# Force the installation in this case
1171compare-image:: install-previous-sanity install-previous-jre install-previous-jdk
1172
1173# Unbundle the jre
1174$(TEMP_PREV_JRE_IMAGE_DIR)/bin/java$(EXE_SUFFIX): $(PREVIOUS_JRE_BUNDLE)
1175        $(call unbundle,$(PREVIOUS_JRE_BUNDLE),$(PREVIOUS_JRE_FILE),$(TEMP_PREV_JRE_BASE_DIR))
1176        $(TOUCH) $@
1177
1178# Unbundle the jdk
1179$(TEMP_PREV_JDK_IMAGE_DIR)/bin/java$(EXE_SUFFIX): $(PREVIOUS_JDK_BUNDLE)
1180        $(call unbundle,$(PREVIOUS_JDK_BUNDLE),$(PREVIOUS_JDK_FILE),$(TEMP_PREV_JDK_BASE_DIR))
1181        $(TOUCH) $@
1182
1183endif
1184
1185# Make sure all images have a java in them (used as the touch file)
1186install-previous-sanity:
1187        @if [ ! -f $(PREVIOUS_JRE_BUNDLE) ]; then \
1188          $(ECHO) "ERROR: You do not have access to the previous java release jre bundles. \n" \
1189            "      Please check your access to \n" \
1190            "          $(PREVIOUS_JRE_BUNDLE) \n" \
1191            "      and/or check your value of ALT_PREVIOUS_RELEASE_PATH or ALT_PREVIOUS_JRE_FILE \n" \
1192            "      This will affect you if you build the images target. \n" \
1193            "" >> $(ERROR_FILE) ; \
1194        fi
1195        @if [ ! -f $(PREVIOUS_JDK_BUNDLE) ]; then \
1196          $(ECHO) "ERROR: You do not have access to the previous java release sdk bundles. \n" \
1197          "      Please check your access to \n" \
1198          "          $(PREVIOUS_sdk_BUNDLE) \n" \
1199          "      and/or check your value of ALT_PREVIOUS_RELEASE_PATH or ALT_PREVIOUS_JDK_FILE. \n" \
1200          "      This will affect you if you build the images target. \n" \
1201          "" >> $(ERROR_FILE) ; \
1202        fi
1203install-previous-jre: $(PREV_JRE_IMAGE_DIR)/bin/java$(EXE_SUFFIX)
1204install-previous-jdk: $(PREV_JDK_IMAGE_DIR)/bin/java$(EXE_SUFFIX)
1205
1206# Create the jre comparison report
1207$(TEMP_PREV_JRE_COMPARISON): install-previous-jre $(DIRDIFF_JARFILE)
1208        $(prep-target)
1209        $(BOOT_JAVA_CMD) -jar $(DIRDIFF_JARFILE) \
1210           $(PREV_JRE_IMAGE_DIR) $(JRE_IMAGE_DIR) | $(SORT) > $@
1211        @$(java-vm-cleanup)
1212
1213# Create the jdk comparison report
1214$(TEMP_PREV_JDK_COMPARISON): install-previous-jdk $(DIRDIFF_JARFILE)
1215        $(prep-target)
1216        $(BOOT_JAVA_CMD) -jar $(DIRDIFF_JARFILE) \
1217           $(PREV_JDK_IMAGE_DIR) $(JDK_IMAGE_DIR) | $(SORT) > $@
1218        @$(java-vm-cleanup)
1219
1220# Clean up names in the messages printed out
1221CAT_FILTER = $(SED) -e "s@$(JDK_IMAGE_DIR)@JDK_IMAGE@g" \
1222                    -e "s@$(JRE_IMAGE_DIR)@JRE_IMAGE@g"
1223
1224# Report on the jre image comparison
1225compare-image-jre: $(TEMP_PREV_JRE_COMPARISON)
1226        @$(ECHO) "JRE Image Comparison to version $(PREVIOUS_JDK_VERSION)"
1227        @$(ECHO) "  Previous: $(PREV_JRE_IMAGE_DIR)"
1228        @$(ECHO) "  Current:  $(JRE_IMAGE_DIR)"
1229        @$(CAT) $< $(COMPARE_FILTER) | $(CAT_FILTER)
1230        ( $(ECHO) " " ; $(CAT) $< | $(CAT_FILTER) ; $(ECHO) " " ) >> $(WARNING_FILE)
1231
1232# Report on the jdk image comparison
1233compare-image-jdk: $(TEMP_PREV_JDK_COMPARISON)
1234        @$(ECHO) "JDK Image Comparison to version $(PREVIOUS_JDK_VERSION)"
1235        @$(ECHO) "  Previous: $(PREV_JDK_IMAGE_DIR)"
1236        @$(ECHO) "  Current:  $(JDK_IMAGE_DIR)"
1237        $(CAT) $< $(COMPARE_FILTER) | $(CAT_FILTER)
1238        ( $(ECHO) " " ; $(CAT) $< | $(CAT_FILTER) ; $(ECHO) " " ) >> $(WARNING_FILE)
1239
1240# Do both image comparisons
1241compare-image:: compare-image-jre compare-image-jdk
1242
1243# Clean up any temp images and reports
1244compare-image-clobber:
1245        $(RM) -r $(TEMP_PREV_JRE_BASE_DIR)
1246        $(RM) -r $(TEMP_PREV_JDK_BASE_DIR)
1247
1248######################################################
1249# clobber
1250######################################################
1251images-clobber::
1252        $(RM) -r $(REORDER_TEMPDIR)
1253        $(RM) -r $(JARFILELISTS_TEMPDIR)
1254ifeq ($(ARCH_DATA_MODEL), 32)
1255        $(CD) javax/swing/beaninfo && $(MAKE) swingbeans.clobber
1256        $(RM) -r $(CLASSBINDIR)/META-INF
1257        $(RM) $(TEMPDIR)/tmp.jar
1258endif
1259ifeq ($(PLATFORM), linux)
1260        $(RM) -r $(OUTPUTDIR)/$(ARCH)
1261endif
1262ifeq ($(filter-out windows os2, $(PLATFORM)),)
1263        $(RM) $(TEMPDIR)/rebase.input
1264endif
1265        $(RM) -r $(JDK_IMAGE_DIR)
1266        $(RM) -r $(JDK_DEBUG_IMAGE_DIR)
1267        $(RM) -r $(JRE_IMAGE_DIR)
1268
1269images images-clobber::
1270        @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
1271        @$(java-vm-cleanup)
1272
1273.PHONY: images image-jre image-jdk \
1274        initial-image-jre initial-image-jdk \
1275        initial-image-jre-sol64 initial-image-jdk-sol64 \
1276        initial-image-jdk-setup \
1277        initial-image-jdk-db \
1278        initial-image-jdk64-bindemos \
1279        initial-image-jre-setup \
1280        trim-image-jre trim-image-jdk \
1281        process-image-jre process-image-jdk \
1282        install-previous-jre install-previous-jdk \
1283        compare-image-jre compare-image-jdk \
1284        compare-image compare-image-clobber \
1285        images-clobber
1286
1287# Force rule
1288FRC:
1289
Note: See TracBrowser for help on using the repository browser.