nashorn/make/Makefile
changeset 16253 35bb4f53b5e2
parent 16247 a79eb9df5b0d
child 21865 e15829766c38
equal deleted inserted replaced
16252:3bfe9b68a0fa 16253:35bb4f53b5e2
    21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22 # or visit www.oracle.com if you need additional information or have any
    22 # or visit www.oracle.com if you need additional information or have any
    23 # questions.
    23 # questions.
    24 #
    24 #
    25 
    25 
    26 # Makefile for nashorn: wrapper around Ant build.xml file
       
    27 
       
    28 #
    26 #
    29 # On Solaris, the standard 'make' utility will not work with these makefiles.
    27 # On Solaris, the standard 'make' utility will not work with these makefiles.
    30 #    This little rule is only understood by Solaris make, and is harmless
    28 #    This little rule is only understood by Solaris make, and is harmless
    31 #    when seen by the GNU make tool. If using Solaris make, this causes the
    29 #    when seen by the GNU make tool. If using Solaris make, this causes the
    32 #    make command to fail.
    30 #    make command to fail.
    33 #
    31 #
    34 SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
    32 SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
    35 
    33 
    36 #
       
    37 # Minimal platform defs
       
    38 # Need FullPath because we can't rely on gnumake abspath, until we use v3.81
       
    39 #
       
    40 
       
    41 SYSTEM_UNAME := $(shell uname)
       
    42 
       
    43 # Where is unwanted output to be delivered?
       
    44 # On Windows, MKS uses the special file "NUL", cygwin uses the customary unix file.
       
    45 ifeq ($(SYSTEM_UNAME), Windows_NT)
       
    46 DEV_NULL = NUL
       
    47 else
       
    48 DEV_NULL = /dev/null 
       
    49 endif
       
    50 
       
    51 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
       
    52 USING_CYGWIN = true
       
    53 endif
       
    54 
       
    55 ifdef USING_CYGWIN
       
    56 define FullPath
       
    57 $(shell cygpath -a -s -m $1 2> $(DEV_NULL))
       
    58 endef
       
    59 else
       
    60 define FullPath
       
    61 $(shell cd $1 2> $(DEV_NULL) && pwd)
       
    62 endef
       
    63 endif
       
    64 
       
    65 #
       
    66 # Makefile args
       
    67 #
       
    68 
       
    69 ifdef QUIET
       
    70   ANT_OPTIONS += -quiet
       
    71 endif
       
    72 
       
    73 ifdef VERBOSE
       
    74   ANT_OPTIONS += -verbose -debug
       
    75 endif
       
    76 
       
    77 ifdef JDK_VERSION
       
    78   ANT_OPTIONS += -Djdk.version=$(JDK_VERSION)
       
    79 endif 
       
    80 
       
    81 ifdef FULL_VERSION
       
    82   ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces
       
    83 endif 
       
    84 
       
    85 ifdef MILESTONE
       
    86 ifneq ($(MILESTONE),fcs)
       
    87   ANT_OPTIONS += -Dmilestone=$(MILESTONE)
       
    88 else
       
    89   ANT_OPTIONS += -Drelease=$(JDK_VERSION)
       
    90 endif
       
    91 endif
       
    92 
       
    93 ifdef BUILD_NUMBER
       
    94   ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER)
       
    95 else
       
    96   ifdef JDK_BUILD_NUMBER
       
    97     ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER)
       
    98   endif
       
    99 endif
       
   100 
       
   101 ifeq ($(VARIANT), DBG)
       
   102   ANT_OPTIONS += -Djavac.debug=true
       
   103 else
       
   104   ifeq ($(VARIANT), OPT)
       
   105     ANT_OPTIONS += -Djavac.debug=false
       
   106   endif
       
   107 endif
       
   108 
       
   109 ifeq ($(DEBUG_CLASSFILES), true)
       
   110   ANT_OPTIONS += -Djavac.debug=true
       
   111   ANT_OPTIONS += -Ddebug.classfiles=true
       
   112 endif
       
   113 
       
   114 # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
       
   115 # and the somewhat misnamed CLASS_VERSION (-target NN)
       
   116 ifdef TARGET_CLASS_VERSION
       
   117   ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION)
       
   118 else
       
   119   ifdef JAVAC_TARGET_ARG 
       
   120     ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG)
       
   121   endif
       
   122 endif 
       
   123 
       
   124 ifdef SOURCE_LANGUAGE_VERSION
       
   125   ANT_OPTIONS += -Djavac.source=$(SOURCE_LANGUAGE_VERSION)
       
   126 else
       
   127   ifdef JAVAC_SOURCE_ARG 
       
   128     ANT_OPTIONS += -Djavac.source=$(JAVAC_SOURCE_ARG)
       
   129   endif
       
   130 endif 
       
   131 
       
   132 # To facilitate bootstrapping, much of langtools can be compiled with (just)
       
   133 # a boot JDK. However, some source files need to be compiled against 
       
   134 # new JDK API. In a bootstrap build, an import JDK may not be available,
       
   135 # so build.xml can also build against the source files in a jdk repo,
       
   136 # in which case it will automatically generate stub files for the new JDK API.
       
   137 ifdef JDK_TOPDIR
       
   138   ANT_OPTIONS += -Dimport.jdk=$(JDK_TOPDIR)
       
   139 else 
       
   140   ifdef ALT_JDK_TOPDIR
       
   141     ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_TOPDIR)
       
   142   else 
       
   143     ifdef ALT_JDK_IMPORT_PATH
       
   144       ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_IMPORT_PATH)
       
   145     endif
       
   146   endif
       
   147 endif
       
   148 
       
   149 ifdef ALT_OUTPUTDIR
       
   150   OUTPUTDIR = $(ALT_OUTPUTDIR)
       
   151   ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build
       
   152   ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist
       
   153 else
       
   154   OUTPUTDIR = ..
       
   155 endif
       
   156 #ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR))
       
   157 ABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR))
       
   158 
       
   159 ANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp
       
   160 ANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)'
       
   161 
       
   162 ifdef FINDBUGS_HOME
       
   163   ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME)
       
   164 endif
       
   165 
       
   166 ifdef ANT_HOME
       
   167   ANT = $(ANT_HOME)/bin/ant
       
   168   ifneq ($(shell test -x $(ANT) && echo OK), OK)
       
   169     $(error $(ANT) not found -- please update ANT_HOME)
       
   170   endif
       
   171 else
       
   172   ANT = ant
       
   173   ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK)
       
   174     $(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH)
       
   175   endif
       
   176 endif
       
   177 
    34 
   178 # Default target and expected 'do everything' target
    35 # Default target and expected 'do everything' target
   179 all: test
    36 all:
       
    37 	echo Nashorn can only be built with NEWBUILD=true
   180 
    38 
   181 # Standard make clobber target
    39 # Standard make clobber target
   182 clobber: clean
    40 clobber:
   183 
       
   184 # All ant targets of interest
       
   185 ANT_TARGETS = clean externals update-externals jar javadoc shelldoc docs test test262 test262parallel octane sunspider perf alltests
       
   186 
       
   187 # Create diagnostics log (careful, ant 1.8.0 -diagnostics always does an exit 1)
       
   188 $(OUTPUTDIR)/build/ant-diagnostics.log:
       
   189 	@mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
       
   190 	@$(RM) $@
       
   191 	$(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $@ ; \
       
   192 	  $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -version >> $@
       
   193 
       
   194 # Create a make target for each
       
   195 $(ANT_TARGETS): $(OUTPUTDIR)/build/ant-diagnostics.log
       
   196 	@ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR)
       
   197 	$(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@
       
   198 
    41 
   199 #-------------------------------------------------------------------
    42 #-------------------------------------------------------------------
   200 #
    43 #
   201 # Targets for Oracle's internal JPRT build system
    44 # Targets for Oracle's internal JPRT build system
   202 
    45