Mon, 11 Feb 2013 21:26:06 +0530
8007915: Nashorn IR, codegen, parser packages and Context instance should be inaccessible to user code
Reviewed-by: lagergren, jlaskey, attila
jlaskey@3 | 1 | # |
jlaskey@7 | 2 | # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
jlaskey@3 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jlaskey@3 | 4 | # |
jlaskey@3 | 5 | # This code is free software; you can redistribute it and/or modify it |
jlaskey@3 | 6 | # under the terms of the GNU General Public License version 2 only, as |
jlaskey@3 | 7 | # published by the Free Software Foundation. Oracle designates this |
jlaskey@3 | 8 | # particular file as subject to the "Classpath" exception as provided |
jlaskey@3 | 9 | # by Oracle in the LICENSE file that accompanied this code. |
jlaskey@3 | 10 | # |
jlaskey@3 | 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
jlaskey@3 | 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jlaskey@3 | 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jlaskey@3 | 14 | # version 2 for more details (a copy is included in the LICENSE file that |
jlaskey@3 | 15 | # accompanied this code). |
jlaskey@3 | 16 | # |
jlaskey@3 | 17 | # You should have received a copy of the GNU General Public License version |
jlaskey@3 | 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
jlaskey@3 | 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jlaskey@3 | 20 | # |
jlaskey@3 | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
jlaskey@3 | 22 | # or visit www.oracle.com if you need additional information or have any |
jlaskey@3 | 23 | # questions. |
jlaskey@3 | 24 | # |
jlaskey@3 | 25 | |
jlaskey@3 | 26 | # Makefile for nashorn: wrapper around Ant build.xml file |
jlaskey@3 | 27 | |
jlaskey@3 | 28 | # |
jlaskey@3 | 29 | # On Solaris, the standard 'make' utility will not work with these makefiles. |
jlaskey@3 | 30 | # This little rule is only understood by Solaris make, and is harmless |
jlaskey@3 | 31 | # when seen by the GNU make tool. If using Solaris make, this causes the |
jlaskey@3 | 32 | # make command to fail. |
jlaskey@3 | 33 | # |
jlaskey@3 | 34 | SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33 |
jlaskey@3 | 35 | |
jlaskey@3 | 36 | # |
jlaskey@3 | 37 | # Minimal platform defs |
jlaskey@3 | 38 | # Need FullPath because we can't rely on gnumake abspath, until we use v3.81 |
jlaskey@3 | 39 | # |
jlaskey@3 | 40 | |
jlaskey@3 | 41 | SYSTEM_UNAME := $(shell uname) |
jlaskey@3 | 42 | |
jlaskey@3 | 43 | # Where is unwanted output to be delivered? |
jlaskey@3 | 44 | # On Windows, MKS uses the special file "NUL", cygwin uses the customary unix file. |
jlaskey@3 | 45 | ifeq ($(SYSTEM_UNAME), Windows_NT) |
jlaskey@3 | 46 | DEV_NULL = NUL |
jlaskey@3 | 47 | else |
jlaskey@3 | 48 | DEV_NULL = /dev/null |
jlaskey@3 | 49 | endif |
jlaskey@3 | 50 | |
jlaskey@3 | 51 | ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME))) |
jlaskey@3 | 52 | USING_CYGWIN = true |
jlaskey@3 | 53 | endif |
jlaskey@3 | 54 | |
jlaskey@3 | 55 | ifdef USING_CYGWIN |
jlaskey@3 | 56 | define FullPath |
jlaskey@3 | 57 | $(shell cygpath -a -s -m $1 2> $(DEV_NULL)) |
jlaskey@3 | 58 | endef |
jlaskey@3 | 59 | else |
jlaskey@3 | 60 | define FullPath |
jlaskey@3 | 61 | $(shell cd $1 2> $(DEV_NULL) && pwd) |
jlaskey@3 | 62 | endef |
jlaskey@3 | 63 | endif |
jlaskey@3 | 64 | |
jlaskey@3 | 65 | # |
jlaskey@3 | 66 | # Makefile args |
jlaskey@3 | 67 | # |
jlaskey@3 | 68 | |
jlaskey@3 | 69 | ifdef QUIET |
jlaskey@3 | 70 | ANT_OPTIONS += -quiet |
jlaskey@3 | 71 | endif |
jlaskey@3 | 72 | |
jlaskey@3 | 73 | ifdef VERBOSE |
jlaskey@3 | 74 | ANT_OPTIONS += -verbose -debug |
jlaskey@3 | 75 | endif |
jlaskey@3 | 76 | |
jlaskey@3 | 77 | ifdef JDK_VERSION |
jlaskey@3 | 78 | ANT_OPTIONS += -Djdk.version=$(JDK_VERSION) |
jlaskey@3 | 79 | endif |
jlaskey@3 | 80 | |
jlaskey@3 | 81 | ifdef FULL_VERSION |
jlaskey@3 | 82 | ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces |
jlaskey@3 | 83 | endif |
jlaskey@3 | 84 | |
jlaskey@3 | 85 | ifdef MILESTONE |
jlaskey@3 | 86 | ifneq ($(MILESTONE),fcs) |
jlaskey@3 | 87 | ANT_OPTIONS += -Dmilestone=$(MILESTONE) |
jlaskey@3 | 88 | else |
jlaskey@3 | 89 | ANT_OPTIONS += -Drelease=$(JDK_VERSION) |
jlaskey@3 | 90 | endif |
jlaskey@3 | 91 | endif |
jlaskey@3 | 92 | |
jlaskey@3 | 93 | ifdef BUILD_NUMBER |
jlaskey@3 | 94 | ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER) |
jlaskey@3 | 95 | else |
jlaskey@3 | 96 | ifdef JDK_BUILD_NUMBER |
jlaskey@3 | 97 | ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER) |
jlaskey@3 | 98 | endif |
jlaskey@3 | 99 | endif |
jlaskey@3 | 100 | |
jlaskey@3 | 101 | ifeq ($(VARIANT), DBG) |
jlaskey@3 | 102 | ANT_OPTIONS += -Djavac.debug=true |
jlaskey@3 | 103 | else |
jlaskey@3 | 104 | ifeq ($(VARIANT), OPT) |
jlaskey@3 | 105 | ANT_OPTIONS += -Djavac.debug=false |
jlaskey@3 | 106 | endif |
jlaskey@3 | 107 | endif |
jlaskey@3 | 108 | |
jlaskey@3 | 109 | ifeq ($(DEBUG_CLASSFILES), true) |
jlaskey@3 | 110 | ANT_OPTIONS += -Djavac.debug=true |
jlaskey@3 | 111 | ANT_OPTIONS += -Ddebug.classfiles=true |
jlaskey@3 | 112 | endif |
jlaskey@3 | 113 | |
jlaskey@3 | 114 | # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN) |
jlaskey@3 | 115 | # and the somewhat misnamed CLASS_VERSION (-target NN) |
jlaskey@3 | 116 | ifdef TARGET_CLASS_VERSION |
jlaskey@3 | 117 | ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION) |
jlaskey@3 | 118 | else |
jlaskey@3 | 119 | ifdef JAVAC_TARGET_ARG |
jlaskey@3 | 120 | ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG) |
jlaskey@3 | 121 | endif |
jlaskey@3 | 122 | endif |
jlaskey@3 | 123 | |
jlaskey@3 | 124 | ifdef SOURCE_LANGUAGE_VERSION |
jlaskey@3 | 125 | ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION) |
jlaskey@3 | 126 | else |
jlaskey@3 | 127 | ifdef JAVAC_SOURCE_ARG |
jlaskey@3 | 128 | ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG) |
jlaskey@3 | 129 | endif |
jlaskey@3 | 130 | endif |
jlaskey@3 | 131 | |
jlaskey@3 | 132 | ifdef ALT_BOOTDIR |
jlaskey@3 | 133 | ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR) |
jlaskey@3 | 134 | ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR) |
jlaskey@3 | 135 | endif |
jlaskey@3 | 136 | |
jlaskey@3 | 137 | # To facilitate bootstrapping, much of langtools can be compiled with (just) |
jlaskey@3 | 138 | # a boot JDK. However, some source files need to be compiled against |
jlaskey@3 | 139 | # new JDK API. In a bootstrap build, an import JDK may not be available, |
jlaskey@3 | 140 | # so build.xml can also build against the source files in a jdk repo, |
jlaskey@3 | 141 | # in which case it will automatically generate stub files for the new JDK API. |
jlaskey@3 | 142 | ifdef JDK_TOPDIR |
jlaskey@3 | 143 | ANT_OPTIONS += -Dimport.jdk=$(JDK_TOPDIR) |
jlaskey@3 | 144 | else |
jlaskey@3 | 145 | ifdef ALT_JDK_TOPDIR |
jlaskey@3 | 146 | ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_TOPDIR) |
jlaskey@3 | 147 | else |
jlaskey@3 | 148 | ifdef ALT_JDK_IMPORT_PATH |
jlaskey@3 | 149 | ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_IMPORT_PATH) |
jlaskey@3 | 150 | endif |
jlaskey@3 | 151 | endif |
jlaskey@3 | 152 | endif |
jlaskey@3 | 153 | |
jlaskey@3 | 154 | ifdef ALT_OUTPUTDIR |
jlaskey@3 | 155 | OUTPUTDIR = $(ALT_OUTPUTDIR) |
jlaskey@3 | 156 | ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build |
jlaskey@3 | 157 | ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist |
jlaskey@3 | 158 | else |
jlaskey@3 | 159 | OUTPUTDIR = .. |
jlaskey@3 | 160 | endif |
jlaskey@3 | 161 | #ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR)) |
jlaskey@3 | 162 | ABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR)) |
jlaskey@3 | 163 | |
jlaskey@3 | 164 | ANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp |
jlaskey@3 | 165 | ANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)' |
jlaskey@3 | 166 | |
jlaskey@3 | 167 | ifdef FINDBUGS_HOME |
jlaskey@3 | 168 | ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME) |
jlaskey@3 | 169 | endif |
jlaskey@3 | 170 | |
jlaskey@3 | 171 | ifdef ANT_HOME |
jlaskey@3 | 172 | ANT = $(ANT_HOME)/bin/ant |
jlaskey@3 | 173 | ifneq ($(shell test -x $(ANT) && echo OK), OK) |
jlaskey@3 | 174 | $(error $(ANT) not found -- please update ANT_HOME) |
jlaskey@3 | 175 | endif |
jlaskey@3 | 176 | else |
jlaskey@3 | 177 | ANT = ant |
jlaskey@3 | 178 | ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK) |
jlaskey@3 | 179 | $(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH) |
jlaskey@3 | 180 | endif |
jlaskey@3 | 181 | endif |
jlaskey@3 | 182 | |
jlaskey@3 | 183 | # Default target and expected 'do everything' target |
sundar@82 | 184 | all: test |
jlaskey@3 | 185 | |
jlaskey@3 | 186 | # Standard make clobber target |
jlaskey@3 | 187 | clobber: clean |
jlaskey@3 | 188 | |
jlaskey@3 | 189 | # All ant targets of interest |
sundar@26 | 190 | ANT_TARGETS = clean externals update-externals jar javadoc shelldoc docs test test262 test262parallel octane sunspider perf alltests |
jlaskey@3 | 191 | |
jlaskey@3 | 192 | # Create diagnostics log (careful, ant 1.8.0 -diagnostics always does an exit 1) |
jlaskey@3 | 193 | $(OUTPUTDIR)/build/ant-diagnostics.log: |
jlaskey@3 | 194 | @mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR) |
jlaskey@3 | 195 | @$(RM) $@ |
jlaskey@3 | 196 | $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $@ ; \ |
jlaskey@3 | 197 | $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -version >> $@ |
jlaskey@3 | 198 | |
jlaskey@3 | 199 | # Create a make target for each |
jlaskey@3 | 200 | $(ANT_TARGETS): $(OUTPUTDIR)/build/ant-diagnostics.log |
jlaskey@3 | 201 | @ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR) |
jlaskey@3 | 202 | $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@ |
jlaskey@3 | 203 | |
jlaskey@3 | 204 | #------------------------------------------------------------------- |
jlaskey@3 | 205 | # |
jlaskey@3 | 206 | # Targets for Oracle's internal JPRT build system |
jlaskey@3 | 207 | |
jlaskey@3 | 208 | CD = cd |
jlaskey@3 | 209 | ZIP = zip |
jlaskey@3 | 210 | |
jlaskey@3 | 211 | JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip |
jlaskey@3 | 212 | |
jlaskey@3 | 213 | jprt_build_product jprt_build_debug jprt_build_fastdebug: all |
jlaskey@3 | 214 | ( $(CD) $(OUTPUTDIR) && \ |
jlaskey@3 | 215 | $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist ) |
jlaskey@3 | 216 | |
jlaskey@3 | 217 | #------------------------------------------------------------------- |
jlaskey@3 | 218 | |
jlaskey@3 | 219 | # Declare these phony (not filenames) |
jlaskey@3 | 220 | .PHONY: $(ANT_TARGETS) all clobber \ |
jlaskey@3 | 221 | jprt_build_product jprt_build_debug jprt_build_fastdebug |