blob: c1a07693d20cb09f15c3a9ec4cac09926644dac2 [file] [log] [blame]
ihse554e46f2013-11-14 11:19:32 +01001#
ptbrunetdc4e52b2015-03-31 18:39:00 +04002# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
ihse554e46f2013-11-14 11:19:32 +01003# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26include $(SPEC)
27include MakeBase.gmk
28include JavaCompilation.gmk
29include Setup.gmk
30
31default: all
32
33# Prepare the find cache. Only used if running on windows.
34$(eval $(call FillCacheFind, $(JDK_OUTPUTDIR)/classes))
35
36include Tools.gmk
37
38include Profiles.gmk
39
40#
41# This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
42#
43MAKEFILE = $(JDK_TOPDIR)/make/CreateJars.gmk
44#
45# And similarly for the Profiles
46PROFILE_MAKEFILES = $(JDK_TOPDIR)/make/Profiles.gmk $(JDK_TOPDIR)/make/profile-rtjar-includes.txt
47
48MAINMANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf
49BEANMANIFEST := $(JDK_TOPDIR)/make/data/swingbeaninfo/manifest.mf
50
51$(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/lib))
52
53##########################################################################################
54
55$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR, , \
56 SRCS := $(JDK_OUTPUTDIR)/classes, \
57 SUFFIXES := .class .gif .png .properties, \
58 INCLUDES := sun/tools/jconsole com/sun/tools/jconsole, \
59 JARMAIN := sun.tools.jconsole.JConsole, \
60 JAR := $(IMAGES_OUTPUTDIR)/lib/jconsole.jar, \
61 SKIP_METAINF := true))
62
63
64##########################################################################################
65
66$(eval $(call SetupArchive,BUILD_DNS_JAR, , \
67 SRCS := $(JDK_OUTPUTDIR)/classes, \
68 INCLUDES := sun/net/spi/nameservice/dns, \
69 EXTRA_FILES := META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor, \
70 JAR := $(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar, \
71 SKIP_METAINF := true))
72
73
74##########################################################################################
75
76LOCALEDATA_INCLUDE_LOCALES := ar be bg ca cs da de el es et fi fr ga hi hr hu in is it \
77 iw ja ko lt lv mk ms mt nl no pl pt ro ru sk sl sq sr sv \
78 th tr uk vi zh
79
80LOCALEDATA_INCLUDES := $(addprefix sun/text/resources/, $(LOCALEDATA_INCLUDE_LOCALES)) \
81 $(addprefix sun/util/resources/, $(LOCALEDATA_INCLUDE_LOCALES))
82
83$(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR, , \
84 SRCS := $(JDK_OUTPUTDIR)/classes, \
85 SUFFIXES := .class _dict _th, \
86 INCLUDES := $(LOCALEDATA_INCLUDES), \
87 EXCLUDES := sun/text/resources/th/BreakIteratorRules_th.class, \
88 JAR := $(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar, \
89 SKIP_METAINF := true))
90
91##########################################################################################
92#
93# Different variants of rt.jar are built based on the current profile. The output
94# directory is augmented with the profile name so that the final jar file and all the
95# intermediary list files will be in directory. This has the form lib$PROFILE rather than
96# lib/$PROFILE so that it won't get copied as part of the image generation process.
97# Each profile customizes the RT_JAR_EXCLUDES variable.
98#
99##########################################################################################
100
101# Full JRE exclude list for rt.jar and resources.jar
102# This value should exclude types destined for jars other than rt.jar and resources.jar.
103# When building a Profile this value augments the profile specific exclusions
104RT_JAR_EXCLUDES += \
105 com/sun/codemodel \
106 com/sun/crypto/provider \
107 com/sun/istack/internal/tools \
108 com/sun/jarsigner \
109 com/sun/java/accessibility \
110 com/sun/javadoc \
111 com/sun/jdi \
112 com/sun/net/ssl/internal/ssl \
113 com/sun/source \
114 com/sun/tools \
115 com/sun/xml/internal/dtdparser \
116 com/sun/xml/internal/rngom \
117 com/sun/xml/internal/xsom \
118 javax/crypto \
119 javax/swing/AbstractButtonBeanInfo.class \
120 javax/swing/beaninfo \
121 javax/swing/BoxBeanInfo.class \
122 javax/swing/JAppletBeanInfo.class \
123 javax/swing/JButtonBeanInfo.class \
124 javax/swing/JCheckBoxBeanInfo.class \
125 javax/swing/JCheckBoxMenuItemBeanInfo.class \
126 javax/swing/JColorChooserBeanInfo.class \
127 javax/swing/JComboBoxBeanInfo.class \
128 javax/swing/JComponentBeanInfo.class \
129 javax/swing/JDesktopPaneBeanInfo.class \
130 javax/swing/JDialogBeanInfo.class \
131 javax/swing/JEditorPaneBeanInfo.class \
132 javax/swing/JFileChooserBeanInfo.class \
133 javax/swing/JFormattedTextFieldBeanInfo.class \
134 javax/swing/JFrameBeanInfo.class \
135 javax/swing/JInternalFrameBeanInfo.class \
136 javax/swing/JLabelBeanInfo.class \
137 javax/swing/JLayeredPaneBeanInfo.class \
138 javax/swing/JListBeanInfo.class \
139 javax/swing/JMenuBarBeanInfo.class \
140 javax/swing/JMenuBeanInfo.class \
141 javax/swing/JMenuItemBeanInfo.class \
142 javax/swing/JOptionPaneBeanInfo.class \
143 javax/swing/JPanelBeanInfo.class \
144 javax/swing/JPasswordFieldBeanInfo.class \
145 javax/swing/JPopupMenuBeanInfo.class \
146 javax/swing/JProgressBarBeanInfo.class \
147 javax/swing/JRadioButtonBeanInfo.class \
148 javax/swing/JRadioButtonMenuItemBeanInfo.class \
149 javax/swing/JScrollBarBeanInfo.class \
150 javax/swing/JScrollPaneBeanInfo.class \
151 javax/swing/JSeparatorBeanInfo.class \
152 javax/swing/JSliderBeanInfo.class \
153 javax/swing/JSpinnerBeanInfo.class \
154 javax/swing/JSplitPaneBeanInfo.class \
155 javax/swing/JTabbedPaneBeanInfo.class \
156 javax/swing/JTableBeanInfo.class \
157 javax/swing/JTextAreaBeanInfo.class \
158 javax/swing/JTextFieldBeanInfo.class \
159 javax/swing/JTextPaneBeanInfo.class \
160 javax/swing/JToggleButtonBeanInfo.class \
161 javax/swing/JToolBarBeanInfo.class \
162 javax/swing/JTreeBeanInfo.class \
163 javax/swing/JWindowBeanInfo.class \
164 javax/swing/SwingBeanInfoBase.class \
165 javax/swing/text/JTextComponentBeanInfo.class \
166 META-INF/services/com.sun.jdi.connect.Connector \
167 META-INF/services/com.sun.jdi.connect.spi.TransportService \
168 META-INF/services/com.sun.tools.attach.spi.AttachProvider \
169 META-INF/services/com.sun.tools.xjc.Plugin \
170 META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
171 org/relaxng/datatype \
172 sun/awt/HKSCS.class \
173 sun/awt/motif/X11GB2312.class \
174 sun/awt/motif/X11GB2312\$$$$Decoder.class \
175 sun/awt/motif/X11GB2312\$$$$Encoder.class \
176 sun/awt/motif/X11GBK.class \
177 sun/awt/motif/X11GBK\$$$$Encoder.class \
178 sun/awt/motif/X11KSC5601.class \
179 sun/awt/motif/X11KSC5601\$$$$Decoder.class \
180 sun/awt/motif/X11KSC5601\$$$$Encoder.class \
181 sun/jvmstat \
182 sun/net/spi/nameservice/dns \
183 sun/nio/cs/ext \
184 sun/rmi/rmic \
185 sun/security/ec \
186 sun/security/internal \
187 sun/security/mscapi \
188 sun/security/pkcs11 \
189 sun/security/provider/Sun.class \
190 sun/security/rsa/SunRsaSign.class \
191 sun/security/ssl \
192 sun/security/tools/jarsigner \
193 sun/swing/BeanInfoUtils.class \
194 sun/text/resources/cldr \
195 sun/tools/asm \
196 sun/tools/attach \
197 sun/tools/java \
198 sun/tools/javac \
199 sun/tools/jcmd \
200 sun/tools/jconsole \
201 sun/tools/jinfo \
202 sun/tools/jmap \
203 sun/tools/jps \
204 sun/tools/jstack \
205 sun/tools/jstat \
206 sun/tools/jstatd \
207 sun/tools/native2ascii \
208 sun/tools/serialver \
209 sun/tools/tree \
210 sun/tools/util \
211 sun/util/cldr/CLDRLocaleDataMetaInfo.class \
212 sun/util/resources/cldr \
213 $(LOCALEDATA_INCLUDES) \
214 com/oracle/jrockit/jfr \
215 oracle/jrockit/jfr \
216 jdk/jfr
217
218# Find all files in the classes dir to use as dependencies. This could be more fine granular.
219ALL_FILES_IN_CLASSES := $(call not-containing, _the., $(filter-out %javac_state, \
220 $(call CacheFind, $(JDK_OUTPUTDIR)/classes)))
221
222RT_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar_manifest
223RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar_manifest
224
225$(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
226 $(MKDIR) -p $(@D)
227 $(RM) $@ $@.tmp
228 $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
229 -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
230 $(MAINMANIFEST) >> $@.tmp
231 $(ECHO) >> $@.tmp
232 $(CAT) $(BEANMANIFEST) >> $@.tmp
233 $(MV) $@.tmp $@
234
235$(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
236 $(MKDIR) -p $(@D)
237 $(RM) $@ $@.tmp
238 $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
239 -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
240 $(MAINMANIFEST) >> $@.tmp
241 $(MV) $@.tmp $@
242
243$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude: $(MAKEFILE) $(PROFILE_MAKEFILES)
244 $(MKDIR) -p $(@D)
245 $(RM) $@ $@.tmp
246 $(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@.tmp)
247 $(MV) $@.tmp $@
248
249$(IMAGES_OUTPUTDIR)/lib/classlist: $(JDK_TOPDIR)/make/data/classlist/classlist.$(OPENJDK_TARGET_OS) \
250 $(MAKEFILE)
251 $(MKDIR) -p $(@D)
252 $(RM) $@ $@.tmp
253 $(TOOL_ADDJSUM) $< $@.tmp
254 $(MV) $@.tmp $@
255
256$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents: $(BUILD_TOOLS) $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude \
257 $(ALL_FILES_IN_CLASSES) $(IMAGES_OUTPUTDIR)/lib/classlist
258 $(MKDIR) -p $(@D)
259 $(RM) $@ $@.tmp
260 ($(CD) $(JDK_OUTPUTDIR)/classes && \
261 $(TOOL_JARREORDER) \
262 -o $@.tmp $(IMAGES_OUTPUTDIR)/lib/classlist $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.exclude . )
263 $(MV) $@.tmp $@
264
265$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
266 $(MKDIR) -p $(@D)
267 $(RM) $@ $@.tmp
268 $(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
269 ifneq ($(PROFILE), )
dholmesbb588872014-12-17 20:25:47 -0500270 ifneq ($(strip $(RT_JAR_INCLUDE_TYPES)), )
271 # Add back classes from excluded packages (fixing the $ substitution in the process)
272 for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
273 $(ECHO) $$type >> $@.tmp ; \
274 done
275 endif
ihse554e46f2013-11-14 11:19:32 +0100276 endif
277 $(MV) $@.tmp $@
278
279$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents
280 $(MKDIR) -p $(@D)
281 $(RM) $@ $@.tmp
282 $(GREP) -v -e '\.class$$' \
283 -e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \
284 $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
285 ifneq ($(PROFILE), )
dholmesaddecb82015-06-26 18:34:58 -0400286 # Strip out all META-INF/services/ entries
287 $(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
dholmesbb588872014-12-17 20:25:47 -0500288 ifneq ($(strip $(PROFILE_INCLUDE_METAINF_SERVICES)), )
dholmesbb588872014-12-17 20:25:47 -0500289 # Add back the required services
290 for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
291 $(ECHO) $$service >> $@.tmp2; \
292 done
dholmesbb588872014-12-17 20:25:47 -0500293 endif
dholmesaddecb82015-06-26 18:34:58 -0400294 $(MV) $@.tmp2 $@.tmp
ihse554e46f2013-11-14 11:19:32 +0100295 endif
296 $(MV) $@.tmp $@
297
298# This is a hack but I don't know how to make this fit into the existing scheme
299$(PROFILE_VERSION_CLASS_TARGETS): $(PROFILE_VERSION_JAVA_TARGETS)
300 @$(JAVAC) -d $(@D)/../../ $(@D)/$(VERSION_JAVA_FILE)
301
302
303# Support for removing the addPropertyChangeListener and removePropertyChangeListener
304# methods from classes that only go into the profile builds.
305BEANLESS_CLASSES = $(IMAGES_OUTPUTDIR)/beanless
306
307# When there are $ characters in filenames we have some very subtle interactions between
308# make expansion and shell expansion. In this particular case $< will contain a single $ while
309# $@ will contain \$. So we have to pass $< in single-quotes to avoid shell expansion
310$(BEANLESS_CLASSES)/%: $(JDK_OUTPUTDIR)/classes/%
311 $(MKDIR) -p $(@D)
312 $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
313
dholmesbb588872014-12-17 20:25:47 -0500314# Code these targets explicitly because the target "%" expansion does
315# not work with the inline "$" in the file name.
316$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Packer.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Packer.class
317 $(MKDIR) -p $(@D)
318 $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
319$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Unpacker.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Unpacker.class
320 $(MKDIR) -p $(@D)
321 $(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
322
ihse554e46f2013-11-14 11:19:32 +0100323CLASSES_TO_DEBEAN = \
324 java/util/logging/LogManager.class \
325 java/util/jar/Pack200\$$Packer.class \
326 java/util/jar/Pack200\$$Unpacker.class \
327 com/sun/java/util/jar/pack/PackerImpl.class \
328 com/sun/java/util/jar/pack/UnpackerImpl.class
329
330ifneq ($(PROFILE), )
331 BEANLESS_CLASSES_TARGETS := $(addprefix $(BEANLESS_CLASSES)/, $(CLASSES_TO_DEBEAN))
332endif
333
334
335RT_JAR_CREATE_OPTIONS := c0fm
336RT_JAR_UPDATE_OPTIONS := u0f
337ifeq ($(COMPRESS_JARS), true)
338 RT_JAR_CREATE_OPTIONS := cfm
339 RT_JAR_UPDATE_OPTIONS := uf
340endif
341
342# This defines a target-specific variables to make the shell logic easier to see.
343# We need to find the Version.class file for the profile currently being built
344$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: \
345 CLASS_FILE = $(if $(PROFILE), $(strip $(foreach class, $(PROFILE_VERSION_CLASS_TARGETS), $(if $(findstring $(PROFILE), $(class)), $(class)))), NO_SUCH_FILE)
346# This is the real target
347$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE) $(PROFILE_VERSION_CLASS_TARGETS) $(BEANLESS_CLASSES_TARGETS)
348 $(ECHO) Creating rt.jar $(PROFILE) Compressed=$(COMPRESS_JARS)
349 $(MKDIR) -p $(@D)
350 $(RM) $@ $@.tmp
351 $(CD) $(JDK_OUTPUTDIR)/classes && \
352 $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RT_JAR_MANIFEST_FILE) \
353 @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents && \
354 if [ -f $(CLASS_FILE) ]; then \
355 $(ECHO) Updating rt.jar $(PROFILE) && \
356 $(CD) $(patsubst %$(VERSION_CLASS_PATH), %, $(CLASS_FILE)) && \
357 $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(VERSION_CLASS_PATH); \
358 $(CD) $(BEANLESS_CLASSES) && \
359 $(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(CLASSES_TO_DEBEAN); \
360 fi
361 $(MV) $@.tmp $@
362
363$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/resources.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents \
364 $(RESOURCE_JAR_MANIFEST_FILE)
365 $(ECHO) Creating resources.jar
366 $(MKDIR) -p $(@D)
367 $(RM) $@ $@.tmp
368 $(CD) $(JDK_OUTPUTDIR)/classes && \
369 $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RESOURCE_JAR_MANIFEST_FILE) \
370 @$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.resources.jar.contents
371 $(MV) $@.tmp $@
372
373##########################################################################################
374
375ifneq ($(OPENJDK_TARGET_OS), windows)
376 CHARSETS_EXTRA_FILES := sun/awt/motif/X11GBK.class \
377 sun/awt/motif/X11GB2312\$$$$Decoder.class \
378 sun/awt/motif/X11GB2312.class \
379 sun/awt/motif/X11KSC5601\$$$$Decoder.class \
380 sun/awt/motif/X11KSC5601\$$$$Encoder.class \
381 sun/awt/motif/X11GB2312\$$$$Encoder.class \
382 sun/awt/motif/X11GBK\$$$$Encoder.class \
383 sun/awt/motif/X11KSC5601.class
384endif
385
386$(eval $(call SetupArchive,BUILD_CHARSETS_JAR, , \
387 SRCS := $(JDK_OUTPUTDIR)/classes, \
388 SUFFIXES := .class .dat, \
389 INCLUDES := sun/nio/cs/ext, \
390 EXTRA_FILES := sun/awt/HKSCS.class \
391 $(CHARSETS_EXTRA_FILES), \
392 JAR := $(IMAGES_OUTPUTDIR)/lib/charsets.jar, \
393 SKIP_METAINF := true, \
394 CHECK_COMPRESS_JAR := true))
395
396##########################################################################################
397
398ifndef OPENJDK
399 ifeq ($(ENABLE_JFR), true)
400 $(eval $(call SetupArchive,BUILD_JFR_JAR, , \
401 SRCS := $(JDK_OUTPUTDIR)/classes, \
402 SUFFIXES := .class .jfc .xsd, \
403 INCLUDES := com/oracle/jrockit/jfr \
404 oracle/jrockit/jfr \
405 jdk/jfr, \
406 JAR := $(IMAGES_OUTPUTDIR)/lib/jfr.jar, \
407 SKIP_METAINF := true, \
408 MANIFEST := $(MAINMANIFEST), \
409 CHECK_COMPRESS_JAR := true))
410
411 endif
412endif
413
414##########################################################################################
415
416$(eval $(call SetupArchive,BUILD_JSSE_JAR, , \
417 SRCS := $(JDK_OUTPUTDIR)/classes, \
418 INCLUDES := sun/security/provider/Sun.class \
419 sun/security/rsa/SunRsaSign.class \
420 sun/security/ssl \
421 com/sun/net/ssl/internal/ssl, \
422 JAR := $(IMAGES_OUTPUTDIR)/lib/jsse.jar, \
423 SKIP_METAINF := true, \
424 MANIFEST := $(MAINMANIFEST), \
425 CHECK_COMPRESS_JAR := true))
426
427##########################################################################################
428
429$(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR, , \
430 SRCS := $(JDK_OUTPUTDIR)/classes, \
431 SUFFIXES := BeanInfo.class .gif, \
432 INCLUDES := javax/swing sun/swing, \
433 EXCLUDES := javax/swing/plaf, \
434 EXTRA_FILES := javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class, \
435 JAR := $(IMAGES_OUTPUTDIR)/lib/dt.jar, \
436 SKIP_METAINF := true))
437
438##########################################################################################
439
440# Get the CLDRVERSION
441include gensrc/GensrcCLDR.gmk
442
443CLDRDATA_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/cldrdata.jar
444
445$(eval $(call SetupArchive,BUILD_CLDRDATA_JAR, , \
446 SRCS := $(JDK_OUTPUTDIR)/classes, \
447 SUFFIXES := .class, \
448 INCLUDES := sun/text/resources/cldr \
449 sun/util/cldr \
450 sun/util/resources/cldr, \
451 EXCLUDES := sun/util/cldr/CLDRLocaleProviderAdapter, \
452 JAR := $(CLDRDATA_JAR_DST), \
453 EXTRA_MANIFEST_ATTR := CLDR-Version: $(CLDRVERSION), \
454 SKIP_METAINF := true))
455
456##########################################################################################
457
458TOOLS_JAR_INCLUDES := \
459 com/sun/codemodel \
460 com/sun/istack/internal/tools \
461 com/sun/jarsigner \
462 com/sun/javadoc \
463 com/sun/jdi \
464 com/sun/source \
465 com/sun/tools/attach \
466 com/sun/tools/classfile \
467 com/sun/tools/corba \
468 com/sun/tools/doclets \
469 com/sun/tools/doclint \
470 com/sun/tools/example/debug/expr \
471 com/sun/tools/example/debug/tty \
472 com/sun/tools/extcheck \
473 com/sun/tools/hat \
474 com/sun/tools/internal/jxc \
475 com/sun/tools/internal/jxc/ap \
476 com/sun/tools/internal/ws \
477 com/sun/tools/internal/ws/wscompile/plugin/at_generated \
478 com/sun/tools/internal/xjc \
479 com/sun/tools/javac \
480 com/sun/tools/javadoc \
481 com/sun/tools/javah \
482 com/sun/tools/javap \
483 com/sun/tools/jdeps \
484 com/sun/tools/jdi \
485 com/sun/tools/script/shell \
486 com/sun/xml/internal/dtdparser \
487 com/sun/xml/internal/rngom \
488 com/sun/xml/internal/xsom \
489 org/relaxng/datatype \
490 sun/applet \
491 sun/jvmstat \
492 sun/rmi/rmic \
493 sun/security/tools/jarsigner \
494 sun/tools/asm \
495 sun/tools/attach \
496 sun/tools/jar \
497 sun/tools/java \
498 sun/tools/javac \
499 sun/tools/jcmd \
500 sun/tools/jinfo \
501 sun/tools/jmap \
502 sun/tools/jps \
503 sun/tools/jstack \
504 sun/tools/jstat \
505 sun/tools/jstatd \
506 sun/tools/native2ascii \
507 sun/tools/serialver \
508 sun/tools/tree \
509 sun/tools/util
510
511# The sjavac tools is not ready for public consumption.
512TOOLS_JAR_EXCLUDES = com/sun/tools/sjavac
513
514$(eval $(call SetupArchive,BUILD_TOOLS_JAR, , \
515 SRCS := $(JDK_OUTPUTDIR)/classes, \
516 SUFFIXES := .class .prp .gif .properties .xml .css .xsd .js .html .txt .java \
517 Tool aliasmap options, \
518 INCLUDES := $(TOOLS_JAR_INCLUDES), \
519 EXCLUDES := $(TOOLS_JAR_EXCLUDES), \
520 EXTRA_FILES := META-INF/services/com.sun.jdi.connect.Connector \
521 META-INF/services/com.sun.jdi.connect.spi.TransportService \
522 META-INF/services/com.sun.tools.attach.spi.AttachProvider \
523 META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
524 META-INF/services/com.sun.tools.internal.xjc.Plugin, \
525 JAR := $(IMAGES_OUTPUTDIR)/lib/tools.jar, \
526 SKIP_METAINF := true, \
527 CHECK_COMPRESS_JAR := true))
528
529
530##########################################################################################
531
532include CORE_PKGS.gmk
533include NON_CORE_PKGS.gmk
534
535# The compiler should not issue a "Proprietary" warning when compiling
536# classes in the com.sun.java.swing.plaf packages, since we've always
537# allowed, and even advocated, extending them (see bug 6476749).
538#
539# This approach is NOT to be used as a general purpose way to avoid such
540# compiler warnings for non-core packages. The correct way is to document
541# the packages in NON_CORE_PKGS.gmk, and include them in the NON_CORE_PKGS
542# definition.
543#
544# Swing has taken this approach only as a temporary measure to avoid
545# the compiler warnings until we can properly document these packages.
546# This is covered under 6491853.
547EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows \
548 com.sun.java.swing.plaf.motif \
549 com.sun.java.swing.plaf.gtk
550
551#
552# Include the exported private packages in ct.sym.
553# This is an interim solution until the ct.sym is replaced
554# with a new module system (being discussed for JDK 8).
555#
556EXPORTED_PRIVATE_PKGS = com.oracle.net \
557 com.oracle.nio
558
559$(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
560 $(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
561 $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
562 $(JAVA) $(NEW_JAVAC) \
563 -bootclasspath $(JDK_OUTPUTDIR)/classes \
564 -XDprocess.packages -proc:only \
565 -processor com.sun.tools.javac.sym.CreateSymbols \
566 -Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \
567 -Acom.sun.tools.javac.sym.Dest=$(IMAGES_OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
568 -Acom.sun.tools.javac.sym.Profiles=profile-rtjar-includes.txt \
569 $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
570 $(TOUCH) $@
571
572$(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/symbols))
573$(eval $(call SetupArchive,BUILD_CT_SYM, $(IMAGES_OUTPUTDIR)/symbols/_the.symbols, \
574 SRCS := $(IMAGES_OUTPUTDIR)/symbols, \
575 INCLUDES := META-INF/sym, \
576 JAR := $(IMAGES_OUTPUTDIR)/lib/ct.sym, \
577 CHECK_COMPRESS_JAR := true))
578
579
580##########################################################################################
581
582SRC_ZIP_INCLUDES = \
583 com/sun/corba \
584 com/sun/image/codec/jpeg \
585 com/sun/imageio \
586 com/sun/java_cup \
587 com/sun/javadoc \
588 com/sun/java/swing \
589 com/sun/jmx \
590 com/sun/naming \
591 com/sun/org/apache \
592 com/sun/security/auth \
593 com/sun/security/jgss \
594 com/sun/source \
595 java \
596 javax/accessibility \
597 javax/annotation \
598 javax/imageio \
599 javax/lang \
600 javax/management \
601 javax/naming \
602 javax/print \
603 javax/rmi \
604 javax/script \
605 javax/security \
606 javax/sound \
607 javax/sql \
608 javax/swing \
609 javax/tools \
610 javax/xml \
611 org/ietf \
612 org/omg \
613 org/w3c/dom \
614 org/xml/sax \
615 #
616
617SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes
618SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
619SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/impsrc
620SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gendocsrc_rmic
621ifndef OPENJDK
622 SRC_ZIP_SRCS += $(JDK_TOPDIR)/src/closed/share/classes
623endif
624
625# Need to copy launcher src files into desired directory structure
626# before zipping the sources.
627LAUNCHER_SRC_FILES := $(wildcard $(JDK_TOPDIR)/src/share/bin/*) \
628 $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/java_md*)
629LAUNCHER_ZIP_SRC := $(patsubst $(JDK_TOPDIR)/src/share/bin/%, $(IMAGES_OUTPUTDIR)/src/launcher/%, \
630 $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%, $(IMAGES_OUTPUTDIR)/src/launcher/%, \
631 $(LAUNCHER_SRC_FILES)))
632
633$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/share/bin/%
634 $(install-file)
635
636$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%
637 $(install-file)
638
639$(IMAGES_OUTPUTDIR)/src.zip: $(LAUNCHER_ZIP_SRC)
640
641# This dir needs to exist before macro is evaluated to avoid warning from find.
642$(eval $(call MakeDir, $(IMAGES_OUTPUTDIR)/src))
643$(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \
644 SRC := $(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src, \
645 INCLUDES := $(SRC_ZIP_INCLUDES) launcher, \
646 EXCLUDES := javax/swing/beaninfo, \
647 SUFFIXES := .java .c .h, \
648 ZIP := $(IMAGES_OUTPUTDIR)/src.zip, \
649 EXTRA_DEPS := $(LAUNCHER_ZIP_SRC)))
650
651##########################################################################################
652
ptbrunet2ed968a2015-05-27 20:56:16 -0500653ifeq ($(OPENJDK_TARGET_OS), windows)
654 ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
ihse554e46f2013-11-14 11:19:32 +0100655 $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_32_JAR, , \
656 SRCS := $(JDK_OUTPUTDIR)/classes_ab/32bit, \
657 INCLUDES := com/sun/java/accessibility, \
658 JAR := $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar, \
659 SKIP_METAINF := true))
660
661 $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_LEGACY_JAR, , \
662 SRCS := $(JDK_OUTPUTDIR)/classes_ab/legacy, \
663 INCLUDES := com/sun/java/accessibility, \
664 JAR := $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar, \
665 SKIP_METAINF := true))
666
667 JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar \
668 $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar
ptbrunet2ed968a2015-05-27 20:56:16 -0500669 else
ihse554e46f2013-11-14 11:19:32 +0100670 $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_64_JAR, , \
671 SRCS := $(JDK_OUTPUTDIR)/classes_ab/64bit, \
672 INCLUDES := com/sun/java/accessibility, \
673 JAR := $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar, \
674 SKIP_METAINF := true))
675
676 JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
ihse554e46f2013-11-14 11:19:32 +0100677 endif
ptbrunet2ed968a2015-05-27 20:56:16 -0500678endif
679
680$(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
681 SRCS := $(JDK_OUTPUTDIR)/classes, \
682 INCLUDES := com/sun/java/accessibility/util, \
683 JAR := $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar, \
684 SKIP_METAINF := true))
685
686JARS += $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar
ihse554e46f2013-11-14 11:19:32 +0100687
688##########################################################################################
689
690#
691# This is an empty jar (only contains manifest) and fits poorly into framework...
692# create simple rule instead
693#
694$(IMAGES_OUTPUTDIR)/lib/management-agent.jar: $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
695 $(JAR) cfm $@ $<
696
697##########################################################################################
698
699$(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar: $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar
700 $(install-file)
701
702##########################################################################################
703
ihse554e46f2013-11-14 11:19:32 +0100704# This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
705# all jars can be found in one place when creating images in Images.gmk. It needs to be
706# done here so that clean targets can be simple and accurate.
707$(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar: $(JDK_OUTPUTDIR)/lib/sa-jdi.jar
708 $(install-file)
709
710##########################################################################################
711#
712# sec-bin.zip is used by builds where the corresponding sources are not available
713#
714$(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
715 SRC := $(JDK_OUTPUTDIR), \
716 INCLUDES := classes/javax/net \
717 classes/javax/security/cert \
718 classes/com/sun/net/ssl \
719 classes/com/sun/security/cert \
720 classes/sun/net/www/protocol/https \
721 classes/sun/security/pkcs12 \
722 classes/sun/security/ssl \
723 classes/sun/security/krb5 \
724 classes/sun/security/krb5/internal \
725 classes/sun/security/krb5/internal/ccache \
726 classes/sun/security/krb5/internal/crypto \
727 classes/sun/security/krb5/internal/ktab \
728 classes/sun/security/krb5/internal/rcache \
729 classes/sun/security/krb5/internal/util, \
730 INCLUDE_FILES := classes/sun/security/jgss/spi/GSSContextSpi.class, \
731 EXCLUDES := classes/sun/security/krb5/internal/tools, \
732 ZIP := $(IMAGES_OUTPUTDIR)/sec-bin.zip))
733
734JARS += $(IMAGES_OUTPUTDIR)/sec-bin.zip
735
736##########################################################################################
737#
738# Windows specific binary security packages.
739#
740ifeq ($(OPENJDK_TARGET_OS), windows)
741 # sec-windows-bin.zip is used by builds where the corresponding sources are not available
742 $(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP, \
743 SRC := $(JDK_OUTPUTDIR), \
744 INCLUDES := classes/sun/security/krb5/internal/tools, \
745 ZIP := $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip))
746
747 JARS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip
748
749 # JGSS files contain the native Kerberos library
750 ifeq ($(OPENJDK_TARGET_CPU), x86_64)
751 JGSS_ZIP_NAME = jgss-windows-x64-bin.zip
752 else
753 JGSS_ZIP_NAME = jgss-windows-i586-bin.zip
754 endif
755
756 $(eval $(call SetupZipArchive,BUILD_JGSS_BIN_ZIP, \
757 SRC := $(JDK_OUTPUTDIR), \
758 INCLUDE_FILES := bin/w2k_lsa_auth.dll \
759 bin/w2k_lsa_auth.map \
760 bin/w2k_lsa_auth.pdb, \
761 ZIP := $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)))
762
763 JARS += $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)
764endif
765
766##########################################################################################
767
768# This rule copies all jars from jdk/lib/... to images/lib/... to avoid having to track
769# which jars are where
770$(IMAGES_OUTPUTDIR)/lib/%: $(JDK_OUTPUTDIR)/lib/%
771 $(install-file)
772
773##########################################################################################
774
775# Import nashorn.jar from nashorn dist dir.
776$(IMAGES_OUTPUTDIR)/lib/ext/nashorn.jar: $(NASHORN_DIST)/nashorn.jar
777 $(install-file)
778
779##########################################################################################
780
781-include $(CUSTOM_MAKE_DIR)/CreateJars.gmk
782
783##########################################################################################
784
785all: $(JARS)
786
787.PHONY: default all