blob: 93ca5a5f16dbdaf526f061226dca6568289e8fb8 [file] [log] [blame]
ihse554e46f2013-11-14 11:19:32 +01001#
lanaf3d11f62013-12-26 12:04:16 -08002# Copyright (c) 2011, 2013, 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
26default: all
27
28include $(SPEC)
29include MakeBase.gmk
30include JavaCompilation.gmk
31
32# Setup the java compilers for the JDK build.
33include Setup.gmk
34
35JARS :=
36EXFILES :=
37EXCLUDES :=
38
39##########################################################################################
rriggsb762ad22014-10-31 14:28:38 -040040# Include the corresponding custom file, if present.
41
42-include $(CUSTOM_MAKE_DIR)/CompileJavaClasses.gmk
43
44##########################################################################################
ihse554e46f2013-11-14 11:19:32 +010045
46EXCLUDES += com/sun/pept \
47 com/sun/tools/example/trace \
48 com/sun/tools/example/debug/bdi \
49 com/sun/tools/example/debug/event \
50 com/sun/tools/example/debug/gui
51
52ifdef OPENJDK
53 EXCLUDES += sun/dc \
54 com/sun/jmx/snmp \
55 sun/management/snmp \
56 com/sun/script
57endif
58
59ifndef OPENJDK
bchristi1b5865d2014-06-27 12:17:58 -070060 # There exists two versions of these files...
rriggsb762ad22014-10-31 14:28:38 -040061 EXFILES += $(JDK_TOPDIR)/src/share/classes/javax/crypto/JarVerifier.java
bchristi1b5865d2014-06-27 12:17:58 -070062 EXFILES += $(JDK_TOPDIR)/src/share/classes/sun/management/ExtendedPlatformComponent.java
ihse554e46f2013-11-14 11:19:32 +010063
64 ifeq ($(OPENJDK_TARGET_OS), windows)
65 # This gets built on unix platforms implicitly in the old build even though
66 # it's excluded in the closed build.
67 EXCLUDES += sun/java2d/pisces
68
69 # AccessBridge is compiled separately below.
70 EXFILES += AccessBridge.java \
71 AccessBridgeLoader.java \
72 com/sun/java/accessibility/util/java/awt/ChoiceTranslator.java
73 # This seems to never be built
74 EXCLUDES += com/sun/java/accessibility/extensions
75 endif
76
77endif
78
79ifneq ($(OPENJDK_TARGET_OS), solaris)
80 # Exclude Solaris nio and two security related files in src/share/classes
81 EXFILES += SolarisAclFileAttributeView.java \
82 SolarisFileStore.java \
83 SolarisFileSystem.java \
84 SolarisFileSystemProvider.java \
85 SolarisNativeDispatcher.java \
86 SolarisUserDefinedFileAttributeView.java \
87 SolarisWatchService.java \
88 SolarisAclFileAttributeView.java \
89 SolarisLoginModule.java \
90 SolarisSystem.java \
91 sun/nio/ch/DevPollArrayWrapper.java \
92 sun/nio/ch/DevPollSelectorImpl.java \
93 sun/nio/ch/DevPollSelectorProvider.java \
94 sun/nio/ch/EventPortSelectorImpl.java \
95 sun/nio/ch/EventPortSelectorProvider.java \
96 sun/nio/ch/EventPortWrapper.java \
97 sun/nio/ch/SolarisAsynchronousChannelProvider.java \
98 sun/nio/ch/SolarisEventPort.java \
99 sun/tools/attach/SolarisAttachProvider.java \
100 sun/tools/attach/SolarisVirtualMachine.java
101
102 EXCLUDES += com/oracle/security
103endif
104
105EXFILES += WrapperGenerator.java
106
107ifneq ($(OPENJDK_TARGET_OS), windows)
108 # Exclude Window security related files in src/share/classes
109 EXFILES += NTLoginModule.java \
110 NTSystem.java
111else
112 EXFILES += UnixLoginModule.java \
113 UnixSystem.java
114endif
115
116ifeq ($(OPENJDK_TARGET_OS), windows)
117 # Don't build GTK L&F on Windows
118 EXCLUDES += com/sun/java/swing/plaf/gtk
119endif
120
121ifneq ($(OPENJDK_TARGET_OS), linux)
122 EXFILES += sun/tools/attach/LinuxAttachProvider.java \
123 sun/tools/attach/LinuxVirtualMachine.java \
124 sun/nio/ch/EPoll.java \
125 sun/nio/ch/EPollArrayWrapper.java \
126 sun/nio/ch/EPollPort.java \
127 sun/nio/ch/EPollSelectorImpl.java \
128 sun/nio/ch/EPollSelectorProvider.java \
129 sun/nio/ch/LinuxAsynchronousChannelProvider.java \
130 sun/nio/fs/LinuxDosFileAttributeView.java \
131 sun/nio/fs/LinuxFileStore.java \
132 sun/nio/fs/LinuxFileSystem.java \
133 sun/nio/fs/LinuxFileSystemProvider.java \
134 sun/nio/fs/MagicFileTypeDetector.java \
135 sun/nio/fs/LinuxNativeDispatcher.java \
136 sun/nio/fs/LinuxUserDefinedFileAttributeView.java \
137 sun/nio/fs/LinuxWatchService.java
138endif
139
140ifneq ($(OPENJDK_TARGET_OS), macosx)
141 EXFILES += sun/nio/ch/BsdAsynchronousChannelProvider.java \
142 sun/nio/ch/KQueue.java \
143 sun/nio/ch/KQueuePort.java \
144 sun/nio/fs/BsdFileStore.java \
145 sun/nio/fs/BsdFileSystem.java \
146 sun/nio/fs/BsdFileSystemProvider.java \
147 sun/nio/fs/BsdNativeDispatcher.java \
148 sun/nio/fs/MacOSXFileSystemProvider.java \
149 sun/nio/fs/MacOSXFileSystem.java \
150 sun/nio/fs/MacOSXNativeDispatcher.java \
151 sun/tools/attach/BsdAttachProvider.java \
152 sun/tools/attach/BsdVirtualMachine.java
153endif
154
kvn7130df72013-12-05 15:10:36 -0800155ifneq ($(OPENJDK_TARGET_OS),aix)
156 EXFILES+=sun/nio/ch/AixAsynchronousChannelProvider.java \
157 sun/nio/ch/AixPollPort.java \
158 sun/nio/fs/AixFileStore.java \
159 sun/nio/fs/AixFileSystem.java \
160 sun/nio/fs/AixFileSystemProvider.java \
161 sun/nio/fs/AixNativeDispatcher.java \
162 sun/tools/attach/AixAttachProvider.java \
163 sun/tools/attach/AixVirtualMachine.java
164endif
165
ihse554e46f2013-11-14 11:19:32 +0100166# Exclude BreakIterator classes that are just used in compile process to generate
167# data files and shouldn't go in the product
168EXFILES += sun/text/resources/BreakIteratorRules.java \
169 sun/text/resources/BreakIteratorRules_th.java
170
171# TODO: Add BUILD_HEADLESS_ONLY to configure?
172ifdef BUILD_HEADLESS_ONLY
173 EXCLUDES += sun/applet
174endif
175
176ifdef OPENJDK
177 EXCLUDES += sun/java2d/cmm/kcms
178endif
179
180# Used on windows and macosx
181ifeq (, $(filter $(OPENJDK_TARGET_OS), windows macosx))
182 EXFILES += sun/awt/AWTCharset.java
183endif
184
185ifeq ($(OPENJDK_TARGET_OS), macosx)
186 # exclude all X11 on Mac, we can't exclude some like below or we'll have compilation errors
187 EXCLUDES += sun/awt/X11
188else
189 # TBD: figure out how to eliminate this long list
190 EXFILES += sun/awt/X11/ScreenFormat.java \
191 sun/awt/X11/XArc.java \
192 sun/awt/X11/XChar2b.java \
193 sun/awt/X11/XCharStruct.java \
194 sun/awt/X11/XClassHint.java \
195 sun/awt/X11/XComposeStatus.java \
196 sun/awt/X11/XExtCodes.java \
197 sun/awt/X11/XFontProp.java \
198 sun/awt/X11/XFontSetExtents.java \
199 sun/awt/X11/XFontStruct.java \
200 sun/awt/X11/XGCValues.java \
201 sun/awt/X11/XHostAddress.java \
202 sun/awt/X11/XIMCallback.java \
203 sun/awt/X11/XIMHotKeyTrigger.java \
204 sun/awt/X11/XIMHotKeyTriggers.java \
205 sun/awt/X11/XIMPreeditCaretCallbackStruct.java \
206 sun/awt/X11/XIMPreeditDrawCallbackStruct.java \
207 sun/awt/X11/XIMPreeditStateNotifyCallbackStruct.java \
208 sun/awt/X11/XIMStatusDrawCallbackStruct.java \
209 sun/awt/X11/XIMStringConversionCallbackStruct.java \
210 sun/awt/X11/XIMStringConversionText.java \
211 sun/awt/X11/XIMStyles.java \
212 sun/awt/X11/XIMText.java \
213 sun/awt/X11/XIMValuesList.java \
214 sun/awt/X11/XImage.java \
215 sun/awt/X11/XKeyboardControl.java \
216 sun/awt/X11/XKeyboardState.java \
217 sun/awt/X11/XOMCharSetList.java \
218 sun/awt/X11/XOMFontInfo.java \
219 sun/awt/X11/XOMOrientation.java \
220 sun/awt/X11/XPoint.java \
221 sun/awt/X11/XRectangle.java \
222 sun/awt/X11/XSegment.java \
223 sun/awt/X11/XStandardColormap.java \
224 sun/awt/X11/XTextItem.java \
225 sun/awt/X11/XTextItem16.java \
226 sun/awt/X11/XTextProperty.java \
227 sun/awt/X11/XTimeCoord.java \
228 sun/awt/X11/XWindowChanges.java \
229 sun/awt/X11/XdbeSwapInfo.java \
230 sun/awt/X11/XmbTextItem.java \
231 sun/awt/X11/XwcTextItem.java
232endif
233
234# Exclude another implicitly not included file.
235EXFILES += sun/util/locale/AsciiUtil.java
236
simonis3383c832014-01-20 17:16:05 +0100237ifeq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx aix))
ihse554e46f2013-11-14 11:19:32 +0100238 #
simonis3383c832014-01-20 17:16:05 +0100239 # only solaris, macosx and aix
ihse554e46f2013-11-14 11:19:32 +0100240 #
241 EXFILES += sun/nio/fs/PollingWatchService.java
242endif
243
244# TODO: Fix when converting NIO
245# Exclude *-linux-arm.java and *-linux-ppc.java from closed.
246EXFILES += -linux-arm.java \
247 -linux-ppc.java
248
249ifeq ($(OPENJDK_TARGET_OS), windows)
250 EXFILES += sun/nio/ch/AbstractPollSelectorImpl.java \
251 sun/nio/ch/PollSelectorProvider.java \
252 sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
253endif
254
255# These files do not appear in the build result of the old build. This
256# is because they are generated sources, but the AUTO_JAVA_FILES won't
257# pick them up since they aren't generated when the source dirs are
258# searched and they aren't referenced by any other classes so they won't
259# be picked up by implicit compilation. On a rebuild, they are picked up
260# and compiled. Exclude them here to produce the same rt.jar as the old
261# build does when building just once.
262EXFILES += javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
263 javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
264 javax/swing/plaf/nimbus/ScrollBarPainter.java \
265 javax/swing/plaf/nimbus/SliderPainter.java \
266 javax/swing/plaf/nimbus/SpinnerPainter.java \
267 javax/swing/plaf/nimbus/SplitPanePainter.java \
268 javax/swing/plaf/nimbus/TabbedPanePainter.java
269
270# Acquire a list of files that should be copied straight over to the classes.
271include CopyIntoClasses.gmk
272# Now we have COPY_PATTERNS, COPY_FILES and COPY_EXTRA
273
274ifndef OPENJDK
275 CLOSED_SRC_DIRS := $(JDK_TOPDIR)/src/closed/share/classes \
276 $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
277endif
278
279MACOSX_SRC_DIRS :=
280ifeq ($(OPENJDK_TARGET_OS), macosx)
281 MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/classes
282
283 # this files are duplicated in MACOSX_SRC_DIRS
284 EXFILES += $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java \
285 $(JDK_TOPDIR)/src/solaris/classes/sun/java2d/BackBufferCapsProvider.java \
286 $(JDK_TOPDIR)/src/solaris/classes/java/net/DefaultInterface.java \
287 $(JDK_TOPDIR)/src/solaris/classes/java/lang/ClassLoaderHelper.java \
288 $(JDK_TOPDIR)/src/solaris/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java \
289 $(JDK_TOPDIR)/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java \
290 $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java \
291 $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java \
292 $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java
293
ihse554e46f2013-11-14 11:19:32 +0100294endif
295
296# The security classes should not end up in the classes directory as that will prevent them
297# from working when running the exploded jdk image. Compile them separately to a different
298# directory from where the jars can be created.
299SECURITY_PKGS := \
300 com/oracle/security/ucrypto \
301 com/sun/crypto/provider \
302 javax/crypto \
303 sun/security/ec \
304 sun/security/internal \
305 sun/security/mscapi \
306 sun/security/pkcs11 \
307 #
308
kvn7130df72013-12-05 15:10:36 -0800309AIX_SRC_DIRS :=
310ifeq ($(OPENJDK_TARGET_OS),aix)
311 AIX_SRC_DIRS += $(JDK_TOPDIR)/src/aix/classes
simonis3383c832014-01-20 17:16:05 +0100312
313 # these files are duplicated in AIX_SRC_DIRS
314 EXFILES += $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java \
315 $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java \
316 $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java
kvn7130df72013-12-05 15:10:36 -0800317endif
318
ihse554e46f2013-11-14 11:19:32 +0100319# The exception handling of swing beaninfo
320# These resources violates the convention of having code and resources together under
321# $(JDK_TOPDIR)/src/.../classes directories
322$(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%.gif: $(JDK_TOPDIR)/make/data/swingbeaninfo/images/%.gif
323 $(call install-file)
324
325# The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying
326# JDK_FILTER at the make command line, only a subset of the JDK java files will
327# be recompiled. If multiple paths are separated by comma, convert that into a
328# space separated list.
329JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
330
331ifeq ($(ENABLE_SJAVAC),yes)
332 # With sjavac enabled, excluded sources are not even considered for linking.
333 # Explicitly add the security sources to sourcepath for linking.
334 BUILD_JDK_SOURCEPATH:=$(patsubst %,-i$(SPACE)%.*,$(subst /,.,$(SECURITY_PKGS))) \
335 -sourcepath $(JDK_TOPDIR)/src/share/classes
336endif
337
338$(eval $(call SetupJavaCompilation,BUILD_JDK,\
339 SETUP:=GENERATE_JDKBYTECODE,\
340 SRC:=$(JDK_TOPDIR)/src/share/classes \
341 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
342 $(MACOSX_SRC_DIRS) \
kvn7130df72013-12-05 15:10:36 -0800343 $(AIX_SRC_DIRS) \
ihse554e46f2013-11-14 11:19:32 +0100344 $(JDK_OUTPUTDIR)/gensrc \
345 $(JDK_OUTPUTDIR)/gensrc_no_srczip \
346 $(CLOSED_SRC_DIRS),\
347 INCLUDES:=$(JDK_USER_DEFINED_FILTER),\
348 EXCLUDES:=$(EXCLUDES) $(SECURITY_PKGS),\
349 EXCLUDE_FILES:=$(EXFILES),\
350 BIN:=$(JDK_OUTPUTDIR)/classes,\
351 COPY:=$(COPY_PATTERNS),\
352 COPY_FILES:=$(COPY_FILES),\
353 HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers,\
354 ADD_JAVAC_FLAGS:=$(BUILD_JDK_SOURCEPATH)))
355
356##########################################################################################
357
358$(eval $(call SetupJavaCompilation,BUILD_SECURITY, \
359 SETUP := GENERATE_JDKBYTECODE, \
360 SRC := $(JDK_TOPDIR)/src/share/classes \
361 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
362 $(MACOSX_SRC_DIRS) \
363 $(CLOSED_SRC_DIRS), \
364 INCLUDES := $(SECURITY_PKGS), \
365 EXCLUDES := $(EXCLUDES), \
366 EXCLUDE_FILES := $(EXFILES), \
367 BIN := $(JDK_OUTPUTDIR)/classes_security, \
368 HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
369
370$(BUILD_SECURITY): $(BUILD_JDK)
371
372##########################################################################################
373
374$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin:
375 $(MKDIR) -p $(@D)
376 $(TOUCH) $@
377
378##########################################################################################
379
ihse554e46f2013-11-14 11:19:32 +0100380
381##########################################################################################
382
383ifndef OPENJDK
384 ifeq ($(OPENJDK_TARGET_OS), windows)
385 ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
386 $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32, \
387 SETUP := GENERATE_JDKBYTECODE, \
388 JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
389 SRC := $(JDK_OUTPUTDIR)/gensrc_ab/32bit, \
serb19370792013-12-11 22:17:19 +0400390 BIN := $(JDK_OUTPUTDIR)/classes_ab/32bit, \
391 HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
ihse554e46f2013-11-14 11:19:32 +0100392
393 $(BUILD_ACCESSBRIDGE_32): $(BUILD_JDK)
394
395 $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_LEGACY, \
396 SETUP := GENERATE_JDKBYTECODE, \
397 JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
398 SRC := $(JDK_OUTPUTDIR)/gensrc_ab/legacy, \
serb19370792013-12-11 22:17:19 +0400399 BIN := $(JDK_OUTPUTDIR)/classes_ab/legacy, \
400 HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
ihse554e46f2013-11-14 11:19:32 +0100401
402 $(BUILD_ACCESSBRIDGE_LEGACY): $(BUILD_JDK)
403
404 else
405
406 $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_64, \
407 SETUP := GENERATE_JDKBYTECODE, \
408 JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
409 SRC := $(JDK_OUTPUTDIR)/gensrc_ab/64bit, \
serb19370792013-12-11 22:17:19 +0400410 BIN := $(JDK_OUTPUTDIR)/classes_ab/64bit, \
411 HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
ihse554e46f2013-11-14 11:19:32 +0100412
413 $(BUILD_ACCESSBRIDGE_64): $(BUILD_JDK)
414
415 endif
416 endif
417endif
418
419##########################################################################################
420
kizune6475c1f2013-12-05 16:37:33 +0400421all: $(BUILD_JDK) $(BUILD_SECURITY) $(COPY_EXTRA) \
ihse554e46f2013-11-14 11:19:32 +0100422 $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
423 $(BUILD_ACCESSBRIDGE_32) $(BUILD_ACCESSBRIDGE_64) \
424 $(BUILD_ACCESSBRIDGE_LEGACY)
425
426.PHONY: all