jdk

Форк
0
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

26
include CopyFiles.gmk
27
include JarArchive.gmk
28
include JavaCompilation.gmk
29
include 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:
40
CT_MODULES := $(filter-out $(MODULES_FILTER), $(DOCS_MODULES))
41
CT_TRANSITIVE_MODULES := $(call FindTransitiveIndirectDepsForModules, $(CT_MODULES))
42
CT_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:
47
CT_EXTRA_MODULES := jdk.unsupported
48

49
SYMBOL_FILES := $(wildcard $(MODULE_SRC)/share/data/symbols/*)
50

51
CT_DATA_DESCRIPTION += $(MODULE_SRC)/share/data/symbols/symbols
52

53
COMPILECREATESYMBOLS_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, \
64
    TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK), \
65
    COMPILER := buildjdk, \
66
    SRC := $(TOPDIR)/make/langtools/src/classes, \
67
    INCLUDES := build/tools/symbolgenerator com/sun/tools/classfile, \
68
    BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javac, \
69
    DISABLED_WARNINGS := options, \
70
    JAVAC_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 \
83
	    build.tools.symbolgenerator.CreateSymbols \
84
	    build-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, \
96
    FILES := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym, \
97
    DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.compiler, \
98
))
99

100
TARGETS += $(COPY_TO_LIBS)
101

102
################################################################################
103

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.