jdk/makefiles/CompileJavaClasses.gmk
changeset 12317 9670c1610c53
child 12892 3ef14bab6254
equal deleted inserted replaced
12316:ba6b7a51e226 12317:9670c1610c53
       
     1 #
       
     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 
       
    26 default: all
       
    27 
       
    28 include $(SPEC)
       
    29 include MakeBase.gmk
       
    30 include JavaCompilation.gmk
       
    31 
       
    32 # Setup the java compilers for the JDK build.
       
    33 include Setup.gmk
       
    34 
       
    35 EXCLUDES:=	sun/dc \
       
    36 		sun/security/pkcs11 \
       
    37 		com/sun/pept \
       
    38 		com/sun/tools/example/trace\
       
    39 		com/sun/tools/example/debug/bdi\
       
    40 		com/sun/tools/example/debug/event\
       
    41 		com/sun/tools/example/debug/gui \
       
    42 		javax/crypto \
       
    43 		com/oracle/security
       
    44 
       
    45 ifdef OPENJDK
       
    46     EXCLUDES+=	com/sun/jmx/snmp \
       
    47 		sun/management/snmp \
       
    48 		com/sun/script
       
    49 endif
       
    50 
       
    51 ifneq ($(PLATFORM),solaris)
       
    52    # Exclude Solaris nio and two security related files in src/share/classes
       
    53    EXFILES:=SolarisAclFileAttributeView.java \
       
    54 	SolarisFileStore.java \
       
    55 	SolarisFileSystem.java \
       
    56 	SolarisFileSystemProvider.java \
       
    57 	SolarisNativeDispatcher.java \
       
    58 	SolarisUserDefinedFileAttributeView.java \
       
    59 	SolarisWatchService.java \
       
    60 	DevPollArrayWrapper.java \
       
    61 	DevPollSelectorImpl.java \
       
    62 	DevPollSelectorProvider.java \
       
    63 	SolarisAsynchronousChannelProvider.java \
       
    64 	SolarisEventPort.java \
       
    65 	SolarisAclFileAttributeView.java \
       
    66 	SolarisFileStore.java \
       
    67 	SolarisFileSystem.java \
       
    68 	SolarisFileSystemProvider.java \
       
    69 	SolarisUserDefinedFileAttributeView.java \
       
    70 	SolarisNativeDispatcher.java \
       
    71 	SolarisWatchService.java \
       
    72 	SolarisLoginModule.java \
       
    73 	SolarisSystem.java \
       
    74 	sun/tools/attach/SolarisAttachProvider.java \
       
    75 	sun/tools/attach/SolarisVirtualMachine.java
       
    76 endif
       
    77 
       
    78 # Why?
       
    79 EXFILES+=WrapperGenerator.java
       
    80 
       
    81 ifneq ($(PLATFORM),windows)
       
    82     # Exclude Window security related files in src/share/classes
       
    83     EXFILES+=NTLoginModule.java \
       
    84              NTSystem.java
       
    85 
       
    86 endif
       
    87 
       
    88 ifeq ($(PLATFORM),windows)
       
    89     # Does nio channels exist on Windows?
       
    90     EXCLUDES+=sun/nio/ch
       
    91 endif
       
    92 
       
    93 ifneq ($(PLATFORM),linux)
       
    94     EXCLUDES+=com/sun/java/swing/plaf/gtk
       
    95     EXFILES+=sun/tools/attach/LinuxAttachProvider.java \
       
    96 	sun/tools/attach/LinuxVirtualMachine.java
       
    97 endif
       
    98 
       
    99 ifneq ($(PLATFORM),macosx)
       
   100     EXFILES+=sun/nio/fs/BsdFileStore.java \
       
   101 	     sun/nio/fs/BsdFileSystem.java \
       
   102              sun/nio/fs/BsdFileSystemProvider.java \
       
   103              sun/nio/fs/BsdNativeDispatcher.java \
       
   104              sun/tools/attach/BsdAttachProvider.java \
       
   105              sun/tools/attach/BsdVirtualMachine.java
       
   106 endif
       
   107 
       
   108 # Generated nimbus files that apparently should not be compiled...
       
   109 EXFILES+=InternalFrameTitlePanePainter.java \
       
   110 	OptionPaneMessageAreaPainter.java \
       
   111         ScrollBarPainter.java \
       
   112 	SliderPainter.java \
       
   113 	SpinnerPainter.java \
       
   114 	SplitPanePainter.java \
       
   115 	TabbedPanePainter.java
       
   116 
       
   117 # New class /java/lang/annotation/ContainerAnnotation.java is not included in old 
       
   118 # build
       
   119 EXFILES+=java/lang/annotation/ContainerAnnotation.java
       
   120 
       
   121 # Exclude BreakIterator classes that are just used in compile process to generate
       
   122 # data files and shouldn't go in the product
       
   123 EXFILES+=sun/text/resources/BreakIteratorRules.java \
       
   124 	sun/text/resources/BreakIteratorRules_th.java
       
   125 
       
   126 # TODO: Add BUILD_HEADLESS_ONLY to configure?
       
   127 ifdef BUILD_HEADLESS_ONLY
       
   128     EXCLUDES+=sun/applet
       
   129 endif
       
   130 
       
   131 ifdef OPENJDK
       
   132     EXCLUDES+=sun/java2d/cmm/kcms
       
   133 else
       
   134     EXCLUDES+=sun/java2d/cmm/lcms
       
   135 endif
       
   136 
       
   137 # Not used on windows
       
   138 ifneq ($(PLATFORM), windows)
       
   139     EXFILES+=sun/awt/AWTCharset.java
       
   140 endif
       
   141 
       
   142 # Exclude some generated AWT files that were implicitly not included by the old build.
       
   143 EXFILES+=sun/awt/X11/ScreenFormat.java \
       
   144          sun/awt/X11/XArc.java \
       
   145          sun/awt/X11/XChar2b.java \
       
   146          sun/awt/X11/XCharStruct.java \
       
   147          sun/awt/X11/XClassHint.java \
       
   148          sun/awt/X11/XComposeStatus.java \
       
   149          sun/awt/X11/XExtCodes.java \
       
   150          sun/awt/X11/XFontProp.java \
       
   151          sun/awt/X11/XFontSetExtents.java \
       
   152          sun/awt/X11/XFontStruct.java \
       
   153          sun/awt/X11/XGCValues.java \
       
   154          sun/awt/X11/XHostAddress.java \
       
   155          sun/awt/X11/XIMCallback.java \
       
   156          sun/awt/X11/XIMHotKeyTrigger.java \
       
   157          sun/awt/X11/XIMHotKeyTriggers.java \
       
   158          sun/awt/X11/XIMPreeditCaretCallbackStruct.java \
       
   159          sun/awt/X11/XIMPreeditDrawCallbackStruct.java \
       
   160          sun/awt/X11/XIMPreeditStateNotifyCallbackStruct.java \
       
   161          sun/awt/X11/XIMStatusDrawCallbackStruct.java \
       
   162          sun/awt/X11/XIMStringConversionCallbackStruct.java \
       
   163          sun/awt/X11/XIMStringConversionText.java \
       
   164          sun/awt/X11/XIMStyles.java \
       
   165          sun/awt/X11/XIMText.java \
       
   166          sun/awt/X11/XIMValuesList.java \
       
   167          sun/awt/X11/XImage.java \
       
   168          sun/awt/X11/XKeyboardControl.java \
       
   169          sun/awt/X11/XKeyboardState.java \
       
   170          sun/awt/X11/XOMCharSetList.java \
       
   171          sun/awt/X11/XOMFontInfo.java \
       
   172          sun/awt/X11/XOMOrientation.java \
       
   173          sun/awt/X11/XPoint.java \
       
   174          sun/awt/X11/XRectangle.java \
       
   175          sun/awt/X11/XSegment.java \
       
   176          sun/awt/X11/XStandardColormap.java \
       
   177          sun/awt/X11/XTextItem.java \
       
   178          sun/awt/X11/XTextItem16.java \
       
   179          sun/awt/X11/XTextProperty.java \
       
   180          sun/awt/X11/XTimeCoord.java \
       
   181          sun/awt/X11/XWindowChanges.java \
       
   182          sun/awt/X11/XdbeSwapInfo.java \
       
   183          sun/awt/X11/XmbTextItem.java \
       
   184          sun/awt/X11/XwcTextItem.java
       
   185 
       
   186 # Exclude sun/security files that should go in a separate jar
       
   187 EXFILES+=sun/security/ec/ECDHKeyAgreement.java \
       
   188          sun/security/ec/ECDSASignature.java \
       
   189          sun/security/ec/ECKeyPairGenerator.java \
       
   190          sun/security/ec/SunEC$1.java \
       
   191          sun/security/ec/SunEC.java \
       
   192          sun/security/ec/SunECEntries.java
       
   193 
       
   194 # Exclude another implicitly not included file.
       
   195 EXFILES+=sun/util/locale/AsciiUtil.java
       
   196 
       
   197 ifeq ($(PLATFORM), linux)
       
   198     EXFILES+=sun/nio/fs/PollingWatchService.java
       
   199 endif
       
   200 
       
   201 # TODO: Fix when converting NIO
       
   202 # Exclude *-linux-arm.java and *-linux-ppc.java from closed.
       
   203 EXFILES+=-linux-arm.java \
       
   204 	 -linux-ppc.java
       
   205 
       
   206 # TODO: Is this necessary?
       
   207 ifeq ($(PLATFORM), windows)
       
   208     EXFILES+=sun/net/sdp/SdpProvider.java
       
   209 else
       
   210     EXFILES+=sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java
       
   211 endif
       
   212 
       
   213 # Acquire a list of files that should be copied straight over to the classes.
       
   214 include CopyIntoClasses.gmk
       
   215 # Now we have COPY_PATTERNS, COPY_FILES and COPY_EXTRA
       
   216 
       
   217 ifndef OPENJDK
       
   218     CLOSED_SRC_DIRS:=$(JDK_TOPDIR)/src/closed/share/classes \
       
   219 		     $(JDK_TOPDIR)/src/closed/$(LEGACY_HOST_OS_API)/classes
       
   220 endif
       
   221 
       
   222 $(eval $(call SetupJavaCompilation,BUILD_JDK,\
       
   223                 SETUP:=GENERATE_JDKBYTECODE,\
       
   224 		SRC:=$(JDK_TOPDIR)/src/share/classes \
       
   225 		     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes \
       
   226 		     $(JDK_OUTPUTDIR)/gensrc \
       
   227 		     $(CLOSED_SRC_DIRS),\
       
   228 		EXCLUDES:=$(EXCLUDES),\
       
   229 		EXCLUDE_FILES:=$(EXFILES),\
       
   230 		BIN:=$(JDK_OUTPUTDIR)/newclasses,\
       
   231 		COPY:=$(COPY_PATTERNS),\
       
   232 		COPY_FILES:=$(COPY_FILES),\
       
   233 		JAR:=$(JDK_OUTPUTDIR)/newrt.jar,\
       
   234 		HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers))
       
   235 
       
   236 # copy with -a to preserve timestamps so dependencies down the line aren't messed up
       
   237 all: $(BUILD_JDK) $(JDK_OUTPUTDIR)/newrt.jar $(COPY_EXTRA)
       
   238 	(cd $(JDK_OUTPUTDIR); \
       
   239 		$(CP) -rp newclasses/* classes; \
       
   240 		$(FIND) classes -name "_the.*" $(FIND_DELETE); \
       
   241 		$(TOUCH) $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin)
       
   242 
       
   243 .PHONY: all