annotate make/windows/build.bat @ 6031:6e4b0b4481b9

Merge from main OpenJDK repository
author Greg Lewis <glewis@eyesbeyond.com>
date Sat, 03 Feb 2018 14:01:55 -0800
parents 94ec88ca68e2
children
rev   line source
duke@0 1 @echo off
duke@0 2 REM
zgu@4427 3 REM Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
duke@0 4 REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 5 REM
duke@0 6 REM This code is free software; you can redistribute it and/or modify it
duke@0 7 REM under the terms of the GNU General Public License version 2 only, as
duke@0 8 REM published by the Free Software Foundation.
duke@0 9 REM
duke@0 10 REM This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 11 REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 12 REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 13 REM version 2 for more details (a copy is included in the LICENSE file that
duke@0 14 REM accompanied this code).
duke@0 15 REM
duke@0 16 REM You should have received a copy of the GNU General Public License version
duke@0 17 REM 2 along with this work; if not, write to the Free Software Foundation,
duke@0 18 REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 19 REM
trims@1563 20 REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1563 21 REM or visit www.oracle.com if you need additional information or have any
trims@1563 22 REM questions.
duke@0 23 REM
duke@0 24 REM
duke@0 25
duke@0 26
duke@0 27 REM
duke@0 28 REM Since we don't have uname and we could be cross-compiling,
duke@0 29 REM Use the compiler to determine which ARCH we are building
duke@0 30 REM
dcubed@1415 31 REM Note: Running this batch file from the Windows command shell requires
dcubed@1415 32 REM that "grep" be accessible on the PATH. An MKS install does this.
dcubed@1415 33 REM
duke@0 34 cl 2>&1 | grep "IA-64" >NUL
duke@0 35 if %errorlevel% == 0 goto isia64
duke@0 36 cl 2>&1 | grep "AMD64" >NUL
duke@0 37 if %errorlevel% == 0 goto amd64
phh@3294 38 cl 2>&1 | grep "x64" >NUL
phh@3294 39 if %errorlevel% == 0 goto amd64
duke@0 40 set ARCH=x86
duke@0 41 set BUILDARCH=i486
duke@0 42 set Platform_arch=x86
duke@0 43 set Platform_arch_model=x86_32
duke@0 44 goto end
duke@0 45 :amd64
duke@0 46 set LP64=1
duke@0 47 set ARCH=x86
duke@0 48 set BUILDARCH=amd64
duke@0 49 set Platform_arch=x86
duke@0 50 set Platform_arch_model=x86_64
duke@0 51 goto end
duke@0 52 :isia64
duke@0 53 set LP64=1
duke@0 54 set ARCH=ia64
duke@0 55 set Platform_arch=ia64
duke@0 56 set Platform_arch_model=ia64
duke@0 57 :end
duke@0 58
duke@0 59 if "%4" == "" goto usage
duke@0 60 if not "%7" == "" goto usage
duke@0 61
duke@0 62 if "%1" == "product" goto test1
duke@0 63 if "%1" == "debug" goto test1
duke@0 64 if "%1" == "fastdebug" goto test1
dcubed@1409 65 if "%1" == "tree" goto test1
duke@0 66 goto usage
duke@0 67
duke@0 68 :test1
duke@0 69 if "%2" == "core" goto test2
duke@0 70 if "%2" == "compiler1" goto test2
duke@0 71 if "%2" == "compiler2" goto test2
duke@0 72 if "%2" == "tiered" goto test2
duke@0 73 if "%2" == "adlc" goto build_adlc
duke@0 74
duke@0 75 goto usage
duke@0 76
duke@0 77 :test2
dcubed@1409 78 if "%1" == "tree" goto build_tree
duke@0 79 REM check_j2se_version
duke@0 80 REM jvmti.make requires J2SE 1.4.x or newer.
duke@0 81 REM If not found then fail fast.
duke@0 82 %4\bin\javap javax.xml.transform.TransformerFactory >NUL
duke@0 83 if %errorlevel% == 0 goto build
duke@0 84 echo.
duke@0 85 echo J2SE version found at %4\bin\java:
duke@0 86 %4\bin\java -version
duke@0 87 echo.
duke@0 88 echo An XSLT processor (J2SE 1.4.x or newer) is required to
duke@0 89 echo bootstrap this build
duke@0 90 echo.
duke@0 91
duke@0 92 goto usage
duke@0 93
duke@0 94 :build
kamg@91 95 nmake -f %3/make/windows/build.make Variant=%2 WorkSpace=%3 BootStrapDir=%4 BuildUser="%USERNAME%" HOTSPOT_BUILD_VERSION="%5" %1
duke@0 96 goto end
duke@0 97
duke@0 98 :build_adlc
kamg@91 99 nmake -f %3/make/windows/build.make Variant=compiler2 WorkSpace=%3 BootStrapDir=%4 BuildUser="%USERNAME%" HOTSPOT_BUILD_VERSION=%5 ADLC_ONLY=1 %1
duke@0 100 goto end
duke@0 101
dcubed@1409 102 :build_tree
dcubed@1409 103 nmake -f %3/make/windows/build.make Variant=%2 WorkSpace=%3 BootStrapDir=%4 BuildUser="%USERNAME%" HOTSPOT_BUILD_VERSION="%5" %1
dcubed@1409 104 goto end
dcubed@1409 105
duke@0 106 :usage
duke@0 107 echo Usage: build flavor version workspace bootstrap_dir [build_id] [windbg_home]
duke@0 108 echo.
duke@0 109 echo where:
duke@0 110 echo flavor is "product", "debug" or "fastdebug",
zgu@4427 111 echo version is "core", "compiler1", "compiler2", or "tiered",
duke@0 112 echo workspace is source directory without trailing slash,
dcubed@1409 113 echo bootstrap_dir is a full path to a JDK in which bin/java
dcubed@1409 114 echo and bin/javac are present and working, and build_id is an
duke@0 115 echo optional build identifier displayed by java -version
dcubed@1415 116 exit /b 1
duke@0 117
duke@0 118 :end
dcubed@1415 119 exit /b %errorlevel%