makefiles/BuildNashorn.gmk

Fri, 12 Jul 2013 11:58:42 +0200

author
attila
date
Fri, 12 Jul 2013 11:58:42 +0200
changeset 435
e27ebcfed6fa
parent 419
a75e75cc6a61
child 599
45399f3ef717
permissions
-rw-r--r--

8019822: Duplicate name and signature in finally block
Reviewed-by: jlaskey, sundar

jlaskey@54 1 #
jlaskey@54 2 # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
jlaskey@54 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jlaskey@54 4 #
jlaskey@54 5 # This code is free software; you can redistribute it and/or modify it
jlaskey@54 6 # under the terms of the GNU General Public License version 2 only, as
jlaskey@54 7 # published by the Free Software Foundation. Oracle designates this
jlaskey@54 8 # particular file as subject to the "Classpath" exception as provided
jlaskey@54 9 # by Oracle in the LICENSE file that accompanied this code.
jlaskey@54 10 #
jlaskey@54 11 # This code is distributed in the hope that it will be useful, but WITHOUT
jlaskey@54 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jlaskey@54 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jlaskey@54 14 # version 2 for more details (a copy is included in the LICENSE file that
jlaskey@54 15 # accompanied this code).
jlaskey@54 16 #
jlaskey@54 17 # You should have received a copy of the GNU General Public License version
jlaskey@54 18 # 2 along with this work; if not, write to the Free Software Foundation,
jlaskey@54 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jlaskey@54 20 #
jlaskey@54 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jlaskey@54 22 # or visit www.oracle.com if you need additional information or have any
jlaskey@54 23 # questions.
jlaskey@54 24 #
jlaskey@54 25
jlaskey@54 26 # This must be the first rule
jlaskey@54 27 default: all
jlaskey@54 28
jlaskey@54 29 -include $(SPEC)
jlaskey@54 30 include MakeBase.gmk
jlaskey@54 31 include JavaCompilation.gmk
jlaskey@54 32
jlaskey@54 33 JDK_CLASSES := $(JDK_OUTPUTDIR)/classes
jlaskey@54 34
jlaskey@54 35 NASHORN_JAR := $(NASHORN_DIST)/nashorn.jar
jlaskey@56 36 NASHORN_VERSION := $(JDK_VERSION)
jlaskey@56 37 NASHORN_FULL_VERSION := $(FULL_VERSION)
jlaskey@56 38
jlaskey@56 39 ifdef MILESTONE
jlaskey@56 40 ifeq ($(MILESTONE),internal)
jlaskey@56 41 NASHORN_VERSION = $(FULL_VERSION)
jlaskey@56 42 endif
jlaskey@56 43 endif
jlaskey@54 44
jlaskey@54 45 # Need to use source and target 7 for nasgen to work.
jlaskey@117 46 $(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG,\
jlaskey@54 47 JVM:=$(JAVA),\
jlaskey@117 48 JAVAC:=$(NEW_JAVAC),\
jlaskey@54 49 FLAGS:=-g -source 7 -target 7 -bootclasspath $(JDK_CLASSES),\
jlaskey@54 50 SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
jlaskey@54 51 SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
jlaskey@54 52
jlaskey@54 53 # Build nashorn into intermediate directory
jlaskey@54 54 $(eval $(call SetupJavaCompilation,BUILD_NASHORN,\
jlaskey@117 55 SETUP:=GENERATE_NEWBYTECODE_DEBUG,\
jlaskey@54 56 SRC:=$(NASHORN_TOPDIR)/src,\
jlaskey@54 57 COPY:=.properties .js,\
jlaskey@94 58 BIN:=$(NASHORN_OUTPUTDIR)/nashorn_classes))
jlaskey@54 59
alanb@122 60 NASGEN_SRC := $(NASHORN_TOPDIR)/buildtools/nasgen/src
alanb@122 61 ASM_SRC := $(JDK_TOPDIR)/src/share/classes/jdk/internal/org/objectweb/asm
sundar@121 62
jlaskey@54 63 # Build nasgen
jlaskey@54 64 $(eval $(call SetupJavaCompilation,BUILD_NASGEN,\
jlaskey@117 65 SETUP:=GENERATE_NEWBYTECODE_DEBUG,\
sundar@121 66 SRC:=$(NASGEN_SRC) $(ASM_SRC), \
jlaskey@54 67 BIN:=$(NASHORN_OUTPUTDIR)/nasgen_classes,\
jlaskey@54 68 ADD_JAVAC_FLAGS:=-cp $(NASHORN_OUTPUTDIR)/nashorn_classes))
jlaskey@54 69
jlaskey@54 70 # Nasgen needs nashorn classes
jlaskey@54 71 $(BUILD_NASGEN): $(BUILD_NASHORN)
jlaskey@54 72
jlaskey@54 73 # Copy classes to final classes dir and run nasgen to modify classes in jdk.nashorn.internal.objects package
jlaskey@54 74 $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run: $(BUILD_NASGEN)
jlaskey@54 75 $(ECHO) Running nasgen
jlaskey@54 76 $(MKDIR) -p $(@D)
jlaskey@54 77 $(RM) -rf $(@D)/jdk $(@D)/netscape
jlaskey@54 78 $(CP) -R -p $(NASHORN_OUTPUTDIR)/nashorn_classes/* $(@D)/
sundar@121 79 $(FIXPATH) $(JAVA) \
jlaskey@113 80 -cp "$(NASHORN_OUTPUTDIR)/nasgen_classes$(PATH_SEP)$(NASHORN_OUTPUTDIR)/nashorn_classes" \
jlaskey@54 81 jdk.nashorn.internal.tools.nasgen.Main $(@D) jdk.nashorn.internal.objects $(@D)
jlaskey@54 82 $(TOUCH) $@
jlaskey@54 83
jlaskey@54 84 # Version file needs to be processed with version numbers
jlaskey@54 85 VERSION_FILE := $(NASHORN_OUTPUTDIR)/classes/jdk/nashorn/internal/runtime/resources/version.properties
jlaskey@54 86 # Needs to happen after nasgen run since nasgen run deletes it
jlaskey@54 87 $(VERSION_FILE): $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run
jlaskey@54 88 $(VERSION_FILE): $(NASHORN_TOPDIR)/src/jdk/nashorn/internal/runtime/resources/version.properties-template
jlaskey@54 89 $(ECHO) Creating version.properties
jlaskey@54 90 $(MKDIR) -p $(@D)
jlaskey@56 91 $(CAT) $< | $(SED) -e 's/$$(FULL_VERSION)/$(NASHORN_FULL_VERSION)/g' \
jlaskey@54 92 -e 's/$$(RELEASE)/$(NASHORN_VERSION)/g' \
jlaskey@54 93 -e '/^#.*$$/d' -e '/^$$/d' > $@
jlaskey@54 94
jlaskey@54 95
jlaskey@56 96 MANIFEST_ATTRIBUTES:=Name: jdk/nashorn/\nImplementation-Title: Oracle Nashorn\nImplementation-Version: $(NASHORN_FULL_VERSION)
jlaskey@54 97
jlaskey@54 98 # Create nashorn.jar from the final classes dir
jlaskey@54 99 $(eval $(call SetupArchive,BUILD_NASHORN_JAR,\
jlaskey@54 100 $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run \
jlaskey@54 101 $(VERSION_FILE),\
jlaskey@54 102 SRCS:=$(NASHORN_OUTPUTDIR)/classes,\
sundar@419 103 SUFFIXES:=.class .js .properties Factory,\
jlaskey@54 104 MANIFEST:=$(NASHORN_TOPDIR)/src/META-INF/MANIFEST.MF,\
jlaskey@54 105 EXTRA_MANIFEST_ATTR:=$(MANIFEST_ATTRIBUTES),\
jlaskey@54 106 SKIP_METAINF:=true,\
jlaskey@54 107 JAR:=$(NASHORN_JAR)))
jlaskey@54 108
jlaskey@54 109 all: $(NASHORN_JAR)
jlaskey@56 110
jlaskey@54 111 .PHONY: all

mercurial