CreateJars.gmk 28.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include Setup.gmk

default: all

include Tools.gmk

35 36 37 38
#
# This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
#
MAKEFILE=$(JDK_TOPDIR)/makefiles/CreateJars.gmk
39 40 41 42 43 44

MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
BEANMANIFEST := $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest

JARS:=

O
ohair 已提交
45
$(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/lib))
46

O
ohair 已提交
47
##########################################################################################
48

O
ohair 已提交
49
$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,,\
50
		SRCS:=$(JDK_OUTPUTDIR)/classes,\
51
		SUFFIXES:=.class .gif .png .properties,\
52 53
		INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
		JARMAIN:=sun.tools.jconsole.JConsole,\
O
ohair 已提交
54
		JAR:=$(IMAGES_OUTPUTDIR)/lib/jconsole.jar,\
55 56
		SKIP_METAINF:=true))

O
ohair 已提交
57
JARS+=$(IMAGES_OUTPUTDIR)/lib/jconsole.jar
58 59 60

##########################################################################################

O
ohair 已提交
61
$(eval $(call SetupArchive,BUILD_DNS_JAR,,\
62 63 64
		SRCS:=$(JDK_OUTPUTDIR)/classes,\
		INCLUDES:=sun/net/spi/nameservice/dns,\
		EXTRA_FILES:=META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor,\
O
ohair 已提交
65
		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar,\
66 67
		SKIP_METAINF:=true))

O
ohair 已提交
68
JARS+=$(IMAGES_OUTPUTDIR)/lib/ext/dnsns.jar
69 70 71

##########################################################################################

72 73 74
LOCALEDATA_INCLUDE_LOCALES := ar hi iw ja ko th vi zh
LOCALEDATA_INCLUDES := $(addprefix sun/text/resources/,$(LOCALEDATA_INCLUDE_LOCALES)) \
		       $(addprefix sun/util/resources/,$(LOCALEDATA_INCLUDE_LOCALES))
75 76 77 78 79

$(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\
		SRCS:=$(JDK_OUTPUTDIR)/classes,\
		SUFFIXES:=.class _dict _th,\
		INCLUDES:=$(LOCALEDATA_INCLUDES),\
80
		EXCLUDES:=sun/text/resources/th/BreakIteratorRules_th.class,\
O
ohair 已提交
81
		JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar,\
82 83
		SKIP_METAINF:=true))

O
ohair 已提交
84
JARS+=$(IMAGES_OUTPUTDIR)/lib/ext/localedata.jar
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148

##########################################################################################
# rt.jar and resources.jar are being built in the same way as in the old build. They require
# the files to be in a certain order and converting that is not easy and will not be needed
# in jigsaw anyway.

# Exclude list for rt.jar and resources.jar
RT_JAR_EXCLUDES := \
	com/sun/javadoc \
	com/sun/jdi \
	com/sun/jarsigner \
	com/sun/source \
	com/sun/istack/internal/tools \
	META-INF/services/com.sun.jdi.connect.Connector \
	META-INF/services/com.sun.jdi.connect.spi.TransportService \
	META-INF/services/com.sun.tools.xjc.Plugin \
	com/sun/tools \
	sun/jvmstat \
	sun/nio/cs/ext \
	sun/awt/HKSCS.class \
	sun/awt/motif/X11GB2312\$$$$Decoder.class \
	sun/awt/motif/X11GB2312\$$$$Encoder.class \
	sun/awt/motif/X11GB2312.class \
	sun/awt/motif/X11GBK\$$$$Encoder.class \
	sun/awt/motif/X11GBK.class \
	sun/awt/motif/X11KSC5601\$$$$Decoder.class \
	sun/awt/motif/X11KSC5601\$$$$Encoder.class \
	sun/awt/motif/X11KSC5601.class \
	META-INF/services/java.nio.charset.spi.CharsetProvider \
	sun/rmi/rmic \
	sun/tools/asm \
	sun/tools/java \
	sun/tools/javac \
	com/sun/tools/classfile \
	com/sun/tools/javap \
	sun/tools/jcmd \
	sun/tools/jconsole \
	sun/tools/jps \
	sun/tools/jstat \
	sun/tools/jstatd \
	sun/tools/native2ascii \
	sun/tools/serialver \
	sun/tools/tree \
	sun/tools/util \
	sun/security/tools/JarBASE64Encoder.class \
	sun/security/tools/JarSigner.class \
	sun/security/tools/JarSignerParameters.class \
	sun/security/tools/JarSignerResources.class \
	sun/security/tools/JarSignerResources_ja.class \
	sun/security/tools/JarSignerResources_zh_CN.class \
	sun/security/tools/SignatureFile\$$$$Block.class \
	sun/security/tools/SignatureFile.class \
	sun/security/tools/TimestampedSigner.class \
	sun/security/provider/Sun.class \
	sun/security/rsa/SunRsaSign.class \
	sun/security/ssl \
	sun/security/ec/ECDHKeyAgreement.class \
	sun/security/ec/ECDSASignature\$$$$Raw.class \
	sun/security/ec/ECDSASignature\$$$$SHA1.class \
	sun/security/ec/ECDSASignature\$$$$SHA224.class \
	sun/security/ec/ECDSASignature\$$$$SHA256.class \
	sun/security/ec/ECDSASignature\$$$$SHA384.class \
	sun/security/ec/ECDSASignature\$$$$SHA512.class \
	sun/security/ec/ECDSASignature.class \
149
	sun/security/ec/ECKeyFactory.class \
150 151 152 153
	sun/security/ec/ECKeyPairGenerator.class \
	sun/security/ec/SunEC\$$$$1.class \
	sun/security/ec/SunEC.class \
	sun/security/ec/SunECEntries.class \
154
	sun/security/mscapi \
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
	sun/security/pkcs11 \
	com/sun/net/ssl/internal/ssl \
	javax/crypto \
	sun/security/internal \
	com/sun/crypto/provider \
	META-INF/services/com.sun.tools.attach.spi.AttachProvider \
	com/sun/tools/attach \
	org/relaxng/datatype \
	com/sun/codemodel \
	com/sun/xml/internal/dtdparser \
	com/sun/xml/internal/rngom \
	com/sun/xml/internal/xsom \
	com/sun/tools/script/shell \
	sun/tools/attach \
	sun/tools/jstack \
	sun/tools/jinfo \
	sun/tools/jmap \
	sun/net/spi/nameservice/dns \
	META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
	javax/swing/beaninfo \
	javax/swing/AbstractButtonBeanInfo.class \
	javax/swing/BoxBeanInfo.class \
	javax/swing/JAppletBeanInfo.class \
	javax/swing/JButtonBeanInfo.class \
	javax/swing/JCheckBoxBeanInfo.class \
	javax/swing/JCheckBoxMenuItemBeanInfo.class \
	javax/swing/JColorChooserBeanInfo.class \
	javax/swing/JComboBoxBeanInfo.class \
	javax/swing/JComponentBeanInfo.class \
	javax/swing/JDesktopPaneBeanInfo.class \
	javax/swing/JDialogBeanInfo.class \
	javax/swing/JEditorPaneBeanInfo.class \
	javax/swing/JFileChooserBeanInfo.class \
	javax/swing/JFormattedTextFieldBeanInfo.class \
	javax/swing/JFrameBeanInfo.class \
	javax/swing/JInternalFrameBeanInfo.class \
	javax/swing/JLabelBeanInfo.class \
	javax/swing/JLayeredPaneBeanInfo.class \
	javax/swing/JListBeanInfo.class \
	javax/swing/JMenuBarBeanInfo.class \
	javax/swing/JMenuBeanInfo.class \
	javax/swing/JMenuItemBeanInfo.class \
	javax/swing/JOptionPaneBeanInfo.class \
	javax/swing/JPanelBeanInfo.class \
	javax/swing/JPasswordFieldBeanInfo.class \
	javax/swing/JPopupMenuBeanInfo.class \
	javax/swing/JProgressBarBeanInfo.class \
	javax/swing/JRadioButtonBeanInfo.class \
	javax/swing/JRadioButtonMenuItemBeanInfo.class \
	javax/swing/JScrollBarBeanInfo.class \
	javax/swing/JScrollPaneBeanInfo.class \
	javax/swing/JSeparatorBeanInfo.class \
	javax/swing/JSliderBeanInfo.class \
	javax/swing/JSpinnerBeanInfo.class \
	javax/swing/JSplitPaneBeanInfo.class \
	javax/swing/JTabbedPaneBeanInfo.class \
	javax/swing/JTableBeanInfo.class \
	javax/swing/JTextAreaBeanInfo.class \
	javax/swing/JTextFieldBeanInfo.class \
	javax/swing/JTextPaneBeanInfo.class \
	javax/swing/JToggleButtonBeanInfo.class \
	javax/swing/JToolBarBeanInfo.class \
	javax/swing/JTreeBeanInfo.class \
	javax/swing/JWindowBeanInfo.class \
	javax/swing/SwingBeanInfoBase.class \
	javax/swing/text/JTextComponentBeanInfo.class \
	sun/swing/BeanInfoUtils.class \
222 223 224 225
	$(LOCALEDATA_INCLUDES) \
	sun/text/resources/cldr \
	sun/util/resources/cldr \
	sun/util/cldr/CLDRLocaleDataMetaInfo.class
226

227 228 229 230 231
# These files should never be put into rt.jar
# but due to a misstake...some are put there if embedded
#
ifneq ($(JAVASE_EMBEDDED), true)
# normal (correct) case
232 233 234
RT_JAR_EXCLUDES += \
	com/oracle/jrockit/jfr \
	oracle/jrockit/jfr
235 236 237 238 239 240 241
else
# embedded (broken) case
RT_JAR_EXCLUDES += \
  oracle/jrockit/jfr/parser \
  oracle/jrockit/jfr/tools \
  oracle/jrockit/jfr/NativeOptions.class \
  oracle/jrockit/jfr/RepositoryChunkHandler.class
242
endif
243 244 245 246 247 248 249 250 251 252 253 254 255

ifeq ($(OPENJDK_TARGET_OS), macosx)
        RT_JAR_EXCLUDES += com/sun/nio/sctp \
                           sun/nio/ch/sctp \
                           sun/jdbc \
                           sun/nio/ch/DevPollArrayWrapper\$$$$Updator.class \
                           sun/nio/ch/DevPollArrayWrapper.class \
                           sun/nio/ch/DevPollSelectorImpl.class \
                           sun/nio/ch/DevPollSelectorProvider.class \
                           sun/nio/ch/EPollArrayWrapper\$$$$Updator.class \
                           sun/nio/ch/EPollArrayWrapper.class \
                           sun/nio/ch/EPollSelectorImpl.class \
                           sun/nio/ch/EPollSelectorProvider.class
256 257 258 259
endif

# Find all files in the classes dir to use as dependencies. This could be more fine granular.
ALL_FILES_IN_CLASSES := $(shell $(FIND) $(JDK_OUTPUTDIR)/classes -type f \
260
			| $(GREP) -v -e '/_the\.*' -e '^_the\.*' -e 'javac_state')
261

O
ohair 已提交
262 263
RT_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib/_the.rt.jar_manifest
RESOURCE_JAR_MANIFEST_FILE := $(IMAGES_OUTPUTDIR)/lib/_the.resources.jar_manifest
264 265 266

$(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
	$(MKDIR) -p $(@D)
267
	$(RM) $@ $@.tmp
268 269
	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
270 271 272 273
	       $(MAINMANIFEST) >> $@.tmp
	$(ECHO) >> $@.tmp
	$(CAT) $(BEANMANIFEST) >> $@.tmp
	$(MV) $@.tmp $@
274 275 276

$(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
	$(MKDIR) -p $(@D)
277
	$(RM) $@ $@.tmp
278 279
	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
280 281
	       $(MAINMANIFEST) >> $@.tmp
	$(MV) $@.tmp $@
282

O
ohair 已提交
283
$(IMAGES_OUTPUTDIR)/lib/_the.jars.exclude: $(MAKEFILE)
284
	$(MKDIR) -p $(@D)
285 286 287
	$(RM) $@ $@.tmp
	$(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@.tmp)
	$(MV) $@.tmp $@
288

O
ohair 已提交
289
$(IMAGES_OUTPUTDIR)/lib/classlist : $(JDK_TOPDIR)/make/tools/sharing/classlist.$(OPENJDK_TARGET_OS) \
290 291
  $(MAKEFILE)
	$(MKDIR) -p $(@D)
292 293 294
	$(RM) $@ $@.tmp
	$(TOOL_ADDJSUM) $< $@.tmp
	$(MV) $@.tmp $@
295

O
ohair 已提交
296 297
$(IMAGES_OUTPUTDIR)/lib/_the.jars.contents: $(BUILD_TOOLS) $(IMAGES_OUTPUTDIR)/lib/_the.jars.exclude \
					 $(ALL_FILES_IN_CLASSES) $(IMAGES_OUTPUTDIR)/lib/classlist
298
	$(MKDIR) -p $(@D)
299
	$(RM) $@ $@.tmp
300 301
	($(CD) $(JDK_OUTPUTDIR)/classes && \
	    $(TOOL_JARREORDER) \
O
ohair 已提交
302
		-o  $@.tmp $(IMAGES_OUTPUTDIR)/lib/classlist $(IMAGES_OUTPUTDIR)/lib/_the.jars.exclude . )
303
	$(MV) $@.tmp $@
304

O
ohair 已提交
305
$(IMAGES_OUTPUTDIR)/lib/_the.rt.jar.contents: $(IMAGES_OUTPUTDIR)/lib/_the.jars.contents
306 307
	$(MKDIR) -p $(@D)
	$(RM) $@ $@.tmp
O
ohair 已提交
308
	$(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib/_the.jars.contents > $@.tmp
309
	$(MV) $@.tmp $@
310

O
ohair 已提交
311
$(IMAGES_OUTPUTDIR)/lib/_the.resources.jar.contents: $(IMAGES_OUTPUTDIR)/lib/_the.jars.contents
312 313 314 315
	$(MKDIR) -p $(@D)
	$(RM) $@ $@.tmp
	$(GREP) -v -e '\.class$$' \
	    -e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \
O
ohair 已提交
316
	    $(IMAGES_OUTPUTDIR)/lib/_the.jars.contents > $@.tmp
317
	$(MV) $@.tmp $@
318

319 320 321 322 323
RT_JAR_CREATE_OPTIONS := c0fm
ifeq ($(COMPRESS_JARS), true)
    RT_JAR_CREATE_OPTIONS := cfm
endif

O
ohair 已提交
324
$(IMAGES_OUTPUTDIR)/lib/rt.jar: $(IMAGES_OUTPUTDIR)/lib/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE)
325
	$(ECHO) Creating rt.jar
326 327
	$(MKDIR) -p $(@D)
	$(RM) $@ $@.tmp
328
	$(CD) $(JDK_OUTPUTDIR)/classes && \
329
	    $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RT_JAR_MANIFEST_FILE) \
O
ohair 已提交
330
	        @$(IMAGES_OUTPUTDIR)/lib/_the.rt.jar.contents
331
	$(MV) $@.tmp $@
332

O
ohair 已提交
333
$(IMAGES_OUTPUTDIR)/lib/resources.jar: $(IMAGES_OUTPUTDIR)/lib/_the.resources.jar.contents \
334 335
				    $(RESOURCE_JAR_MANIFEST_FILE)
	$(ECHO) Creating resources.jar
336 337
	$(MKDIR) -p $(@D)
	$(RM) $@ $@.tmp
338
	$(CD) $(JDK_OUTPUTDIR)/classes && \
339
	    $(JAR) $(RT_JAR_CREATE_OPTIONS) $@.tmp $(RESOURCE_JAR_MANIFEST_FILE) \
O
ohair 已提交
340
	        @$(IMAGES_OUTPUTDIR)/lib/_the.resources.jar.contents
341
	$(MV) $@.tmp $@
342

O
ohair 已提交
343
JARS+=$(IMAGES_OUTPUTDIR)/lib/rt.jar $(IMAGES_OUTPUTDIR)/lib/resources.jar
344 345 346

##########################################################################################

347
ifneq ($(OPENJDK_TARGET_OS), windows)
348 349 350 351 352 353 354 355 356 357
    CHARSETS_EXTRA_FILES:=sun/awt/motif/X11GBK.class \
                          sun/awt/motif/X11GB2312\$$$$Decoder.class \
                          sun/awt/motif/X11GB2312.class \
                          sun/awt/motif/X11KSC5601\$$$$Decoder.class \
                          sun/awt/motif/X11KSC5601\$$$$Encoder.class \
                          sun/awt/motif/X11GB2312\$$$$Encoder.class \
                          sun/awt/motif/X11GBK\$$$$Encoder.class \
                          sun/awt/motif/X11KSC5601.class
endif

O
ohair 已提交
358
$(eval $(call SetupArchive,BUILD_CHARSETS_JAR,,\
359 360 361 362 363 364
		SRCS:=$(JDK_OUTPUTDIR)/classes, \
		SUFFIXES:=.class .dat,\
		INCLUDES:=sun/nio/cs/ext,\
		EXTRA_FILES := sun/awt/HKSCS.class \
			       $(CHARSETS_EXTRA_FILES) \
                               META-INF/services/java.nio.charset.spi.CharsetProvider, \
O
ohair 已提交
365
		JAR:=$(IMAGES_OUTPUTDIR)/lib/charsets.jar, \
366 367
		SKIP_METAINF := true, \
                CHECK_COMPRESS_JAR:=true))
368

O
ohair 已提交
369
JARS+=$(IMAGES_OUTPUTDIR)/lib/charsets.jar
370 371 372

##########################################################################################

O
ohair 已提交
373
ifndef OPENJDK
374
ifeq ($(ENABLE_JFR), true)
375 376 377 378
    $(eval $(call SetupArchive,BUILD_JFR_JAR,,\
		SRCS:=$(JDK_OUTPUTDIR)/classes,\
		INCLUDES:=com/oracle/jrockit/jfr \
			  oracle/jrockit/jfr,\
O
ohair 已提交
379
		JAR:=$(IMAGES_OUTPUTDIR)/lib/jfr.jar,\
380
		SKIP_METAINF:=true,\
381 382
		MANIFEST:=$(MAINMANIFEST), \
                CHECK_COMPRESS_JAR:=true))
383

O
ohair 已提交
384 385
    JARS+=$(IMAGES_OUTPUTDIR)/lib/jfr.jar
endif
386 387 388 389 390 391 392 393 394 395
endif

##########################################################################################

$(eval $(call SetupArchive,BUILD_JSSE_JAR,,\
		SRCS:=$(JDK_OUTPUTDIR)/classes,\
		INCLUDES:=sun/security/provider/Sun.class \
			  sun/security/rsa/SunRsaSign.class \
			  sun/security/ssl \
			  com/sun/net/ssl/internal/ssl,\
O
ohair 已提交
396
		JAR:=$(IMAGES_OUTPUTDIR)/lib/jsse.jar,\
397
		SKIP_METAINF:=true,\
398 399
		MANIFEST:=$(MAINMANIFEST), \
                CHECK_COMPRESS_JAR:=true))
400

O
ohair 已提交
401
JARS+=$(IMAGES_OUTPUTDIR)/lib/jsse.jar
402 403 404

##########################################################################################

O
ohair 已提交
405
SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar
406

407
ifndef OPENJDK
408

409
    SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
410

411
    $(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_SRC)
O
ohair 已提交
412
	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
413 414 415
	$(MKDIR) -p $(@D)
	$(RM) $@
	$(CP) $< $@
416

417
else
418

O
ohair 已提交
419
    $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR,,\
420 421 422 423 424
	SRCS:=$(JDK_OUTPUTDIR)/classes, \
	SUFFIXES:=.class,\
	INCLUDES:=sun/security/pkcs11,\
	JAR:=$(SUNPKCS11_JAR_DST), \
	SKIP_METAINF := true))
425 426 427

endif

428 429
JARS += $(SUNPKCS11_JAR_DST)

430 431
##########################################################################################

O
ohair 已提交
432
SUNEC_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunec.jar
433 434 435 436 437 438

ifndef OPENJDK

SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar

$(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
O
ohair 已提交
439
	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
440
	$(MKDIR) -p $(@D)
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464
	$(RM) $@
	$(CP) $< $@

else

$(eval $(call SetupArchive,BUILD_SUNEC_JAR,,\
		SRCS:=$(JDK_OUTPUTDIR)/classes, \
		SUFFIXES:=.class,\
		INCLUDES:=sun/security/ec,\
		JAR:=$(SUNEC_JAR_DST), \
		SKIP_METAINF := true))

endif

JARS += $(SUNEC_JAR_DST)

##########################################################################################

$(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR,,\
		SRCS:=$(JDK_OUTPUTDIR)/classes,\
		SUFFIXES:=BeanInfo.class .gif,\
		INCLUDES:=javax/swing sun/swing,\
		EXCLUDES:=javax/swing/plaf,\
		EXTRA_FILES:=javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class,\
O
ohair 已提交
465
		JAR:=$(IMAGES_OUTPUTDIR)/lib/dt.jar,\
466 467
		SKIP_METAINF:=true))

O
ohair 已提交
468
JARS+=$(IMAGES_OUTPUTDIR)/lib/dt.jar
469 470 471

##########################################################################################

O
ohair 已提交
472
SUNJCE_PROVIDER_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunjce_provider.jar
473 474 475 476 477

ifndef OPENJDK
    SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar

    $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_SRC)
O
ohair 已提交
478
	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
479
	$(MKDIR) -p $(@D)
480 481 482 483
	$(RM) $@
	$(CP) $< $@
else

O
ohair 已提交
484
    $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR,,\
485 486 487 488 489 490 491 492 493 494 495
		SRCS:=$(JDK_OUTPUTDIR)/classes, \
		SUFFIXES:=.class,\
		INCLUDES:= com/sun/crypto/provider,\
		JAR:=$(SUNJCE_PROVIDER_JAR_DST), \
		MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
		EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
		SKIP_METAINF := true))
endif

JARS += $(SUNJCE_PROVIDER_JAR_DST)

O
ohair 已提交
496
JCE_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/jce.jar
497 498 499 500 501 502

ifndef OPENJDK

JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar

$(JCE_JAR_DST) : $(JCE_JAR_SRC)
O
ohair 已提交
503
	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
504
	$(MKDIR) -p $(@D)
505 506 507 508 509
	$(RM) $@
	$(CP) $< $@

else

O
ohair 已提交
510
$(eval $(call SetupArchive,BUILD_JCE_JAR,,\
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529
		SRCS:=$(JDK_OUTPUTDIR)/classes, \
		SUFFIXES:=.class,\
		INCLUDES:= javax/crypto sun/security/internal,\
		JAR:=$(JCE_JAR_DST), \
		MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
		EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
		SKIP_METAINF := true))
endif

JARS += $(JCE_JAR_DST)

##########################################################################################

ifdef OPENJDK

#
# TODO fix so that SetupArchive does not write files into SRCS
#   then we don't need this extra copying
#
O
ohair 已提交
530
US_EXPORT_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/US_export_policy.jar
531
US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
O
ohair 已提交
532
US_EXPORT_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/US_export_policy_jar.tmp
533 534 535

$(US_EXPORT_POLICY_JAR_TMP)/% : $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
	$(MKDIR) -p $(@D)
536
	$(RM) $@
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560
	$(CP) $< $@

US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy

$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR,$(US_EXPORT_POLICY_JAR_DEPS),\
		SRCS:=$(US_EXPORT_POLICY_JAR_TMP), \
		SUFFIXES:= .policy,\
		JAR:=$(US_EXPORT_POLICY_JAR_DST), \
		EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
		SKIP_METAINF := true))

JARS += $(US_EXPORT_POLICY_JAR_DST)

endif

##########################################################################################


ifdef OPENJDK

#
# TODO fix so that SetupArchive does not write files into SRCS
#   then we don't need this extra copying
#
O
ohair 已提交
561
LOCAL_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/local_policy.jar
562
LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
O
ohair 已提交
563
LOCAL_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/local_policy_jar.tmp
564

O
ohair 已提交
565 566
LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
			 $(LOCAL_POLICY_JAR_TMP)/default_local.policy
567 568 569

$(LOCAL_POLICY_JAR_TMP)/% : $(LOCAL_POLICY_JAR_SRC_DIR)/%
	$(MKDIR) -p $(@D)
570
	$(RM) $@
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585
	$(CP) $< $@

$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR,$(LOCAL_POLICY_JAR_DEPS),\
		SRCS:=$(LOCAL_POLICY_JAR_TMP),\
		SUFFIXES:= .policy,\
		JAR:=$(LOCAL_POLICY_JAR_DST), \
		EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
		SKIP_METAINF := true))

JARS += $(LOCAL_POLICY_JAR_DST)

endif

##########################################################################################

586
ifeq ($(OPENJDK_TARGET_OS),windows)
587

O
ohair 已提交
588
SUNMSCAPI_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar
589 590 591 592 593

ifndef OPENJDK
SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar

$(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_SRC)
O
ohair 已提交
594
	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
595
	$(MKDIR) -p $(@D)
596 597 598 599 600
	$(RM) $@
	$(CP) $< $@

else

O
ohair 已提交
601
$(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR,,\
602 603 604 605
		SRCS:=$(JDK_OUTPUTDIR)/classes, \
		SUFFIXES:=.class,\
		INCLUDES:= sun/security/mscapi,\
		JAR:=$(SUNMSCAPI_JAR_DST), \
606
		SKIP_METAINF:=true))
607 608 609 610 611 612 613 614
endif

JARS += $(SUNMSCAPI_JAR_DST)

endif

##########################################################################################

615
ifeq ($(OPENJDK_TARGET_OS),solaris)
616 617
ifndef OPENJDK

O
ohair 已提交
618
UCRYPTO_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar
619 620 621
UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar

$(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC)
O
ohair 已提交
622
	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
623
	$(MKDIR) -p $(@D)
624 625 626 627 628 629 630 631 632 633
	$(RM) $@
	$(CP) $< $@

JARS += $(UCRYPTO_JAR_DST)

endif
endif

##########################################################################################

634 635 636
# Get the CLDRVERSION
include GensrcCLDR.gmk

O
ohair 已提交
637
CLDRDATA_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/cldrdata.jar
638

O
ohair 已提交
639
$(eval $(call SetupArchive,BUILD_CLDRDATA_JAR,,\
640 641 642 643 644 645 646 647 648 649 650 651 652 653
		SRCS:=$(JDK_OUTPUTDIR)/classes,\
		SUFFIXES:=.class,\
		INCLUDES:=sun/text/resources/cldr \
			  sun/util/cldr \
			  sun/util/resources/cldr,\
		EXCLUDES:=sun/util/cldr/CLDRLocaleProviderAdapter,\
		JAR:=$(CLDRDATA_JAR_DST),\
		EXTRA_MANIFEST_ATTR:=CLDR-Version: $(CLDRVERSION),\
		SKIP_METAINF:=true))

JARS += $(CLDRDATA_JAR_DST)

##########################################################################################

654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711
TOOLS_JAR_INCLUDES := \
	sun/tools/asm		\
	sun/tools/jar		\
	sun/tools/java		\
	sun/tools/javac		\
	sun/tools/jcmd		\
	sun/tools/jps		\
	sun/tools/jstat		\
	sun/tools/jstatd	\
	sun/tools/native2ascii	\
	sun/tools/serialver	\
	sun/tools/tree		\
	sun/tools/util		\
	sun/security/tools/JarBASE64Encoder.class \
	sun/security/tools/JarSigner.class \
	sun/security/tools/JarSignerParameters.class \
	sun/security/tools/JarSignerResources.class \
	sun/security/tools/JarSignerResources_ja.class \
	sun/security/tools/JarSignerResources_zh_CN.class \
	sun/security/tools/SignatureFile* \
	sun/security/tools/TimestampedSigner.class \
	sun/rmi/rmic		\
	sun/applet		\
	sun/jvmstat		\
	com/sun/javadoc		\
	com/sun/jdi		\
	com/sun/jarsigner	\
	com/sun/source          \
	com/sun/tools/classfile \
	com/sun/tools/doclets   \
	com/sun/tools/example/debug/expr \
	com/sun/tools/example/debug/tty  \
	com/sun/tools/extcheck  \
	com/sun/tools/hat       \
	com/sun/tools/javac     \
	com/sun/tools/javadoc   \
	com/sun/tools/javah     \
	com/sun/tools/javap     \
	com/sun/tools/corba     \
	com/sun/tools/internal/xjc       \
	com/sun/tools/internal/ws       \
	com/sun/istack/internal/tools       \
	com/sun/tools/internal/jxc/ap   \
	com/sun/tools/internal/ws/wscompile/plugin/at_generated \
        com/sun/codemodel       \
        com/sun/tools/internal/jxc             \
        com/sun/xml/internal/rngom       \
        com/sun/xml/internal/xsom       \
        org/relaxng/datatype   \
	com/sun/xml/internal/dtdparser \
	com/sun/tools/jdi	\
	com/sun/tools/script/shell	\
	com/sun/tools/attach	\
	sun/tools/attach	\
	sun/tools/jstack        \
	sun/tools/jinfo         \
	sun/tools/jmap

O
ohair 已提交
712 713 714 715
# The sjavac tools is not ready for public consumption.
TOOLS_JAR_EXCLUDES=com/sun/tools/sjavac

$(eval $(call SetupArchive,BUILD_TOOLS_JAR,,\
716 717 718 719
		SRCS:=$(JDK_OUTPUTDIR)/classes,\
		SUFFIXES:=.class .prp .gif .properties .xml .css .xsd .js .html .txt .java \
			  Tool aliasmap options,\
		INCLUDES:=$(TOOLS_JAR_INCLUDES),\
O
ohair 已提交
720
		EXCLUDES:=$(TOOLS_JAR_EXCLUDES),\
721 722 723 724 725
		EXTRA_FILES:=META-INF/services/com.sun.jdi.connect.Connector \
			     META-INF/services/com.sun.jdi.connect.spi.TransportService \
			     META-INF/services/com.sun.tools.attach.spi.AttachProvider \
			     META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
			     META-INF/services/com.sun.tools.internal.xjc.Plugin,\
O
ohair 已提交
726
		JAR:=$(IMAGES_OUTPUTDIR)/lib/tools.jar,\
727 728
		SKIP_METAINF:=true, \
                CHECK_COMPRESS_JAR:=true))
729

O
ohair 已提交
730
JARS+=$(IMAGES_OUTPUTDIR)/lib/tools.jar
731 732 733

##########################################################################################

734 735
include javadoc/CORE_PKGS.gmk
include javadoc/NON_CORE_PKGS.gmk
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761

# The compiler should not issue a "Proprietary" warning when compiling
# classes in the com.sun.java.swing.plaf packages, since we've always
# allowed, and even advocated, extending them (see bug 6476749).
#
# This approach is NOT to be used as a general purpose way to avoid such
# compiler warnings for non-core packages. The correct way is to document
# the packages in NON_CORE_PKGS.gmk, and include them in the NON_CORE_PKGS
# definition.
#
# Swing has taken this approach only as a temporary measure to avoid
# the compiler warnings until we can properly document these packages.
# This is covered under 6491853.
EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows  \
                        com.sun.java.swing.plaf.motif    \
                        com.sun.java.swing.plaf.gtk

#
# Include the exported private packages in ct.sym.
# This is an interim solution until the ct.sym is replaced
# with a new module system (being discussed for JDK 8).
#
EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
                        com.oracle.net \
                        com.oracle.nio

O
ohair 已提交
762
$(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
763
	$(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
764 765 766 767 768 769
	$(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
	$(JAVA) \
		-Xbootclasspath/a:$(JDK_OUTPUTDIR)/classes \
		$(JAVAC_JARS) \
	    -XDprocess.packages -proc:only \
	    -processor com.sun.tools.javac.sym.CreateSymbols \
O
ohair 已提交
770
	    -Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \
771 772 773 774
	    -Acom.sun.tools.javac.sym.Dest=$(IMAGES_OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
	$(TOUCH) $@

O
ohair 已提交
775
$(shell $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols)
776 777 778
$(eval $(call SetupArchive,BUILD_CT_SYM,$(IMAGES_OUTPUTDIR)/symbols/_the.symbols,\
		SRCS:=$(IMAGES_OUTPUTDIR)/symbols,\
		INCLUDES:=META-INF/sym,\
O
ohair 已提交
779
		JAR:=$(IMAGES_OUTPUTDIR)/lib/ct.sym, \
780
		CHECK_COMPRESS_JAR:=true))
781

O
ohair 已提交
782
JARS+=$(IMAGES_OUTPUTDIR)/lib/ct.sym
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830

##########################################################################################

SRC_ZIP_INCLUDES = \
	java/applet			\
	java/awt			\
	java/beans			\
	java/io				\
	java/lang			\
	java/math			\
	java/net			\
	java/nio			\
	java/rmi			\
	java/security			\
	java/sql			\
	java/text			\
	java/util			\
	com/sun/corba			\
	com/sun/image/codec/jpeg	\
	com/sun/imageio                 \
	com/sun/java/swing		\
	com/sun/javadoc			\
	com/sun/jmx			\
	com/sun/source			\
	com/sun/naming			\
	com/sun/security/auth		\
	com/sun/security/jgss		\
	javax/accessibility		\
	javax/annotation		\
	javax/script			\
	javax/imageio			\
	javax/lang			\
	javax/management		\
	javax/naming			\
	javax/print			\
	javax/rmi			\
	javax/security			\
	javax/sound			\
	javax/sql			\
	javax/swing			\
	javax/tools			\
	javax/xml			\
	com/sun/org/apache		\
	com/sun/java_cup		\
	com/sun/jlex	        	\
	org/ietf			\
	org/omg				\
	org/w3c/dom			\
831 832
	org/xml/sax			\
	sunw
833

834
SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes
835 836 837 838 839 840 841 842 843 844
SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/impsrc
SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gendocsrc_rmic
ifndef OPENJDK
  SRC_ZIP_SRCS += $(JDK_TOPDIR)/src/closed/share/classes
endif

# Need to copy launcher src files into desired directory structure
# before zipping the sources.
LAUNCHER_SRC_FILES := $(wildcard $(JDK_TOPDIR)/src/share/bin/*) \
845
                      $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/java_md*)
846
LAUNCHER_ZIP_SRC := $(patsubst $(JDK_TOPDIR)/src/share/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
847
		    $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
848 849 850 851
			$(LAUNCHER_SRC_FILES)))

$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/share/bin/%
	$(MKDIR) -p $(@D)
852
	$(RM) $@
853 854
	$(CP) $< $@

855
$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%
856
	$(MKDIR) -p $(@D)
857
	$(RM) $@
858 859 860 861
	$(CP) $< $@

$(IMAGES_OUTPUTDIR)/src.zip: $(LAUNCHER_ZIP_SRC)

O
ohair 已提交
862 863
# This dir needs to exist before macro is evaluated to avoid warning from find.
$(eval $(call MakeDir,$(IMAGES_OUTPUTDIR)/src))
864 865 866
$(eval $(call SetupZipArchive,BUILD_SRC_ZIP,\
		SRC:=$(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src,\
		INCLUDES:=$(SRC_ZIP_INCLUDES) launcher,\
O
ohair 已提交
867
		EXCLUDES:=javax/swing/beaninfo,\
868 869 870 871 872 873 874 875
		SUFFIXES:=.java .c .h,\
		ZIP:=$(IMAGES_OUTPUTDIR)/src.zip,\
		EXTRA_DEPS:=$(LAUNCHER_ZIP_SRC)))

JARS+=$(IMAGES_OUTPUTDIR)/src.zip

##########################################################################################

876 877 878 879
-include $(CUSTOM_MAKE_DIR)/CreateJars.gmk

##########################################################################################

880 881 882
all: $(JARS)

.PHONY: default all