blob: 698885df08a0b8e7f179cb785627084a13b23db8 [file] [log] [blame]
erikje78df742012-06-07 20:40:50 -07001#
2# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26include $(SPEC)
27include MakeBase.gmk
28include JavaCompilation.gmk
29include Setup.gmk
30
31default: all
32
33include Tools.gmk
34
erikjaf85fc42012-07-03 16:10:44 -070035#
36# This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
37#
38MAKEFILE=$(JDK_TOPDIR)/makefiles/CreateJars.gmk
erikje78df742012-06-07 20:40:50 -070039
40MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
41BEANMANIFEST := $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest
42
43JARS:=
44
45##########################################################################################
46
47JCONSOLE_JAR_DEPS := \
48 $(shell $(FIND) $(JDK_OUTPUTDIR)/classes/sun/tools/jconsole/ -name "_the.package") \
49 $(shell $(FIND) $(JDK_OUTPUTDIR)/classes/com/sun/tools/jconsole/ -name "_the.package")
50
51$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,$(JCONSOLE_JAR_DEPS),\
52 SRCS:=$(JDK_OUTPUTDIR)/classes,\
erikjaf85fc42012-07-03 16:10:44 -070053 SUFFIXES:=.class .gif .png .properties,\
erikje78df742012-06-07 20:40:50 -070054 INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
55 JARMAIN:=sun.tools.jconsole.JConsole,\
56 JAR:=$(JDK_OUTPUTDIR)/lib/jconsole.jar,\
57 SKIP_METAINF:=true))
58
59JARS+=$(JDK_OUTPUTDIR)/lib/jconsole.jar
60
61##########################################################################################
62
63DNS_JAR_DEPS := \
64 $(shell $(FIND) $(JDK_OUTPUTDIR)/classes/sun/net/spi/nameservice/dns/ -name "_the.package") \
65
66$(eval $(call SetupArchive,BUILD_DNS_JAR,$(DNS_JAR_DEPS),\
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:=$(JDK_OUTPUTDIR)/lib/ext/dnsns.jar,\
71 SKIP_METAINF:=true))
72
73JARS+=$(JDK_OUTPUTDIR)/lib/ext/dnsns.jar
74
75##########################################################################################
76
77LOCALEDATA_INCLUDE_PATTERNS := \
78 sun/text/resources/*_ar* \
79 sun/text/resources/*_hi* \
80 sun/text/resources/*_iw* \
81 sun/text/resources/*_iw* \
82 sun/text/resources/*_ja* \
83 sun/text/resources/*_ko* \
84 sun/text/resources/*_th.* \
85 sun/text/resources/*_th_* \
86 sun/text/resources/*_vi* \
87 sun/text/resources/*_zh* \
88 sun/text/resources/*Data_th \
89 sun/text/resources/thai_dict \
90 sun/util/resources/*_ar* \
91 sun/util/resources/*_hi* \
92 sun/util/resources/*_iw* \
93 sun/util/resources/*_iw* \
94 sun/util/resources/*_ja* \
95 sun/util/resources/*_ko* \
96 sun/util/resources/*_th_* \
97 sun/util/resources/*_th.* \
98 sun/util/resources/*_vi* \
99 sun/util/resources/*_zh*
100
101LOCALEDATA_INCLUDES := $(patsubst $(JDK_OUTPUTDIR)/classes/%,%,\
102 $(foreach i,$(LOCALEDATA_INCLUDE_PATTERNS), $(wildcard $(JDK_OUTPUTDIR)/classes/$i)))
103
104$(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\
105 SRCS:=$(JDK_OUTPUTDIR)/classes,\
106 SUFFIXES:=.class _dict _th,\
107 INCLUDES:=$(LOCALEDATA_INCLUDES),\
108 JAR:=$(JDK_OUTPUTDIR)/lib/ext/localedata.jar,\
109 SKIP_METAINF:=true))
110
111JARS+=$(JDK_OUTPUTDIR)/lib/ext/localedata.jar
112
113##########################################################################################
114# rt.jar and resources.jar are being built in the same way as in the old build. They require
115# the files to be in a certain order and converting that is not easy and will not be needed
116# in jigsaw anyway.
117
118# Exclude list for rt.jar and resources.jar
119RT_JAR_EXCLUDES := \
120 com/sun/javadoc \
121 com/sun/jdi \
122 com/sun/jarsigner \
123 com/sun/source \
124 com/sun/istack/internal/tools \
125 META-INF/services/com.sun.jdi.connect.Connector \
126 META-INF/services/com.sun.jdi.connect.spi.TransportService \
127 META-INF/services/com.sun.tools.xjc.Plugin \
128 com/sun/tools \
129 sun/jvmstat \
130 sun/nio/cs/ext \
131 sun/awt/HKSCS.class \
132 sun/awt/motif/X11GB2312\$$$$Decoder.class \
133 sun/awt/motif/X11GB2312\$$$$Encoder.class \
134 sun/awt/motif/X11GB2312.class \
135 sun/awt/motif/X11GBK\$$$$Encoder.class \
136 sun/awt/motif/X11GBK.class \
137 sun/awt/motif/X11KSC5601\$$$$Decoder.class \
138 sun/awt/motif/X11KSC5601\$$$$Encoder.class \
139 sun/awt/motif/X11KSC5601.class \
140 META-INF/services/java.nio.charset.spi.CharsetProvider \
141 sun/rmi/rmic \
142 sun/tools/asm \
143 sun/tools/java \
144 sun/tools/javac \
145 com/sun/tools/classfile \
146 com/sun/tools/javap \
147 sun/tools/jcmd \
148 sun/tools/jconsole \
149 sun/tools/jps \
150 sun/tools/jstat \
151 sun/tools/jstatd \
152 sun/tools/native2ascii \
153 sun/tools/serialver \
154 sun/tools/tree \
155 sun/tools/util \
156 sun/security/tools/JarBASE64Encoder.class \
157 sun/security/tools/JarSigner.class \
158 sun/security/tools/JarSignerParameters.class \
159 sun/security/tools/JarSignerResources.class \
160 sun/security/tools/JarSignerResources_ja.class \
161 sun/security/tools/JarSignerResources_zh_CN.class \
162 sun/security/tools/SignatureFile\$$$$Block.class \
163 sun/security/tools/SignatureFile.class \
164 sun/security/tools/TimestampedSigner.class \
165 sun/security/provider/Sun.class \
166 sun/security/rsa/SunRsaSign.class \
167 sun/security/ssl \
168 sun/security/ec/ECDHKeyAgreement.class \
169 sun/security/ec/ECDSASignature\$$$$Raw.class \
170 sun/security/ec/ECDSASignature\$$$$SHA1.class \
171 sun/security/ec/ECDSASignature\$$$$SHA224.class \
172 sun/security/ec/ECDSASignature\$$$$SHA256.class \
173 sun/security/ec/ECDSASignature\$$$$SHA384.class \
174 sun/security/ec/ECDSASignature\$$$$SHA512.class \
175 sun/security/ec/ECDSASignature.class \
176 sun/security/ec/ECKeyPairGenerator.class \
177 sun/security/ec/SunEC\$$$$1.class \
178 sun/security/ec/SunEC.class \
179 sun/security/ec/SunECEntries.class \
180 sun/security/pkcs11 \
181 com/sun/net/ssl/internal/ssl \
182 javax/crypto \
183 sun/security/internal \
184 com/sun/crypto/provider \
185 META-INF/services/com.sun.tools.attach.spi.AttachProvider \
186 com/sun/tools/attach \
187 org/relaxng/datatype \
188 com/sun/codemodel \
189 com/sun/xml/internal/dtdparser \
190 com/sun/xml/internal/rngom \
191 com/sun/xml/internal/xsom \
192 com/sun/tools/script/shell \
193 sun/tools/attach \
194 sun/tools/jstack \
195 sun/tools/jinfo \
196 sun/tools/jmap \
197 sun/net/spi/nameservice/dns \
198 META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
199 javax/swing/beaninfo \
200 javax/swing/AbstractButtonBeanInfo.class \
201 javax/swing/BoxBeanInfo.class \
202 javax/swing/JAppletBeanInfo.class \
203 javax/swing/JButtonBeanInfo.class \
204 javax/swing/JCheckBoxBeanInfo.class \
205 javax/swing/JCheckBoxMenuItemBeanInfo.class \
206 javax/swing/JColorChooserBeanInfo.class \
207 javax/swing/JComboBoxBeanInfo.class \
208 javax/swing/JComponentBeanInfo.class \
209 javax/swing/JDesktopPaneBeanInfo.class \
210 javax/swing/JDialogBeanInfo.class \
211 javax/swing/JEditorPaneBeanInfo.class \
212 javax/swing/JFileChooserBeanInfo.class \
213 javax/swing/JFormattedTextFieldBeanInfo.class \
214 javax/swing/JFrameBeanInfo.class \
215 javax/swing/JInternalFrameBeanInfo.class \
216 javax/swing/JLabelBeanInfo.class \
217 javax/swing/JLayeredPaneBeanInfo.class \
218 javax/swing/JListBeanInfo.class \
219 javax/swing/JMenuBarBeanInfo.class \
220 javax/swing/JMenuBeanInfo.class \
221 javax/swing/JMenuItemBeanInfo.class \
222 javax/swing/JOptionPaneBeanInfo.class \
223 javax/swing/JPanelBeanInfo.class \
224 javax/swing/JPasswordFieldBeanInfo.class \
225 javax/swing/JPopupMenuBeanInfo.class \
226 javax/swing/JProgressBarBeanInfo.class \
227 javax/swing/JRadioButtonBeanInfo.class \
228 javax/swing/JRadioButtonMenuItemBeanInfo.class \
229 javax/swing/JScrollBarBeanInfo.class \
230 javax/swing/JScrollPaneBeanInfo.class \
231 javax/swing/JSeparatorBeanInfo.class \
232 javax/swing/JSliderBeanInfo.class \
233 javax/swing/JSpinnerBeanInfo.class \
234 javax/swing/JSplitPaneBeanInfo.class \
235 javax/swing/JTabbedPaneBeanInfo.class \
236 javax/swing/JTableBeanInfo.class \
237 javax/swing/JTextAreaBeanInfo.class \
238 javax/swing/JTextFieldBeanInfo.class \
239 javax/swing/JTextPaneBeanInfo.class \
240 javax/swing/JToggleButtonBeanInfo.class \
241 javax/swing/JToolBarBeanInfo.class \
242 javax/swing/JTreeBeanInfo.class \
243 javax/swing/JWindowBeanInfo.class \
244 javax/swing/SwingBeanInfoBase.class \
245 javax/swing/text/JTextComponentBeanInfo.class \
246 sun/swing/BeanInfoUtils.class \
247 $(LOCALEDATA_INCLUDES)
248
erikjaf85fc42012-07-03 16:10:44 -0700249# These files should never be put into rt.jar
250# but due to a misstake...some are put there if embedded
251#
252ifneq ($(JAVASE_EMBEDDED), true)
253# normal (correct) case
erikje78df742012-06-07 20:40:50 -0700254RT_JAR_EXCLUDES += \
255 com/oracle/jrockit/jfr \
256 oracle/jrockit/jfr
erikjaf85fc42012-07-03 16:10:44 -0700257else
258# embedded (broken) case
259RT_JAR_EXCLUDES += \
260 oracle/jrockit/jfr/parser \
261 oracle/jrockit/jfr/tools \
262 oracle/jrockit/jfr/NativeOptions.class \
263 oracle/jrockit/jfr/RepositoryChunkHandler.class
erikje78df742012-06-07 20:40:50 -0700264endif
erikjaf85fc42012-07-03 16:10:44 -0700265
266ifeq ($(OPENJDK_TARGET_OS), macosx)
267 RT_JAR_EXCLUDES += com/sun/nio/sctp \
268 sun/nio/ch/sctp \
269 sun/jdbc \
270 sun/nio/ch/DevPollArrayWrapper\$$$$Updator.class \
271 sun/nio/ch/DevPollArrayWrapper.class \
272 sun/nio/ch/DevPollSelectorImpl.class \
273 sun/nio/ch/DevPollSelectorProvider.class \
274 sun/nio/ch/EPollArrayWrapper\$$$$Updator.class \
275 sun/nio/ch/EPollArrayWrapper.class \
276 sun/nio/ch/EPollSelectorImpl.class \
277 sun/nio/ch/EPollSelectorProvider.class
erikje78df742012-06-07 20:40:50 -0700278endif
279
280# Find all files in the classes dir to use as dependencies. This could be more fine granular.
281ALL_FILES_IN_CLASSES := $(shell $(FIND) $(JDK_OUTPUTDIR)/classes -type f \
282 | $(GREP) -v -e '/_the\.*' -e '^_the\.*')
283
284RT_JAR_MANIFEST_FILE := $(JDK_OUTPUTDIR)/lib/_the.rt.jar_manifest
285RESOURCE_JAR_MANIFEST_FILE := $(JDK_OUTPUTDIR)/lib/_the.resources.jar_manifest
286
287$(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
288 $(MKDIR) -p $(@D)
289 $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
290 -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
291 $(MAINMANIFEST) >> $@
292 $(ECHO) >> $@
293 $(CAT) $(BEANMANIFEST) >> $@
294
295$(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
296 $(MKDIR) -p $(@D)
297 $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
298 -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
299 $(MAINMANIFEST) >> $@
300
erikjaf85fc42012-07-03 16:10:44 -0700301$(JDK_OUTPUTDIR)/lib/_the.jars.exclude: $(MAKEFILE)
erikje78df742012-06-07 20:40:50 -0700302 $(MKDIR) -p $(@D)
303 $(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@)
304
erikjaf85fc42012-07-03 16:10:44 -0700305$(JDK_OUTPUTDIR)/lib/classlist : $(JDK_TOPDIR)/make/tools/sharing/classlist.$(OPENJDK_TARGET_OS) \
306 $(MAKEFILE)
307 $(MKDIR) -p $(@D)
308 $(RM) -f $@.temp
309 $(TOOL_ADDJSUM) $< $@.temp
310 $(MV) $@.temp $@
311
erikje78df742012-06-07 20:40:50 -0700312$(JDK_OUTPUTDIR)/lib/_the.jars.contents: $(BUILD_TOOLS) $(JDK_OUTPUTDIR)/lib/_the.jars.exclude \
erikjaf85fc42012-07-03 16:10:44 -0700313 $(ALL_FILES_IN_CLASSES) $(JDK_OUTPUTDIR)/lib/classlist
erikje78df742012-06-07 20:40:50 -0700314 $(MKDIR) -p $(@D)
315 $(RM) $@.temp
316 ($(CD) $(JDK_OUTPUTDIR)/classes && \
317 $(TOOL_JARREORDER) \
318 -o $@.temp $(JDK_OUTPUTDIR)/lib/classlist $(JDK_OUTPUTDIR)/lib/_the.jars.exclude . )
319 $(MV) $@.temp $@
320
321$(JDK_OUTPUTDIR)/lib/_the.rt.jar.contents: $(JDK_OUTPUTDIR)/lib/_the.jars.contents
322 $(GREP) -e '\.class$$' $(JDK_OUTPUTDIR)/lib/_the.jars.contents > $@
323
324$(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents: $(JDK_OUTPUTDIR)/lib/_the.jars.contents
325 $(GREP) -v -e '\.class$$' -e '/_the\.*' -e '^_the\.*' $(JDK_OUTPUTDIR)/lib/_the.jars.contents > $@
326
erikjaf85fc42012-07-03 16:10:44 -0700327RT_JAR_CREATE_OPTIONS := c0fm
328ifeq ($(COMPRESS_JARS), true)
329 RT_JAR_CREATE_OPTIONS := cfm
330endif
331
erikje78df742012-06-07 20:40:50 -0700332$(JDK_OUTPUTDIR)/lib/rt.jar: $(JDK_OUTPUTDIR)/lib/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE)
333 $(ECHO) Creating rt.jar
334 $(CD) $(JDK_OUTPUTDIR)/classes && \
erikjaf85fc42012-07-03 16:10:44 -0700335 $(JAR) $(RT_JAR_CREATE_OPTIONS) $@ $(RT_JAR_MANIFEST_FILE) \
erikje78df742012-06-07 20:40:50 -0700336 @$(JDK_OUTPUTDIR)/lib/_the.rt.jar.contents
337
338$(JDK_OUTPUTDIR)/lib/resources.jar: $(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents \
339 $(RESOURCE_JAR_MANIFEST_FILE)
340 $(ECHO) Creating resources.jar
341 $(CD) $(JDK_OUTPUTDIR)/classes && \
erikjaf85fc42012-07-03 16:10:44 -0700342 $(JAR) $(RT_JAR_CREATE_OPTIONS) $@ $(RESOURCE_JAR_MANIFEST_FILE) \
erikje78df742012-06-07 20:40:50 -0700343 @$(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents
344
345JARS+=$(JDK_OUTPUTDIR)/lib/rt.jar $(JDK_OUTPUTDIR)/lib/resources.jar
346
347##########################################################################################
348
349CHARSETS_JAR_DEPS :=
350
erikjaf85fc42012-07-03 16:10:44 -0700351ifneq ($(OPENJDK_TARGET_OS), windows)
erikje78df742012-06-07 20:40:50 -0700352 CHARSETS_EXTRA_FILES:=sun/awt/motif/X11GBK.class \
353 sun/awt/motif/X11GB2312\$$$$Decoder.class \
354 sun/awt/motif/X11GB2312.class \
355 sun/awt/motif/X11KSC5601\$$$$Decoder.class \
356 sun/awt/motif/X11KSC5601\$$$$Encoder.class \
357 sun/awt/motif/X11GB2312\$$$$Encoder.class \
358 sun/awt/motif/X11GBK\$$$$Encoder.class \
359 sun/awt/motif/X11KSC5601.class
360endif
361
362$(eval $(call SetupArchive,BUILD_CHARSETS_JAR,$(CHARSETS_JAR_DEPS),\
363 SRCS:=$(JDK_OUTPUTDIR)/classes, \
364 SUFFIXES:=.class .dat,\
365 INCLUDES:=sun/nio/cs/ext,\
366 EXTRA_FILES := sun/awt/HKSCS.class \
367 $(CHARSETS_EXTRA_FILES) \
368 META-INF/services/java.nio.charset.spi.CharsetProvider, \
369 JAR:=$(JDK_OUTPUTDIR)/lib/charsets.jar, \
erikjaf85fc42012-07-03 16:10:44 -0700370 SKIP_METAINF := true, \
371 CHECK_COMPRESS_JAR:=true))
erikje78df742012-06-07 20:40:50 -0700372
373JARS+=$(JDK_OUTPUTDIR)/lib/charsets.jar
374
375##########################################################################################
376
erikjaf85fc42012-07-03 16:10:44 -0700377ifeq ($(ENABLE_JFR), true)
erikje78df742012-06-07 20:40:50 -0700378 $(eval $(call SetupArchive,BUILD_JFR_JAR,,\
379 SRCS:=$(JDK_OUTPUTDIR)/classes,\
380 INCLUDES:=com/oracle/jrockit/jfr \
381 oracle/jrockit/jfr,\
382 JAR:=$(JDK_OUTPUTDIR)/lib/jfr.jar,\
383 SKIP_METAINF:=true,\
erikjaf85fc42012-07-03 16:10:44 -0700384 MANIFEST:=$(MAINMANIFEST), \
385 CHECK_COMPRESS_JAR:=true))
erikje78df742012-06-07 20:40:50 -0700386
387 JARS+=$(JDK_OUTPUTDIR)/lib/jfr.jar
388endif
389
390##########################################################################################
391
392$(eval $(call SetupArchive,BUILD_JSSE_JAR,,\
393 SRCS:=$(JDK_OUTPUTDIR)/classes,\
394 INCLUDES:=sun/security/provider/Sun.class \
395 sun/security/rsa/SunRsaSign.class \
396 sun/security/ssl \
397 com/sun/net/ssl/internal/ssl,\
398 JAR:=$(JDK_OUTPUTDIR)/lib/jsse.jar,\
399 SKIP_METAINF:=true,\
erikjaf85fc42012-07-03 16:10:44 -0700400 MANIFEST:=$(MAINMANIFEST), \
401 CHECK_COMPRESS_JAR:=true))
erikje78df742012-06-07 20:40:50 -0700402
403JARS+=$(JDK_OUTPUTDIR)/lib/jsse.jar
404
405##########################################################################################
406
erikjaf85fc42012-07-03 16:10:44 -0700407ifneq ($(OPENJDK_TARGET_OS)-$(ARCH_DATA_MODEL),windows-64)
erikje78df742012-06-07 20:40:50 -0700408 SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
409
410 ifndef OPENJDK
411
412 SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
413
414 $(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_SRC)
415 @$(ECHO) "\n>>>Installing prebuilt SunPKCS11 provider..."
416 $(RM) $@
417 $(CP) $< $@
418
419 else
420
421 $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR,$(SUNPKCS11_JAR_DEPS),\
422 SRCS:=$(JDK_OUTPUTDIR)/classes, \
423 SUFFIXES:=.class,\
424 INCLUDES:=sun/security/pkcs11,\
425 JAR:=$(SUNPKCS11_JAR_DST), \
426 SKIP_METAINF := true))
427
428 endif
429
430 JARS += $(SUNPKCS11_JAR_DST)
431endif
432
433##########################################################################################
434
435SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
436
437ifndef OPENJDK
438
439SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
440
441$(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
442 @$(ECHO) "\n>>>Installing prebuilt SunEC provider..."
443 $(RM) $@
444 $(CP) $< $@
445
446else
447
448$(eval $(call SetupArchive,BUILD_SUNEC_JAR,,\
449 SRCS:=$(JDK_OUTPUTDIR)/classes, \
450 SUFFIXES:=.class,\
451 INCLUDES:=sun/security/ec,\
452 EXCLUDE_FILES := sun/security/ec/ECKeyFactory.class \
453 sun/security/ec/ECParameters.class \
454 sun/security/ec/ECPrivateKeyImpl.class \
455 sun/security/ec/ECPublicKeyImpl.class \
456 sun/security/ec/NamedCurve.class \
457 sun/security/ec/ECKeyFactory*,\
458 JAR:=$(SUNEC_JAR_DST), \
459 SKIP_METAINF := true))
460
461endif
462
463JARS += $(SUNEC_JAR_DST)
464
465##########################################################################################
466
467$(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR,,\
468 SRCS:=$(JDK_OUTPUTDIR)/classes,\
469 SUFFIXES:=BeanInfo.class .gif,\
470 INCLUDES:=javax/swing sun/swing,\
471 EXCLUDES:=javax/swing/plaf,\
472 EXTRA_FILES:=javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class,\
473 JAR:=$(JDK_OUTPUTDIR)/lib/dt.jar,\
474 SKIP_METAINF:=true))
475
476JARS+=$(JDK_OUTPUTDIR)/lib/dt.jar
477
478##########################################################################################
479
480SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
481
482ifndef OPENJDK
483 SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
484
485 $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_SRC)
486 @$(ECHO) "\n>>>Installing prebuilt SunJCE provider..."
487 $(RM) $@
488 $(CP) $< $@
489else
490
491 $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR,$(SUNJCE_PROVIDER_JAR_DEPS),\
492 SRCS:=$(JDK_OUTPUTDIR)/classes, \
493 SUFFIXES:=.class,\
494 INCLUDES:= com/sun/crypto/provider,\
495 JAR:=$(SUNJCE_PROVIDER_JAR_DST), \
496 MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
497 EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
498 SKIP_METAINF := true))
499endif
500
501JARS += $(SUNJCE_PROVIDER_JAR_DST)
502
503JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
504
505ifndef OPENJDK
506
507JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
508
509$(JCE_JAR_DST) : $(JCE_JAR_SRC)
510 @$(ECHO) "\n>>>Installing prebuilt jce.jar..."
511 $(RM) $@
512 $(CP) $< $@
513
514else
515
516$(eval $(call SetupArchive,BUILD_JCE_JAR,$(JCE_JAR_DEPS),\
517 SRCS:=$(JDK_OUTPUTDIR)/classes, \
518 SUFFIXES:=.class,\
519 INCLUDES:= javax/crypto sun/security/internal,\
520 JAR:=$(JCE_JAR_DST), \
521 MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
522 EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
523 SKIP_METAINF := true))
524endif
525
526JARS += $(JCE_JAR_DST)
527
528##########################################################################################
529
530ifdef OPENJDK
531
532#
533# TODO fix so that SetupArchive does not write files into SRCS
534# then we don't need this extra copying
535#
536US_EXPORT_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar
537US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
538US_EXPORT_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/US_export_policy_jar.tmp
539
540$(US_EXPORT_POLICY_JAR_TMP)/% : $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
541 $(MKDIR) -p $(@D)
542 $(CP) $< $@
543
544US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
545
546$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR,$(US_EXPORT_POLICY_JAR_DEPS),\
547 SRCS:=$(US_EXPORT_POLICY_JAR_TMP), \
548 SUFFIXES:= .policy,\
549 JAR:=$(US_EXPORT_POLICY_JAR_DST), \
550 EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
551 SKIP_METAINF := true))
552
553JARS += $(US_EXPORT_POLICY_JAR_DST)
554
555endif
556
557##########################################################################################
558
559
560ifdef OPENJDK
561
562#
563# TODO fix so that SetupArchive does not write files into SRCS
564# then we don't need this extra copying
565#
566LOCAL_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/local_policy.jar
567LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
568LOCAL_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/local_policy_jar.tmp
569
570LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy $(LOCAL_POLICY_JAR_TMP)/default_local.policy
571
572$(LOCAL_POLICY_JAR_TMP)/% : $(LOCAL_POLICY_JAR_SRC_DIR)/%
573 $(MKDIR) -p $(@D)
574 $(CP) $< $@
575
576$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR,$(LOCAL_POLICY_JAR_DEPS),\
577 SRCS:=$(LOCAL_POLICY_JAR_TMP),\
578 SUFFIXES:= .policy,\
579 JAR:=$(LOCAL_POLICY_JAR_DST), \
580 EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
581 SKIP_METAINF := true))
582
583JARS += $(LOCAL_POLICY_JAR_DST)
584
585endif
586
587##########################################################################################
588
erikjaf85fc42012-07-03 16:10:44 -0700589ifeq ($(OPENJDK_TARGET_OS),windows)
erikje78df742012-06-07 20:40:50 -0700590
591SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
592
593ifndef OPENJDK
594SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
595
596$(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_SRC)
597 @$(ECHO) "\n>>>Installing prebuilt SunMSCAPI provider..."
598 $(RM) $@
599 $(CP) $< $@
600
601else
602
603$(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR,$(SUNMSCAPI_JAR_DEPS),\
604 SRCS:=$(JDK_OUTPUTDIR)/classes, \
605 SUFFIXES:=.class,\
606 INCLUDES:= sun/security/mscapi,\
607 JAR:=$(SUNMSCAPI_JAR_DST), \
608 MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
609 EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
610 SKIP_METAINF := true))
611endif
612
613JARS += $(SUNMSCAPI_JAR_DST)
614
615endif
616
617##########################################################################################
618
erikjaf85fc42012-07-03 16:10:44 -0700619ifeq ($(OPENJDK_TARGET_OS),solaris)
erikje78df742012-06-07 20:40:50 -0700620ifndef OPENJDK
621
622UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
623UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
624
625$(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC)
626 @$(ECHO) "\n>>>Installing prebuilt OracleUcrypto provider..."
627 $(RM) $@
628 $(CP) $< $@
629
630JARS += $(UCRYPTO_JAR_DST)
631
632endif
633endif
634
635##########################################################################################
636
637TOOLS_JAR_INCLUDES := \
638 sun/tools/asm \
639 sun/tools/jar \
640 sun/tools/java \
641 sun/tools/javac \
642 sun/tools/jcmd \
643 sun/tools/jps \
644 sun/tools/jstat \
645 sun/tools/jstatd \
646 sun/tools/native2ascii \
647 sun/tools/serialver \
648 sun/tools/tree \
649 sun/tools/util \
650 sun/security/tools/JarBASE64Encoder.class \
651 sun/security/tools/JarSigner.class \
652 sun/security/tools/JarSignerParameters.class \
653 sun/security/tools/JarSignerResources.class \
654 sun/security/tools/JarSignerResources_ja.class \
655 sun/security/tools/JarSignerResources_zh_CN.class \
656 sun/security/tools/SignatureFile* \
657 sun/security/tools/TimestampedSigner.class \
658 sun/rmi/rmic \
659 sun/applet \
660 sun/jvmstat \
661 com/sun/javadoc \
662 com/sun/jdi \
663 com/sun/jarsigner \
664 com/sun/source \
665 com/sun/tools/classfile \
666 com/sun/tools/doclets \
667 com/sun/tools/example/debug/expr \
668 com/sun/tools/example/debug/tty \
669 com/sun/tools/extcheck \
670 com/sun/tools/hat \
671 com/sun/tools/javac \
672 com/sun/tools/javadoc \
673 com/sun/tools/javah \
674 com/sun/tools/javap \
675 com/sun/tools/corba \
676 com/sun/tools/internal/xjc \
677 com/sun/tools/internal/ws \
678 com/sun/istack/internal/tools \
679 com/sun/tools/internal/jxc/ap \
680 com/sun/tools/internal/ws/wscompile/plugin/at_generated \
681 com/sun/codemodel \
682 com/sun/tools/internal/jxc \
683 com/sun/xml/internal/rngom \
684 com/sun/xml/internal/xsom \
685 org/relaxng/datatype \
686 com/sun/xml/internal/dtdparser \
687 com/sun/tools/jdi \
688 com/sun/tools/script/shell \
689 com/sun/tools/attach \
690 sun/tools/attach \
691 sun/tools/jstack \
692 sun/tools/jinfo \
693 sun/tools/jmap
694
695$(eval $(call SetupArchive,BUILD_TOOLS_JAR,$(TOOLS_JAR_DEPS),\
696 SRCS:=$(JDK_OUTPUTDIR)/classes,\
697 SUFFIXES:=.class .prp .gif .properties .xml .css .xsd .js .html .txt .java \
698 Tool aliasmap options,\
699 INCLUDES:=$(TOOLS_JAR_INCLUDES),\
700 EXTRA_FILES:=META-INF/services/com.sun.jdi.connect.Connector \
701 META-INF/services/com.sun.jdi.connect.spi.TransportService \
702 META-INF/services/com.sun.tools.attach.spi.AttachProvider \
703 META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
704 META-INF/services/com.sun.tools.internal.xjc.Plugin,\
705 JAR:=$(JDK_OUTPUTDIR)/lib/tools.jar,\
erikjaf85fc42012-07-03 16:10:44 -0700706 SKIP_METAINF:=true, \
707 CHECK_COMPRESS_JAR:=true))
erikje78df742012-06-07 20:40:50 -0700708
709JARS+=$(JDK_OUTPUTDIR)/lib/tools.jar
710
711##########################################################################################
712
713include $(JDK_TOPDIR)/makefiles/docs/CORE_PKGS.gmk
714include $(JDK_TOPDIR)/makefiles/docs/NON_CORE_PKGS.gmk
715
716# The compiler should not issue a "Proprietary" warning when compiling
717# classes in the com.sun.java.swing.plaf packages, since we've always
718# allowed, and even advocated, extending them (see bug 6476749).
719#
720# This approach is NOT to be used as a general purpose way to avoid such
721# compiler warnings for non-core packages. The correct way is to document
722# the packages in NON_CORE_PKGS.gmk, and include them in the NON_CORE_PKGS
723# definition.
724#
725# Swing has taken this approach only as a temporary measure to avoid
726# the compiler warnings until we can properly document these packages.
727# This is covered under 6491853.
728EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows \
729 com.sun.java.swing.plaf.motif \
730 com.sun.java.swing.plaf.gtk
731
732#
733# Include the exported private packages in ct.sym.
734# This is an interim solution until the ct.sym is replaced
735# with a new module system (being discussed for JDK 8).
736#
737EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
738 com.oracle.net \
739 com.oracle.nio
740
741$(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(JDK_OUTPUTDIR)/lib/rt.jar
erikjaf85fc42012-07-03 16:10:44 -0700742 $(RM) -rf $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
erikje78df742012-06-07 20:40:50 -0700743 $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
744 $(JAVA) \
745 -Xbootclasspath/a:$(JDK_OUTPUTDIR)/classes \
746 $(JAVAC_JARS) \
747 -XDprocess.packages -proc:only \
748 -processor com.sun.tools.javac.sym.CreateSymbols \
749 -Acom.sun.tools.javac.sym.Jar=$(JDK_OUTPUTDIR)/lib/rt.jar \
750 -Acom.sun.tools.javac.sym.Dest=$(IMAGES_OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
751 $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
752 $(TOUCH) $@
753
754MAKE_SURE_DIR_EXISTS_DUMMY := $(shell $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols)
755$(eval $(call SetupArchive,BUILD_CT_SYM,$(IMAGES_OUTPUTDIR)/symbols/_the.symbols,\
756 SRCS:=$(IMAGES_OUTPUTDIR)/symbols,\
757 INCLUDES:=META-INF/sym,\
erikjaf85fc42012-07-03 16:10:44 -0700758 JAR:=$(JDK_OUTPUTDIR)/lib/ct.sym, \
759 CHECK_COMPRESS_JAR:=true))
erikje78df742012-06-07 20:40:50 -0700760
761JARS+=$(JDK_OUTPUTDIR)/lib/ct.sym
762
763##########################################################################################
764
765SRC_ZIP_INCLUDES = \
766 java/applet \
767 java/awt \
768 java/beans \
769 java/io \
770 java/lang \
771 java/math \
772 java/net \
773 java/nio \
774 java/rmi \
775 java/security \
776 java/sql \
777 java/text \
778 java/util \
779 com/sun/corba \
780 com/sun/image/codec/jpeg \
781 com/sun/imageio \
782 com/sun/java/swing \
783 com/sun/javadoc \
784 com/sun/jmx \
785 com/sun/source \
786 com/sun/naming \
787 com/sun/security/auth \
788 com/sun/security/jgss \
789 javax/accessibility \
790 javax/annotation \
791 javax/script \
792 javax/imageio \
793 javax/lang \
794 javax/management \
795 javax/naming \
796 javax/print \
797 javax/rmi \
798 javax/security \
799 javax/sound \
800 javax/sql \
801 javax/swing \
802 javax/tools \
803 javax/xml \
804 com/sun/org/apache \
805 com/sun/java_cup \
806 com/sun/jlex \
807 org/ietf \
808 org/omg \
809 org/w3c/dom \
810 org/xml/sax \
811 sunw
812
erikjaf85fc42012-07-03 16:10:44 -0700813SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes
erikje78df742012-06-07 20:40:50 -0700814SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
815SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/impsrc
816SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gendocsrc_rmic
817ifndef OPENJDK
818 SRC_ZIP_SRCS += $(JDK_TOPDIR)/src/closed/share/classes
819endif
820
821# Need to copy launcher src files into desired directory structure
822# before zipping the sources.
823LAUNCHER_SRC_FILES := $(wildcard $(JDK_TOPDIR)/src/share/bin/*) \
erikjaf85fc42012-07-03 16:10:44 -0700824 $(wildcard $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin/java_md*)
erikje78df742012-06-07 20:40:50 -0700825LAUNCHER_ZIP_SRC := $(patsubst $(JDK_TOPDIR)/src/share/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
erikjaf85fc42012-07-03 16:10:44 -0700826 $(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
erikje78df742012-06-07 20:40:50 -0700827 $(LAUNCHER_SRC_FILES)))
828
829$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/share/bin/%
830 $(MKDIR) -p $(@D)
831 $(CP) $< $@
832
erikjaf85fc42012-07-03 16:10:44 -0700833$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin/%
erikje78df742012-06-07 20:40:50 -0700834 $(MKDIR) -p $(@D)
835 $(CP) $< $@
836
837$(IMAGES_OUTPUTDIR)/src.zip: $(LAUNCHER_ZIP_SRC)
838
839# This dir needs to exsist before macro is evaluated to avoid warning from find.
840MAKE_SURE_DIR_EXISTS_DUMMY := $(shell $(MKDIR) -p $(IMAGES_OUTPUTDIR)/src)
841$(eval $(call SetupZipArchive,BUILD_SRC_ZIP,\
842 SRC:=$(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src,\
843 INCLUDES:=$(SRC_ZIP_INCLUDES) launcher,\
844 SUFFIXES:=.java .c .h,\
845 ZIP:=$(IMAGES_OUTPUTDIR)/src.zip,\
846 EXTRA_DEPS:=$(LAUNCHER_ZIP_SRC)))
847
848JARS+=$(IMAGES_OUTPUTDIR)/src.zip
849
850##########################################################################################
851
852all: $(JARS)
853
854.PHONY: default all