annotate make/BuildNashorn.gmk @ 47515:6b3389375f31

8189094: Change required boot jdk to JDK 9 Reviewed-by: ihse, mchung
author erikj
date Thu, 19 Oct 2017 14:16:45 +0200
parents 0e67ab18b511
children 1fd27535bc57
rev   line source
jlaskey@16198 1 #
ihse@43554 2 # Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
jlaskey@16198 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jlaskey@16198 4 #
jlaskey@16198 5 # This code is free software; you can redistribute it and/or modify it
jlaskey@16198 6 # under the terms of the GNU General Public License version 2 only, as
jlaskey@16198 7 # published by the Free Software Foundation. Oracle designates this
jlaskey@16198 8 # particular file as subject to the "Classpath" exception as provided
jlaskey@16198 9 # by Oracle in the LICENSE file that accompanied this code.
jlaskey@16198 10 #
jlaskey@16198 11 # This code is distributed in the hope that it will be useful, but WITHOUT
jlaskey@16198 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jlaskey@16198 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jlaskey@16198 14 # version 2 for more details (a copy is included in the LICENSE file that
jlaskey@16198 15 # accompanied this code).
jlaskey@16198 16 #
jlaskey@16198 17 # You should have received a copy of the GNU General Public License version
jlaskey@16198 18 # 2 along with this work; if not, write to the Free Software Foundation,
jlaskey@16198 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jlaskey@16198 20 #
jlaskey@16198 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jlaskey@16198 22 # or visit www.oracle.com if you need additional information or have any
jlaskey@16198 23 # questions.
jlaskey@16198 24 #
jlaskey@16198 25
jlaskey@16198 26 # This must be the first rule
jlaskey@16198 27 default: all
jlaskey@16198 28
erikj@41240 29 include $(SPEC)
jlaskey@16198 30 include MakeBase.gmk
ihse@33535 31 include JarArchive.gmk
jlaskey@16198 32 include JavaCompilation.gmk
erikj@26892 33 include SetupJavaCompilers.gmk
ihse@34020 34 include TextFileProcessing.gmk
erikj@47217 35 include Modules.gmk
jlaskey@16198 36
ihse@32526 37 JDK_CLASSES := $(call PathList, $(strip $(addprefix $(JDK_OUTPUTDIR)/modules/, \
attila@34447 38 java.base java.logging java.scripting jdk.dynalink)))
jlaskey@16198 39
attila@29134 40 # Need to use source and target 8 for nasgen to work.
ihse@43554 41 $(eval $(call SetupJavaCompiler, GENERATE_NEWBYTECODE_DEBUG, \
erikj@41240 42 JVM := $(JAVA_JAVAC), \
ihse@20576 43 JAVAC := $(NEW_JAVAC), \
ihse@47342 44 FLAGS := -g -source 10 -target 10 --upgrade-module-path "$(JDK_OUTPUTDIR)/modules/" \
erikj@47217 45 --system none --module-source-path $(call GetModuleSrcPath), \
ihse@20576 46 SERVER_DIR := $(SJAVAC_SERVER_DIR), \
ihse@20576 47 SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
jlaskey@16198 48
jlaskey@16198 49 # Build nashorn into intermediate directory
sundar@32152 50 # Name the compilation setup the same as the module, as is done in the global
sundar@32152 51 # CompileJavaModules.gmk, to make dependency checking with other modules work
sundar@32152 52 # seamlessly.
ihse@43554 53 $(eval $(call SetupJavaCompilation, jdk.scripting.nashorn, \
ihse@20576 54 SETUP := GENERATE_NEWBYTECODE_DEBUG, \
alanb@36517 55 MODULE := jdk.scripting.nashorn, \
erikj@47217 56 SRC := $(TOPDIR)/src/jdk.scripting.nashorn/share/classes, \
ihse@20576 57 COPY := .properties .js, \
alanb@36517 58 BIN := $(SUPPORT_OUTPUTDIR)/special_classes))
jlaskey@16198 59
erikj@47217 60 NASGEN_SRC := $(TOPDIR)/make/nashorn/buildtools/nasgen/src
erikj@47217 61 ASM_SRC := $(TOPDIR)/src/java.base/share/classes/jdk/internal/org/objectweb/asm
sundar@16265 62
jlaskey@16198 63 # Build nasgen
ihse@43554 64 $(eval $(call SetupJavaCompilation, BUILD_NASGEN, \
erikj@26892 65 SETUP := GENERATE_OLDBYTECODE, \
ihse@20576 66 SRC := $(NASGEN_SRC) $(ASM_SRC), \
alanb@36517 67 BIN := $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes))
jlaskey@16198 68
chegar@25865 69 NASHORN_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn
chegar@25865 70 NASGEN_RUN_FILE := $(NASHORN_CLASSES_DIR)/_the.nasgen.run
chegar@25865 71
erikj@47515 72 NASGEN_OPTIONS := \
erikj@47515 73 -cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
erikj@47515 74 --patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
erikj@47515 75 --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
erikj@47515 76 --add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
erikj@47515 77 #
alanb@36517 78
jlaskey@16198 79 # Copy classes to final classes dir and run nasgen to modify classes in jdk.nashorn.internal.objects package
alanb@36517 80 $(NASGEN_RUN_FILE): $(BUILD_NASGEN) $(jdk.scripting.nashorn)
jlaskey@16198 81 $(ECHO) Running nasgen
jlaskey@16198 82 $(MKDIR) -p $(@D)
jlaskey@16198 83 $(RM) -rf $(@D)/jdk $(@D)/netscape
alanb@36517 84 $(CP) -R -p $(SUPPORT_OUTPUTDIR)/special_classes/jdk.scripting.nashorn/* $(@D)/
erikj@41240 85 $(JAVA_SMALL) $(NASGEN_OPTIONS) \
ihse@20576 86 jdk.nashorn.internal.tools.nasgen.Main $(@D) jdk.nashorn.internal.objects $(@D)
jlaskey@16198 87 $(TOUCH) $@
jlaskey@16198 88
jlaskey@16198 89 # Version file needs to be processed with version numbers
ihse@34020 90 $(eval $(call SetupTextFileProcessing, BUILD_VERSION_FILE, \
erikj@47217 91 SOURCE_FILES := $(TOPDIR)/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties.template, \
ihse@34020 92 OUTPUT_FILE := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn/jdk/nashorn/internal/runtime/resources/version.properties, \
ihse@34020 93 REPLACEMENTS := \
ihse@34020 94 @@VERSION_STRING@@ => $(VERSION_STRING) ; \
ihse@34020 95 @@VERSION_SHORT@@ => $(VERSION_SHORT) , \
ihse@34020 96 ))
ihse@20576 97
ihse@34020 98 # Version processing needs to happen after nasgen run since nasgen run deletes it
ihse@34020 99 $(BUILD_VERSION_FILE): $(NASGEN_RUN_FILE)
jlaskey@16198 100
ihse@43554 101 compile: $(NASGEN_RUN_FILE) $(BUILD_VERSION_FILE)
ihse@43554 102 all: compile
ihse@20576 103
chegar@25865 104 .PHONY: compile all