ZipSource.gmk revision 1299:8720fa7696cb
1253592Serwin#
2253592Serwin# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
3253592Serwin# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4253592Serwin#
5253592Serwin# This code is free software; you can redistribute it and/or modify it
6253592Serwin# under the terms of the GNU General Public License version 2 only, as
7253592Serwin# published by the Free Software Foundation.  Oracle designates this
8253592Serwin# particular file as subject to the "Classpath" exception as provided
9253592Serwin# by Oracle in the LICENSE file that accompanied this code.
10253592Serwin#
11253592Serwin# This code is distributed in the hope that it will be useful, but WITHOUT
12253592Serwin# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13253592Serwin# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14253592Serwin# version 2 for more details (a copy is included in the LICENSE file that
15253592Serwin# accompanied this code).
16253592Serwin#
17253592Serwin# You should have received a copy of the GNU General Public License version
18253592Serwin# 2 along with this work; if not, write to the Free Software Foundation,
19253592Serwin# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20253592Serwin#
21253592Serwin# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22253592Serwin# or visit www.oracle.com if you need additional information or have any
23253592Serwin# questions.
24253592Serwin#
25253592Serwin
26253592Serwindefault: all
27253592Serwin
28include $(SPEC)
29include MakeBase.gmk
30include JavaCompilation.gmk
31
32# Hook to include the corresponding custom file, if present.
33$(eval $(call IncludeCustomExtension, , ZipSource.gmk))
34
35################################################################################
36
37# Use ?= to enable override in custom makefile
38SRC_ZIP_INCLUDES ?= \
39    com \
40    java \
41    javax \
42    jdk \
43    org \
44    sun \
45    #
46
47SRC_ZIP_EXCLUDES ?=
48
49SRC_ZIP_SRCS += $(wildcard \
50    $(JDK_TOPDIR)/src/*/share/classes \
51    $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
52    $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_API_DIR)/classes \
53    $(LANGTOOLS_TOPDIR)/src/*/share/classes \
54    $(CORBA_TOPDIR)/src/*/share/classes \
55    $(JAXP_TOPDIR)/src/*/share/classes \
56    $(JAXWS_TOPDIR)/src/*/share/classes \
57    $(SUPPORT_OUTPUTDIR)/gensrc/j* \
58    $(SUPPORT_OUTPUTDIR)/rmic/j* \
59    ) \
60    #
61
62# Need to copy launcher src files into desired directory structure
63# before zipping the sources.
64$(eval $(call SetupCopyFiles,COPY_LAUNCHER_SRC, \
65    SRC := $(JDK_TOPDIR)/src/java.base, \
66    DEST := $(SUPPORT_OUTPUTDIR)/src/launcher, \
67    FLATTEN := true, \
68    FILES := $(wildcard \
69        $(JDK_TOPDIR)/src/java.base/share/native/launcher/* \
70        $(JDK_TOPDIR)/src/java.base/share/native/libjli/* \
71        $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjli/java_md*)))
72
73# This dir needs to exist before macro is evaluated to avoid warning from find.
74$(call MakeDir, $(SUPPORT_OUTPUTDIR)/src)
75$(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \
76    SRC := $(SRC_ZIP_SRCS) $(SUPPORT_OUTPUTDIR)/src, \
77    INCLUDES := $(SRC_ZIP_INCLUDES) launcher, \
78    EXCLUDES := $(SRC_ZIP_EXCLUDES), \
79    EXCLUDE_FILES := $(SRC_ZIP_EXCLUDE_FILES), \
80    SUFFIXES := .java .c .h, \
81    ZIP := $(SUPPORT_OUTPUTDIR)/src.zip, \
82    EXTRA_DEPS := $(COPY_LAUNCHER_SRC)))
83
84################################################################################
85
86all: $(BUILD_SRC_ZIP)
87
88.PHONY: default all
89