8055188: General cleanup of minor issues from source restructure
authorerikj
Thu, 21 Aug 2014 11:05:01 +0200
changeset 26115 7a9dc384f3c8
parent 25884 e78c55488f6c
child 26116 f051bd253364
8055188: General cleanup of minor issues from source restructure Reviewed-by: tbell
make/CompileJavaModules.gmk
make/Main.gmk
make/common/SetupJava.gmk
make/common/SetupJavaCompilers.gmk
--- a/make/CompileJavaModules.gmk	Wed Aug 20 14:11:35 2014 +0200
+++ b/make/CompileJavaModules.gmk	Thu Aug 21 11:05:01 2014 +0200
@@ -29,7 +29,7 @@
 include $(SPEC)
 include MakeBase.gmk
 include JavaCompilation.gmk
-include SetupJava.gmk
+include SetupJavaCompilers.gmk
 
 # Hook to include the corresponding custom file, if present.
 $(eval $(call IncludeCustomExtension, , CompileJavaModules.gmk))
--- a/make/Main.gmk	Wed Aug 20 14:11:35 2014 +0200
+++ b/make/Main.gmk	Thu Aug 21 11:05:01 2014 +0200
@@ -234,8 +234,7 @@
 	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk all)
 
 # Creates the jar files (rt.jar resources.jar etc)
-# this depends on all modules built
-main-jars: exploded-image
+main-jars:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJars.gmk)
 
 # Creates the images (j2sdk-image j2re-image etc)
@@ -355,6 +354,9 @@
 
   $(LAUNCHER_TARGETS): java.base-libs
 
+  # The demos are currently linking to libjvm and libjava, just like all other
+  # jdk libs, even though they don't need to. To avoid warnings, make sure they
+  # aren't built until after libjava and libjvm are available to link to.
   demos: $(JAVA_TARGETS)
 
   # Declare dependency from <module>-java to <module>-gensrc
@@ -381,7 +383,7 @@
 
   # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a 
   # header file used by jdk.jdwp libs.
-  jdk.jdwp-libs: jdk.jdi-gensrc
+  jdk.jdwp.agent-libs: jdk.jdi-gensrc
 
   # Explicitly add dependencies for special targets
   java.base-java: unpack-sec
@@ -390,7 +392,7 @@
 
   nashorn-jar: jdk.scripting.nashorn-java
 
-  main-jars: java rmic security-jars nashorn-jar policy-jars import-hotspot
+  main-jars: java rmic security-jars nashorn-jar policy-jars import-hotspot gendata
 
   # On windows, the jars target needs to wait for jgss libs to be built.
   # Should ideally split out the sec-bin zip file generation to avoid
--- a/make/common/SetupJava.gmk	Wed Aug 20 14:11:35 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-#
-# Copyright (c) 2011, 2014, 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.
-#
-
-ifndef _SETUP_GMK
-_SETUP_GMK := 1
-
-include JavaCompilation.gmk
-
-DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
-
-# To build with all warnings enabled, do the following:
-# make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
-JAVAC_WARNINGS := -Xlint:all,-deprecation -Werror
-
-# Any java code executed during a JDK build to build other parts of the JDK must be 
-# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this 
-# purpose must be built with -target PREVIOUS for bootstrapping purposes, which 
-# requires restricting to language level and api of previous JDK.
-#
-# 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 the previous JDK version.
-$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
-    JVM := $(JAVA_SMALL), \
-    JAVAC := $(NEW_JAVAC), \
-    FLAGS := $(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS), \
-    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
-    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
-
-# 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 := $(NEW_JAVAC), \
-    FLAGS := -source 9 -target 9 \
-        -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS) \
-        $(GENERATE_JDKBYTECODE_EXTRA_FLAGS), \
-    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
-    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
-
-# 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_NOWARNINGS, \
-    JVM := $(JAVA), \
-    JAVAC := $(NEW_JAVAC), \
-    FLAGS := -source 9 -target 9 \
-        -encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS) \
-        $(GENERATE_JDKBYTECODE_EXTRA_FLAGS), \
-    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
-    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
-
-JDK_BOOTCLASSPATH := $(subst $(SPACE),$(PATH_SEP),\
-    $(filter-out $(JDK_OUTPUTDIR)/modules/_%, $(wildcard $(JDK_OUTPUTDIR)/modules/*)))
-
-# 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_SMALL), \
-    JAVAC := $(NEW_JAVAC), \
-    FLAGS := -bootclasspath "$(JDK_BOOTCLASSPATH)" $(DISABLE_WARNINGS), \
-    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
-    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
-
-endif # _SETUP_GMK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/common/SetupJavaCompilers.gmk	Thu Aug 21 11:05:01 2014 +0200
@@ -0,0 +1,88 @@
+#
+# Copyright (c) 2011, 2014, 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.
+#
+
+ifndef _SETUP_GMK
+_SETUP_GMK := 1
+
+include JavaCompilation.gmk
+
+DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
+
+# To build with all warnings enabled, do the following:
+# make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
+JAVAC_WARNINGS := -Xlint:all,-deprecation -Werror
+
+# Any java code executed during a JDK build to build other parts of the JDK must be 
+# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this 
+# purpose must be built with -target PREVIOUS for bootstrapping purposes, which 
+# requires restricting to language level and api of previous JDK.
+#
+# 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 the previous JDK version.
+$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
+    JVM := $(JAVA_SMALL), \
+    JAVAC := $(NEW_JAVAC), \
+    FLAGS := $(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS), \
+    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
+    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
+
+# 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 := $(NEW_JAVAC), \
+    FLAGS := -source 9 -target 9 \
+        -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS) \
+        $(GENERATE_JDKBYTECODE_EXTRA_FLAGS), \
+    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
+    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
+
+# 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_NOWARNINGS, \
+    JVM := $(JAVA), \
+    JAVAC := $(NEW_JAVAC), \
+    FLAGS := -source 9 -target 9 \
+        -encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS) \
+        $(GENERATE_JDKBYTECODE_EXTRA_FLAGS), \
+    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
+    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
+
+JDK_BOOTCLASSPATH := $(subst $(SPACE),$(PATH_SEP),\
+    $(filter-out $(JDK_OUTPUTDIR)/modules/_%, $(wildcard $(JDK_OUTPUTDIR)/modules/*)))
+
+# 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_SMALL), \
+    JAVAC := $(NEW_JAVAC), \
+    FLAGS := -bootclasspath "$(JDK_BOOTCLASSPATH)" $(DISABLE_WARNINGS), \
+    SERVER_DIR := $(SJAVAC_SERVER_DIR), \
+    SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
+
+endif # _SETUP_GMK