jdk
102 строки · 4.1 Кб
1#
2# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26include CopyFiles.gmk
27include JarArchive.gmk
28include JavaCompilation.gmk
29include Modules.gmk
30
31################################################################################
32
33# Hook to include the corresponding custom file, if present.
34$(eval $(call IncludeCustomExtension, modules/jdk.compiler/Gendata.gmk))
35
36# This is needed to properly setup DOCS_MODULES.
37$(eval $(call ReadImportMetaData))
38
39# Modules that should be visible - the documented modules:
40CT_MODULES := $(filter-out $(MODULES_FILTER), $(DOCS_MODULES))
41CT_TRANSITIVE_MODULES := $(call FindTransitiveIndirectDepsForModules, $(CT_MODULES))
42CT_MODULES_API_TARGETS := \
43$(foreach m, $(CT_MODULES) $(CT_TRANSITIVE_MODULES), \
44$(call SetupJavaCompilationApiTarget, $m, $(JDK_OUTPUTDIR)/modules/$m))
45
46#undocumented modules which should also be included in ct.sym:
47CT_EXTRA_MODULES := jdk.unsupported
48
49SYMBOL_FILES := $(wildcard $(MODULE_SRC)/share/data/symbols/*)
50
51CT_DATA_DESCRIPTION += $(MODULE_SRC)/share/data/symbols/symbols
52
53COMPILECREATESYMBOLS_ADD_EXPORTS := \
54--add-modules jdk.compiler,jdk.jdeps \
55--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
56--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
57--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
58--add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
59--add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \
60#
61
62# TODO: Unify with jdk.javadoc-gendata. Should only compile this once and share.
63$(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
64TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK), \
65COMPILER := buildjdk, \
66SRC := $(TOPDIR)/make/langtools/src/classes, \
67INCLUDES := build/tools/symbolgenerator com/sun/tools/classfile, \
68BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javac, \
69DISABLED_WARNINGS := options, \
70JAVAC_FLAGS := \
71$(COMPILECREATESYMBOLS_ADD_EXPORTS), \
72))
73
74$(SUPPORT_OUTPUTDIR)/symbols/ct.sym: $(COMPILE_CREATE_SYMBOLS) $(SYMBOL_FILES) \
75$(MODULE_INFOS) $(CT_MODULES_API_TARGETS)
76$(RM) -r $(@D)
77$(MKDIR) -p $(@D)
78$(ECHO) Creating ct.sym classes
79$(ECHO) $(CT_MODULES) $(CT_TRANSITIVE_MODULES) $(CT_EXTRA_MODULES) >$(SUPPORT_OUTPUTDIR)/symbols/included-modules
80$(BUILD_JAVA_SMALL) \
81$(COMPILECREATESYMBOLS_ADD_EXPORTS) \
82-classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javac \
83build.tools.symbolgenerator.CreateSymbols \
84build-ctsym \
85$(CT_DATA_DESCRIPTION) \
86$(@D)/ct.sym \
87$(SOURCE_DATE_EPOCH) \
88$(JDK_SOURCE_TARGET_VERSION) \
89"$(VERSION_PRE)" \
90$(JDK_OUTPUTDIR)/modules/ \
91$(SUPPORT_OUTPUTDIR)/symbols/included-modules
92$(TOUCH) $@
93
94# Copy ct.sym to the modules libs dir
95$(eval $(call SetupCopyFiles, COPY_TO_LIBS, \
96FILES := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym, \
97DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.compiler, \
98))
99
100TARGETS += $(COPY_TO_LIBS)
101
102################################################################################
103