Setup.gmk 3.7 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
#
# 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.
#

JAVAC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar
JAVAH_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar

DISABLE_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally

# The generate old bytecode javac setup uses the new compiler to compile for the
# boot jdk to generate tools that need to be run with the boot jdk.
# Thus we force the target bytecode to 6.
$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\
     JVM:=$(JAVA),\
     JAVAC:=$(JAVAC_JARS),\
     FLAGS:=-source 7 -target 7 -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS),\
     SERVER_DIR:=$(JAVAC_SERVERS),\
     SERVER_JVM:=$(SERVER_JAVA),\
     MODE:=$(JAVAC_USE_MODE),\
     USE_DEPS:=$(JAVAC_USE_DEPS)))

# The generate new bytecode javac setup uses the new compiler to compile for the
# new jdk. This new bytecode might only be possible to run using the new jvm.
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE,\
     JVM:=$(JAVA),\
     JAVAC:=$(JAVAC_JARS),\
     JAVAH:=$(JAVAH_JARS),\
     FLAGS:=-bootclasspath "$(JDK_OUTPUTDIR)/newclasses$(PATH_SEP)$(JDK_OUTPUTDIR)/classes" -Xprefer:source -XDignore.symbol.file=true $(DISABLE_WARNINGS),\
     SERVER_DIR:=$(JAVAC_SERVERS),\
     SERVER_JVM:=$(SERVER_JAVA),\
     MODE:=$(JAVAC_USE_MODE),\
     USE_DEPS:=$(JAVAC_USE_DEPS)))

# After the jdk is built, we want to build demos using only the recently
# generated jdk classes and nothing else, no jdk source, etc etc.
# I.e. the rt.jar, but since rt.jar has not yet been generated
# (it will be in "make images") therefore we use classes instead.
$(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE,\
     JVM:=$(JAVA),\
     JAVAC:=$(JAVAC_JARS),\
     FLAGS:= -Xbootclasspath:$(JDK_OUTPUTDIR)/classes $(DISABLE_WARNINGS),\
     SERVER_DIR:=$(JAVAC_SERVERS),\
     SERVER_JVM:=$(SERVER_JAVA),\
     MODE:=$(JAVAC_USE_MODE),\
     USE_DEPS:=$(JAVAC_USE_DEPS)))

# A temporary solution to work around the fact that Matrix3D.java
# exists in several applets. The javacserver does not like to be
# fed the same class twice. Thus we compile one applet outside of the
# javacserver.
$(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE_NOSERV,\
     JVM:=$(JAVA),\
     JAVAC:=$(JAVAC_JARS),\
     FLAGS:= -Xbootclasspath:$(JDK_OUTPUTDIR)/classes $(DISABLE_WARNINGS),\
     MODE:=SINGLE_THREADED_BATCH,\
     USE_DEPS:=FALSE))