lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 1 | @REM @file
|
| 2 | @REM Windows batch file to setup a WORKSPACE environment
|
bbahnsen | 878ddf1 | 2006-04-21 22:54:32 +0000 | [diff] [blame] | 3 | @REM
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 4 | @REM Copyright (c) 2006 - 2008, Intel Corporation
|
bbahnsen | 878ddf1 | 2006-04-21 22:54:32 +0000 | [diff] [blame] | 5 | @REM All rights reserved. This program and the accompanying materials
|
| 6 | @REM are licensed and made available under the terms and conditions of the BSD License
|
| 7 | @REM which accompanies this distribution. The full text of the license may be found at
|
| 8 | @REM http://opensource.org/licenses/bsd-license.php
|
yshi8 | a29212b | 2006-05-09 06:11:05 +0000 | [diff] [blame] | 9 | @REM
|
bbahnsen | 878ddf1 | 2006-04-21 22:54:32 +0000 | [diff] [blame] | 10 | @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
| 11 | @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
| 12 | @REM
|
| 13 |
|
yshi8 | a29212b | 2006-05-09 06:11:05 +0000 | [diff] [blame] | 14 | @REM set CYGWIN_HOME=C:\cygwin
|
bbahnsen | 878ddf1 | 2006-04-21 22:54:32 +0000 | [diff] [blame] | 15 |
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 16 | @REM usage:
|
| 17 | @REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]
|
lhauch | 302e0e4 | 2006-06-09 15:26:28 +0000 | [diff] [blame] | 18 | @REM if the argument, skip is present, only the paths and the
|
| 19 | @REM test and set of environment settings are performed.
|
bbahnsen | 878ddf1 | 2006-04-21 22:54:32 +0000 | [diff] [blame] | 20 |
|
| 21 | @REM ##############################################################
|
| 22 | @REM # You should not have to modify anything below this line
|
| 23 | @REM #
|
| 24 |
|
| 25 | @echo off
|
| 26 |
|
yshi8 | a29212b | 2006-05-09 06:11:05 +0000 | [diff] [blame] | 27 | @REM
|
jwang36 | 3fab94e | 2007-06-22 06:25:37 +0000 | [diff] [blame] | 28 | @REM Set the WORKSPACE to the current working directory
|
| 29 | @REM
|
jwang36 | b750908 | 2007-10-11 08:58:33 +0000 | [diff] [blame] | 30 | pushd .
|
| 31 | cd %~dp0
|
jwang36 | 3fab94e | 2007-06-22 06:25:37 +0000 | [diff] [blame] | 32 | set WORKSPACE=%CD%
|
| 33 |
|
jwang36 | 26096d3 | 2007-10-15 01:58:41 +0000 | [diff] [blame] | 34 | @if /I "%1"=="-h" goto Usage
|
| 35 | @if /I "%1"=="-help" goto Usage
|
| 36 | @if /I "%1"=="--help" goto Usage
|
| 37 | @if /I "%1"=="/h" goto Usage
|
| 38 | @if /I "%1"=="/?" goto Usage
|
| 39 | @if /I "%1"=="/help" goto Usage
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 40 |
|
lhauch | 3a6b455 | 2008-12-31 16:57:24 +0000 | [diff] [blame] | 41 | @if /I not "%1"=="--nt32" goto no_nt32
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 42 |
|
| 43 | @REM Flag, --nt32 is set
|
| 44 | @REM The Nt32 Emluation Platform requires Microsoft Libraries
|
| 45 | @REM and headers to interface with Windows.
|
| 46 |
|
jwang36 | 402bbc7 | 2007-10-31 09:12:54 +0000 | [diff] [blame] | 47 | if not defined VCINSTALLDIR (
|
| 48 | if defined VS71COMNTOOLS (
|
| 49 | call "%VS71COMNTOOLS%\vsvars32.bat"
|
| 50 | ) else (
|
| 51 | if defined VS80COMNTOOLS (
|
| 52 | call "%VS80COMNTOOLS%\vsvars32.bat"
|
| 53 | ) else (
|
ywang | c16243d | 2009-11-16 23:02:57 +0000 | [diff] [blame^] | 54 | if defined VS90COMNTOOLS (
|
| 55 | call "%VS90COMNTOOLS%\vsvars32.bat"
|
| 56 | ) else (
|
| 57 | echo.
|
| 58 | echo !!! WARNING !!! Cannot find Visual Studio !!!
|
| 59 | echo.
|
| 60 | )
|
jwang36 | 402bbc7 | 2007-10-31 09:12:54 +0000 | [diff] [blame] | 61 | )
|
| 62 | )
|
| 63 | )
|
jwang36 | b750908 | 2007-10-11 08:58:33 +0000 | [diff] [blame] | 64 | shift
|
jwang36 | b750908 | 2007-10-11 08:58:33 +0000 | [diff] [blame] | 65 |
|
lhauch | 3a6b455 | 2008-12-31 16:57:24 +0000 | [diff] [blame] | 66 | :no_nt32
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 67 | @if /I "%1"=="NewBuild" shift
|
| 68 | @if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
|
| 69 | @IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
|
| 70 | @call %EDK_TOOLS_PATH%\toolsetup.bat %*
|
lhauch | 3a6b455 | 2008-12-31 16:57:24 +0000 | [diff] [blame] | 71 | @if /I "%1"=="Reconfig" shift
|
| 72 | @goto check_cygwin
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 73 |
|
| 74 | :BadBaseTools
|
| 75 | @REM
|
| 76 | @REM Need the BaseTools Package in order to build
|
| 77 | @REM
|
| 78 | echo.
|
| 79 | echo !!! ERROR !!! The BaseTools Package was not found !!!
|
| 80 | echo.
|
| 81 | echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,
|
| 82 | echo For example,
|
| 83 | echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools
|
| 84 | echo The setup script, toolsetup.bat must reside in this folder.
|
| 85 | echo.
|
| 86 | @goto end
|
| 87 |
|
yshi8 | a29212b | 2006-05-09 06:11:05 +0000 | [diff] [blame] | 88 | :check_cygwin
|
lhauch | 3a6b455 | 2008-12-31 16:57:24 +0000 | [diff] [blame] | 89 | @if exist c:\cygwin (
|
| 90 | @set CYGWIN_HOME=c:\cygwin
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 91 | ) else (
|
lhauch | 3a6b455 | 2008-12-31 16:57:24 +0000 | [diff] [blame] | 92 | @echo.
|
| 93 | @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
|
| 94 | @echo.
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 95 | )
|
bbahnsen | 878ddf1 | 2006-04-21 22:54:32 +0000 | [diff] [blame] | 96 |
|
lhauch | 11f009f | 2006-07-24 16:03:47 +0000 | [diff] [blame] | 97 | @if NOT "%1"=="" goto Usage
|
lhauch | 3a6b455 | 2008-12-31 16:57:24 +0000 | [diff] [blame] | 98 | @goto end
|
wuyizhong | 2fcfed3 | 2006-10-17 07:07:24 +0000 | [diff] [blame] | 99 |
|
lhauch | 70edbc3 | 2006-07-14 06:46:15 +0000 | [diff] [blame] | 100 | :Usage
|
lhauch | 3a6b455 | 2008-12-31 16:57:24 +0000 | [diff] [blame] | 101 | @echo.
|
| 102 | @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"
|
| 103 | @echo --nt32 Call vsvars32.bat for NT32 platform build.
|
| 104 | @echo.
|
| 105 | @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.
|
| 106 | @echo.
|
| 107 | @echo Note that target.template, tools_def.template and build_rules.template
|
| 108 | @echo will be only copied to target.txt, tools_def.txt and build_rule.txt
|
| 109 | @echo respectively if they do not exist. Using option [Reconfig] to force the copy.
|
| 110 | @echo.
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 111 | @goto end
|
jwang36 | 3fab94e | 2007-06-22 06:25:37 +0000 | [diff] [blame] | 112 |
|
bbahnsen | 878ddf1 | 2006-04-21 22:54:32 +0000 | [diff] [blame] | 113 | :end
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 114 | @popd
|
| 115 | @echo on
|
bbahnsen | 878ddf1 | 2006-04-21 22:54:32 +0000 | [diff] [blame] | 116 |
|