Gendata-jdk.compiler.gmk revision 4171:77a2d6c1f321
1# 2# Copyright (c) 2015, 2016, 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 Modules.gmk 29include SetupJavaCompilers.gmk 30 31################################################################################ 32 33# This is needed to properly setup DOCS_MODULES. 34$(eval $(call ReadImportMetaData)) 35 36# Modules that should be visible for 9 - the documented modules: 37CT_MODULES := $(DOCS_MODULES) 38 39# Get the complete module source path: 40CT_MODULESOURCEPATH := $(call GetModuleSrcPath) 41 42CT_DATA_DESCRIPTION ?= $(LANGTOOLS_TOPDIR)/make/data/symbols/symbols 43 44$(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \ 45 SETUP := GENERATE_OLDBYTECODE, \ 46 SRC := $(LANGTOOLS_TOPDIR)/make/src/classes, \ 47 INCLUDES := build/tools/symbolgenerator, \ 48 ADD_JAVAC_FLAGS := -Xbootclasspath/p:"$(INTERIM_LANGTOOLS_JAR)", \ 49 BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols, \ 50)) 51 52ifeq ($(BOOT_JDK_MODULAR), true) 53 COMPILECREATESYMBOLS_ADD_EXPORTS := \ 54 --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ 55 --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ 56 --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \ 57 --add-exports=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \ 58 --add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED 59endif 60 61$(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols: \ 62 $(COMPILE_CREATE_SYMBOLS) \ 63 $(wildcard $(LANGTOOLS_TOPDIR)/make/data/symbols/*) 64 $(RM) -r $(@D) 65 $(MKDIR) -p $(@D) 66 $(ECHO) Creating ct.sym classes 67 $(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \ 68 $(COMPILECREATESYMBOLS_ADD_EXPORTS) \ 69 -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols \ 70 build.tools.symbolgenerator.CreateSymbols \ 71 build-ctsym \ 72 $(CT_DATA_DESCRIPTION) \ 73 $(@D) 74 $(MKDIR) $(@D)/9 75 $(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \ 76 $(COMPILECREATESYMBOLS_ADD_EXPORTS) \ 77 -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols \ 78 build.tools.symbolgenerator.TransitiveDependencies \ 79 $(CT_MODULESOURCEPATH) \ 80 $(CT_MODULES) \ 81 >$(@D)/9/system-modules 82 $(TOUCH) $@ 83 84# Can't generate ct.sym directly into modules libs as the SetupJarArchive macro 85# creates meta data files in the output dir. 86$(eval $(call SetupJarArchive, CREATE_CTSYM, \ 87 DEPENDENCIES := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols, \ 88 SRCS := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files, \ 89 SUFFIXES := .sig system-modules, \ 90 JAR := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym, \ 91)) 92 93# Copy ct.sym to the modules libs dir 94$(eval $(call SetupCopyFiles, COPY_TO_LIBS, \ 95 FILES := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym, \ 96 DEST := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.compiler, \ 97)) 98 99TARGETS += $(CREATE_CTSYM) $(COPY_TO_LIBS) 100 101################################################################################ 102