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