changeset 1188:494f41aa65f7

Added src.zip to jdk jimage
author erikj
date Fri, 19 Sep 2014 16:14:06 +0200
parents fc83359acd30
children a692db94d51b
files make/Images.gmk make/Main.gmk make/ZipSource.gmk
diffstat 3 files changed, 103 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/make/Images.gmk	Fri Sep 19 15:46:43 2014 +0200
+++ b/make/Images.gmk	Fri Sep 19 16:14:06 2014 +0200
@@ -348,6 +348,15 @@
 JDK_TARGETS += $(JDK_INFO_FILE)
 
 ################################################################################
+# src.zip
+
+$(JDK_JIMAGE_DIR)/src.zip: $(DIST_OUTPUTDIR)/src.zip
+	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+JDK_TARGETS += $(JDK_JIMAGE_DIR)/src.zip
+
+################################################################################
 
 $(JRE_TARGETS): $(TOOL_JRE_TARGETS)
 $(JDK_TARGETS): $(TOOL_JDK_TARGETS)
--- a/make/Main.gmk	Fri Sep 19 15:46:43 2014 +0200
+++ b/make/Main.gmk	Fri Sep 19 16:14:06 2014 +0200
@@ -259,6 +259,9 @@
 	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
 	+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk images
 
+zip-src:
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
+
 strip-binaries:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
 
@@ -267,7 +270,7 @@
 
 ALL_TARGETS += source-tips security-jars nashorn-jar main-jars legacy-images \
     $(PROFILE_JARS_TARGETS) $(PROFILE_IMAGES_TARGETS) profiles-oscheck \
-    bootcycle-images strip-binaries jimages
+    bootcycle-images zip-src strip-binaries jimages
 
 ################################################################################
 # Docs targets
@@ -404,9 +407,11 @@
 
   legacy-images: jars demos samples exploded-image source-tips
 
+  zip-src: gensrc rmic
+
   strip-binaries: libs launchers gendata copy
 
-  jimages: exploded-image strip-binaries source-tips
+  jimages: exploded-image zip-src strip-binaries source-tips
 
   bootcycle-images: legacy-images
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/ZipSource.gmk	Fri Sep 19 16:14:06 2014 +0200
@@ -0,0 +1,87 @@
+#
+# Copyright (c) 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.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, , ZipSource.gmk))
+
+################################################################################
+
+SRC_ZIP_INCLUDES ?= \
+    com \
+    java \
+    javax \
+    jdk \
+    org \
+    sun \
+    #
+
+SRC_ZIP_EXCLUDES ?=
+
+SRC_ZIP_SRCS += $(wildcard \
+    $(JDK_TOPDIR)/src/*/share/classes \
+    $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
+    $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_API_DIR)/classes \
+    $(LANGTOOLS_TOPDIR)/src/*/share/classes \
+    $(CORBA_TOPDIR)/src/*/share/classes \
+    $(JAXP_TOPDIR)/src/*/share/classes \
+    $(JAXWS_TOPDIR)/src/*/share/classes \
+    $(SUPPORT_OUTPUTDIR)/gensrc/j* \
+    $(SUPPORT_OUTPUTDIR)/rmic/j* \
+    ) \
+    #
+
+# Need to copy launcher src files into desired directory structure
+# before zipping the sources.
+$(eval $(call SetupCopyFiles,COPY_LAUNCHER_SRC, \
+    SRC := $(JDK_TOPDIR)/src/java.base, \
+    DEST := $(SUPPORT_OUTPUTDIR)/src/launcher, \
+    FLATTEN := true, \
+    FILES := $(wildcard \
+        $(JDK_TOPDIR)/src/java.base/share/native/launcher/* \
+        $(JDK_TOPDIR)/src/java.base/share/native/libjli/* \
+        $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjli/java_md*)))
+
+# This dir needs to exist before macro is evaluated to avoid warning from find.
+$(eval $(call MakeDir, $(SUPPORT_OUTPUTDIR)/src))
+$(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \
+    SRC := $(SRC_ZIP_SRCS) $(SUPPORT_OUTPUTDIR)/src, \
+    INCLUDES := $(SRC_ZIP_INCLUDES) launcher, \
+    EXCLUDES := $(SRC_ZIP_EXCLUDES), \
+    EXCLUDE_FILES := $(SRC_ZIP_EXCLUDE_FILES), \
+    SUFFIXES := .java .c .h, \
+    ZIP := $(SUPPORT_OUTPUTDIR)/src.zip, \
+    EXTRA_DEPS := $(COPY_LAUNCHER_SRC)))
+
+################################################################################
+
+all: $(BUILD_SRC_ZIP)
+
+.PHONY: default all