]>
Commit | Line | Data |
---|---|---|
8014e7ce | 1 | @REM @file\r |
2 | @REM Windows batch file to setup a WORKSPACE environment\r | |
878ddf1f | 3 | @REM\r |
48604ef9 | 4 | @REM Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r |
24542fb2 | 5 | @REM This program and the accompanying materials\r |
878ddf1f | 6 | @REM are licensed and made available under the terms and conditions of the BSD License\r |
7 | @REM which accompanies this distribution. The full text of the license may be found at\r | |
8 | @REM http://opensource.org/licenses/bsd-license.php\r | |
a29212b2 | 9 | @REM\r |
878ddf1f | 10 | @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | @REM\r | |
13 | \r | |
a29212b2 | 14 | @REM set CYGWIN_HOME=C:\cygwin\r |
878ddf1f | 15 | \r |
8014e7ce | 16 | @REM usage: \r |
17 | @REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]\r | |
302e0e4a | 18 | @REM if the argument, skip is present, only the paths and the\r |
19 | @REM test and set of environment settings are performed. \r | |
878ddf1f | 20 | \r |
21 | @REM ##############################################################\r | |
22 | @REM # You should not have to modify anything below this line\r | |
23 | @REM #\r | |
24 | \r | |
25 | @echo off\r | |
26 | \r | |
3fab94ed | 27 | @REM\r |
28 | @REM Set the WORKSPACE to the current working directory\r | |
29 | @REM\r | |
b7509087 | 30 | pushd .\r |
31 | cd %~dp0\r | |
d27bd9e9 | 32 | \r |
dff2673e LG |
33 | if not defined WORKSPACE (\r |
34 | @goto SetWorkSpace\r | |
d27bd9e9 LG |
35 | )\r |
36 | \r | |
dff2673e LG |
37 | if %WORKSPACE% == %CD% (\r |
38 | @REM Workspace is not changed.\r | |
39 | @goto ParseArgs\r | |
40 | )\r | |
41 | \r | |
42 | :SetWorkSpace\r | |
d27bd9e9 LG |
43 | @REM set new workspace\r |
44 | @REM clear EFI_SOURCE and EDK_SOURCE for the new workspace\r | |
3fab94ed | 45 | set WORKSPACE=%CD%\r |
d27bd9e9 LG |
46 | set EFI_SOURCE=\r |
47 | set EDK_SOURCE=\r | |
3fab94ed | 48 | \r |
d27bd9e9 | 49 | :ParseArgs\r |
26096d36 | 50 | @if /I "%1"=="-h" goto Usage\r |
51 | @if /I "%1"=="-help" goto Usage\r | |
52 | @if /I "%1"=="--help" goto Usage\r | |
53 | @if /I "%1"=="/h" goto Usage\r | |
54 | @if /I "%1"=="/?" goto Usage\r | |
55 | @if /I "%1"=="/help" goto Usage\r | |
8014e7ce | 56 | \r |
3a6b4559 | 57 | @if /I not "%1"=="--nt32" goto no_nt32\r |
8014e7ce | 58 | \r |
59 | @REM Flag, --nt32 is set\r | |
60 | @REM The Nt32 Emluation Platform requires Microsoft Libraries\r | |
61 | @REM and headers to interface with Windows.\r | |
62 | \r | |
402bbc76 | 63 | if not defined VCINSTALLDIR (\r |
48604ef9 LG |
64 | if defined VS100COMNTOOLS (\r |
65 | call "%VS100COMNTOOLS%\vsvars32.bat"\r | |
402bbc76 | 66 | ) else (\r |
48604ef9 LG |
67 | if defined VS90COMNTOOLS (\r |
68 | call "%VS90COMNTOOLS%\vsvars32.bat"\r | |
402bbc76 | 69 | ) else (\r |
48604ef9 LG |
70 | if defined VS80COMNTOOLS (\r |
71 | call "%VS80COMNTOOLS%\vsvars32.bat"\r | |
c16243d8 | 72 | ) else (\r |
48604ef9 LG |
73 | if defined VS71COMNTOOLS (\r |
74 | call "%VS71COMNTOOLS%\vsvars32.bat"\r | |
75 | ) else (\r | |
76 | echo.\r | |
77 | echo !!! WARNING !!! Cannot find Visual Studio !!!\r | |
78 | echo.\r | |
79 | )\r | |
c16243d8 | 80 | )\r |
402bbc76 | 81 | )\r |
82 | )\r | |
83 | )\r | |
b7509087 | 84 | shift\r |
b7509087 | 85 | \r |
3a6b4559 | 86 | :no_nt32\r |
8014e7ce | 87 | @if /I "%1"=="NewBuild" shift\r |
88 | @if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r | |
89 | @IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools\r | |
90 | @call %EDK_TOOLS_PATH%\toolsetup.bat %*\r | |
3a6b4559 | 91 | @if /I "%1"=="Reconfig" shift\r |
92 | @goto check_cygwin\r | |
8014e7ce | 93 | \r |
94 | :BadBaseTools\r | |
95 | @REM\r | |
96 | @REM Need the BaseTools Package in order to build\r | |
97 | @REM\r | |
878ddf1f | 98 | echo.\r |
8014e7ce | 99 | echo !!! ERROR !!! The BaseTools Package was not found !!!\r |
878ddf1f | 100 | echo.\r |
8014e7ce | 101 | echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,\r |
102 | echo For example,\r | |
103 | echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools\r | |
104 | echo The setup script, toolsetup.bat must reside in this folder.\r | |
105 | echo.\r | |
106 | @goto end\r | |
107 | \r | |
a29212b2 | 108 | :check_cygwin\r |
3a6b4559 | 109 | @if exist c:\cygwin (\r |
110 | @set CYGWIN_HOME=c:\cygwin\r | |
8014e7ce | 111 | ) else (\r |
3a6b4559 | 112 | @echo.\r |
113 | @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!\r | |
114 | @echo.\r | |
8014e7ce | 115 | )\r |
878ddf1f | 116 | \r |
11f009f1 | 117 | @if NOT "%1"=="" goto Usage\r |
3a6b4559 | 118 | @goto end\r |
2fcfed38 | 119 | \r |
70edbc34 | 120 | :Usage\r |
3a6b4559 | 121 | @echo.\r |
122 | @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"\r | |
123 | @echo --nt32 Call vsvars32.bat for NT32 platform build.\r | |
124 | @echo.\r | |
125 | @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.\r | |
126 | @echo.\r | |
127 | @echo Note that target.template, tools_def.template and build_rules.template\r | |
128 | @echo will be only copied to target.txt, tools_def.txt and build_rule.txt\r | |
129 | @echo respectively if they do not exist. Using option [Reconfig] to force the copy. \r | |
130 | @echo.\r | |
8014e7ce | 131 | @goto end\r |
3fab94ed | 132 | \r |
878ddf1f | 133 | :end\r |
8014e7ce | 134 | @popd\r |
135 | @echo on\r | |
878ddf1f | 136 | \r |