annotate nashorn/make/BuildNashorn.gmk @ 43554:a6f3b6d1c9b0

8173822: Remove dead code in BuildNashorn.gmk Reviewed-by: erikj
author ihse
date Fri, 03 Feb 2017 13:02:22 +0100
parents 08dc0d412096
children
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
jlaskey@16198 35
ihse@32526 36 JDK_CLASSES := $(call PathList, $(strip $(addprefix $(JDK_OUTPUTDIR)/modules/, \
attila@34447 37 java.base java.logging java.scripting jdk.dynalink)))
jlaskey@16198 38
alanb@36517 39 MODULESOURCEPATH := $(NASHORN_TOPDIR)/src/*/share/classes
alanb@36517 40
attila@29134 41 # Need to use source and target 8 for nasgen to work.
ihse@43554 42 $(eval $(call SetupJavaCompiler, GENERATE_NEWBYTECODE_DEBUG, \
erikj@41240 43 JVM := $(JAVA_JAVAC), \
ihse@20576 44 JAVAC := $(NEW_JAVAC), \
mchung@40286 45 FLAGS := -g -source 9 -target 9 --upgrade-module-path "$(JDK_OUTPUTDIR)/modules/" \
mchung@40286 46 --system none --module-source-path "$(MODULESOURCEPATH)", \
ihse@20576 47 SERVER_DIR := $(SJAVAC_SERVER_DIR), \
ihse@20576 48 SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
jlaskey@16198 49
jlaskey@16198 50 # Build nashorn into intermediate directory
sundar@32152 51 # Name the compilation setup the same as the module, as is done in the global
sundar@32152 52 # CompileJavaModules.gmk, to make dependency checking with other modules work
sundar@32152 53 # seamlessly.
ihse@43554 54 $(eval $(call SetupJavaCompilation, jdk.scripting.nashorn, \
ihse@20576 55 SETUP := GENERATE_NEWBYTECODE_DEBUG, \
alanb@36517 56 MODULE := jdk.scripting.nashorn, \
chegar@25865 57 SRC := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes, \
ihse@20576 58 COPY := .properties .js, \
alanb@36517 59 BIN := $(SUPPORT_OUTPUTDIR)/special_classes))
jlaskey@16198 60
alanb@16266 61 NASGEN_SRC := $(NASHORN_TOPDIR)/buildtools/nasgen/src
chegar@25865 62 ASM_SRC := $(JDK_TOPDIR)/src/java.base/share/classes/jdk/internal/org/objectweb/asm
sundar@16265 63
jlaskey@16198 64 # Build nasgen
ihse@43554 65 $(eval $(call SetupJavaCompilation, BUILD_NASGEN, \
erikj@26892 66 SETUP := GENERATE_OLDBYTECODE, \
ihse@20576 67 SRC := $(NASGEN_SRC) $(ASM_SRC), \
alanb@36517 68 BIN := $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes))
jlaskey@16198 69
chegar@25865 70 NASHORN_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn
chegar@25865 71 NASGEN_RUN_FILE := $(NASHORN_CLASSES_DIR)/_the.nasgen.run
chegar@25865 72
alanb@36517 73 ifeq ($(BOOT_JDK_MODULAR), true)
alanb@36517 74 NASGEN_OPTIONS := \
alanb@36517 75 -cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
mchung@40286 76 --patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
mchung@40286 77 --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
mchung@40286 78 --add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
alanb@37827 79 #
alanb@36517 80 else
alanb@36517 81 NASGEN_OPTIONS := \
alanb@36517 82 -Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes
alanb@36517 83 endif
alanb@36517 84
jlaskey@16198 85 # Copy classes to final classes dir and run nasgen to modify classes in jdk.nashorn.internal.objects package
alanb@36517 86 $(NASGEN_RUN_FILE): $(BUILD_NASGEN) $(jdk.scripting.nashorn)
jlaskey@16198 87 $(ECHO) Running nasgen
jlaskey@16198 88 $(MKDIR) -p $(@D)
jlaskey@16198 89 $(RM) -rf $(@D)/jdk $(@D)/netscape
alanb@36517 90 $(CP) -R -p $(SUPPORT_OUTPUTDIR)/special_classes/jdk.scripting.nashorn/* $(@D)/
erikj@41240 91 $(JAVA_SMALL) $(NASGEN_OPTIONS) \
ihse@20576 92 jdk.nashorn.internal.tools.nasgen.Main $(@D) jdk.nashorn.internal.objects $(@D)
jlaskey@16198 93 $(TOUCH) $@
jlaskey@16198 94
jlaskey@16198 95 # Version file needs to be processed with version numbers
ihse@34020 96 $(eval $(call SetupTextFileProcessing, BUILD_VERSION_FILE, \
ihse@34020 97 SOURCE_FILES := $(NASHORN_TOPDIR)/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/version.properties.template, \
ihse@34020 98 OUTPUT_FILE := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn/jdk/nashorn/internal/runtime/resources/version.properties, \
ihse@34020 99 REPLACEMENTS := \
ihse@34020 100 @@VERSION_STRING@@ => $(VERSION_STRING) ; \
ihse@34020 101 @@VERSION_SHORT@@ => $(VERSION_SHORT) , \
ihse@34020 102 ))
ihse@20576 103
ihse@34020 104 # Version processing needs to happen after nasgen run since nasgen run deletes it
ihse@34020 105 $(BUILD_VERSION_FILE): $(NASGEN_RUN_FILE)
jlaskey@16198 106
ihse@43554 107 compile: $(NASGEN_RUN_FILE) $(BUILD_VERSION_FILE)
ihse@43554 108 all: compile
ihse@20576 109
chegar@25865 110 .PHONY: compile all