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