Gendata-jdk.compiler.gmk revision 3311:305e9e96a7f6
1#
2# Copyright (c) 2015, 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 JarArchive.gmk
27include JavaCompilation.gmk
28include SetupJavaCompilers.gmk
29
30################################################################################
31
32CT_DATA_DESCRIPTION ?= $(LANGTOOLS_TOPDIR)/make/data/symbols/symbols
33
34$(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
35    SETUP := GENERATE_OLDBYTECODE, \
36    SRC := $(LANGTOOLS_TOPDIR)/make/src/classes, \
37    INCLUDES := build/tools/symbolgenerator, \
38    ADD_JAVAC_FLAGS := -Xbootclasspath/p:"$(INTERIM_LANGTOOLS_JAR)", \
39    BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols, \
40))
41
42ifeq ($(BOOT_JDK_MODULAR), true)
43  COMPILECREATESYMBOLS_ADD_EXPORTS := \
44      -XaddExports:jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
45      -XaddExports:jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
46      -XaddExports:jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED
47endif
48
49$(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols: \
50    $(COMPILE_CREATE_SYMBOLS) \
51    $(wildcard $(LANGTOOLS_TOPDIR)/make/data/symbols/*)
52	$(RM) -r $(@D)
53	$(MKDIR) -p $(@D)
54	$(ECHO) Creating ct.sym classes
55	$(JAVA) $(INTERIM_LANGTOOLS_ARGS) \
56	    $(COMPILECREATESYMBOLS_ADD_EXPORTS) \
57	    -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols \
58	    build.tools.symbolgenerator.CreateSymbols \
59	    build-ctsym \
60	    $(CT_DATA_DESCRIPTION) \
61	    $(@D)
62	$(TOUCH) $@
63
64# Can't generate ct.sym directly into modules libs as the SetupJarArchive macro
65# creates meta data files in the output dir.
66$(eval $(call SetupJarArchive, CREATE_CTSYM, \
67    DEPENDENCIES := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols, \
68    SRCS := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files, \
69    SUFFIXES := .sig, \
70    JAR := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym, \
71))
72
73# Copy ct.sym to the modules libs dir
74$(eval $(call SetupCopyFiles, COPY_TO_LIBS, \
75    FILES := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym, \
76    DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.compiler, \
77))
78
79TARGETS += $(CREATE_CTSYM) $(COPY_TO_LIBS)
80
81################################################################################
82