annotate nashorn/makefiles/BuildNashorn.gmk @ 20576:1763ed231bda

8001931: The new build system whitespace cleanup Reviewed-by: tbell, simonis, erikj
author ihse
date Thu, 10 Oct 2013 14:58:13 +0200
parents ef883ef43731
children
rev   line source
jlaskey@16198 1 #
jlaskey@16198 2 # Copyright (c) 2010, 2013, 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
jlaskey@16198 29 -include $(SPEC)
jlaskey@16198 30 include MakeBase.gmk
jlaskey@16198 31 include JavaCompilation.gmk
jlaskey@16198 32
jlaskey@16198 33 JDK_CLASSES := $(JDK_OUTPUTDIR)/classes
jlaskey@16198 34
jlaskey@16198 35 NASHORN_JAR := $(NASHORN_DIST)/nashorn.jar
jlaskey@16200 36 NASHORN_VERSION := $(JDK_VERSION)
jlaskey@16200 37 NASHORN_FULL_VERSION := $(FULL_VERSION)
jlaskey@16200 38
jlaskey@16200 39 ifdef MILESTONE
ihse@20576 40 ifeq ($(MILESTONE), internal)
jlaskey@16200 41 NASHORN_VERSION = $(FULL_VERSION)
jlaskey@16200 42 endif
jlaskey@16200 43 endif
jlaskey@16198 44
jlaskey@16198 45 # Need to use source and target 7 for nasgen to work.
ihse@20576 46 $(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \
ihse@20576 47 JVM := $(JAVA), \
ihse@20576 48 JAVAC := $(NEW_JAVAC), \
ihse@20576 49 FLAGS := -g -source 7 -target 7 -bootclasspath $(JDK_CLASSES), \
ihse@20576 50 SERVER_DIR := $(SJAVAC_SERVER_DIR), \
ihse@20576 51 SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
jlaskey@16198 52
jlaskey@16198 53 # Build nashorn into intermediate directory
ihse@20576 54 $(eval $(call SetupJavaCompilation,BUILD_NASHORN, \
ihse@20576 55 SETUP := GENERATE_NEWBYTECODE_DEBUG, \
ihse@20576 56 SRC := $(NASHORN_TOPDIR)/src, \
ihse@20576 57 COPY := .properties .js, \
ihse@20576 58 BIN := $(NASHORN_OUTPUTDIR)/nashorn_classes))
jlaskey@16198 59
alanb@16266 60 NASGEN_SRC := $(NASHORN_TOPDIR)/buildtools/nasgen/src
alanb@16266 61 ASM_SRC := $(JDK_TOPDIR)/src/share/classes/jdk/internal/org/objectweb/asm
sundar@16265 62
jlaskey@16198 63 # Build nasgen
ihse@20576 64 $(eval $(call SetupJavaCompilation,BUILD_NASGEN, \
ihse@20576 65 SETUP := GENERATE_NEWBYTECODE_DEBUG, \
ihse@20576 66 SRC := $(NASGEN_SRC) $(ASM_SRC), \
ihse@20576 67 BIN := $(NASHORN_OUTPUTDIR)/nasgen_classes, \
ihse@20576 68 ADD_JAVAC_FLAGS := -cp $(NASHORN_OUTPUTDIR)/nashorn_classes))
jlaskey@16198 69
jlaskey@16198 70 # Nasgen needs nashorn classes
jlaskey@16198 71 $(BUILD_NASGEN): $(BUILD_NASHORN)
jlaskey@16198 72
jlaskey@16198 73 # Copy classes to final classes dir and run nasgen to modify classes in jdk.nashorn.internal.objects package
jlaskey@16198 74 $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run: $(BUILD_NASGEN)
jlaskey@16198 75 $(ECHO) Running nasgen
jlaskey@16198 76 $(MKDIR) -p $(@D)
jlaskey@16198 77 $(RM) -rf $(@D)/jdk $(@D)/netscape
jlaskey@16198 78 $(CP) -R -p $(NASHORN_OUTPUTDIR)/nashorn_classes/* $(@D)/
sundar@16265 79 $(FIXPATH) $(JAVA) \
ihse@20576 80 -cp "$(NASHORN_OUTPUTDIR)/nasgen_classes$(PATH_SEP)$(NASHORN_OUTPUTDIR)/nashorn_classes" \
ihse@20576 81 jdk.nashorn.internal.tools.nasgen.Main $(@D) jdk.nashorn.internal.objects $(@D)
jlaskey@16198 82 $(TOUCH) $@
jlaskey@16198 83
jlaskey@16198 84 # Version file needs to be processed with version numbers
jlaskey@16198 85 VERSION_FILE := $(NASHORN_OUTPUTDIR)/classes/jdk/nashorn/internal/runtime/resources/version.properties
ihse@20576 86
jlaskey@16198 87 # Needs to happen after nasgen run since nasgen run deletes it
jlaskey@16198 88 $(VERSION_FILE): $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run
jlaskey@16198 89 $(VERSION_FILE): $(NASHORN_TOPDIR)/src/jdk/nashorn/internal/runtime/resources/version.properties-template
jlaskey@16198 90 $(ECHO) Creating version.properties
jlaskey@16198 91 $(MKDIR) -p $(@D)
jlaskey@16200 92 $(CAT) $< | $(SED) -e 's/$$(FULL_VERSION)/$(NASHORN_FULL_VERSION)/g' \
ihse@20576 93 -e 's/$$(RELEASE)/$(NASHORN_VERSION)/g' \
ihse@20576 94 -e '/^#.*$$/d' -e '/^$$/d' > $@
jlaskey@16198 95
jlaskey@16198 96
ihse@20576 97 MANIFEST_ATTRIBUTES := Name: jdk/nashorn/\nImplementation-Title: Oracle Nashorn\nImplementation-Version: $(NASHORN_FULL_VERSION)
jlaskey@16198 98
jlaskey@16198 99 # Create nashorn.jar from the final classes dir
ihse@20576 100 $(eval $(call SetupArchive,BUILD_NASHORN_JAR, \
jlaskey@16198 101 $(NASHORN_OUTPUTDIR)/classes/_the.nasgen.run \
ihse@20576 102 $(VERSION_FILE), \
ihse@20576 103 SRCS := $(NASHORN_OUTPUTDIR)/classes, \
ihse@20576 104 SUFFIXES := .class .js .properties Factory, \
ihse@20576 105 MANIFEST := $(NASHORN_TOPDIR)/src/META-INF/MANIFEST.MF, \
ihse@20576 106 EXTRA_MANIFEST_ATTR := $(MANIFEST_ATTRIBUTES), \
ihse@20576 107 SKIP_METAINF := true, \
ihse@20576 108 JAR := $(NASHORN_JAR)))
jlaskey@16198 109
jlaskey@16198 110 all: $(NASHORN_JAR)
ihse@20576 111
jlaskey@16198 112 .PHONY: all