make/ZipSource.gmk
changeset 27560 adc258b13e2c
child 28600 09dd1740f176
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/ZipSource.gmk	Wed Dec 03 14:20:21 2014 +0000
@@ -0,0 +1,88 @@
+#
+# 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))
+
+################################################################################
+
+# Use ?= to enable override in custom makefile
+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