]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - edksetup.bat
Remove ASSERT() to make AllocatePool() service match PI spec.
[mirror_edk2.git] / edksetup.bat
... / ...
CommitLineData
1@REM @file\r
2@REM Windows batch file to setup a WORKSPACE environment\r
3@REM\r
4@REM Copyright (c) 2006 - 2008, Intel Corporation\r
5@REM All rights reserved. This program and the accompanying materials\r
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
9@REM\r
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
14@REM set CYGWIN_HOME=C:\cygwin\r
15\r
16@REM usage: \r
17@REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]\r
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
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
27@REM\r
28@REM Set the WORKSPACE to the current working directory\r
29@REM\r
30pushd .\r
31cd %~dp0\r
32\r
33if defined WORKSPACE (\r
34 if %WORKSPACE% == %CD% (\r
35 @REM workspace is not changed.\r
36 @goto ParseArgs\r
37 )\r
38)\r
39\r
40@REM set new workspace\r
41@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace\r
42set WORKSPACE=%CD%\r
43set EFI_SOURCE=\r
44set EDK_SOURCE=\r
45\r
46:ParseArgs\r
47@if /I "%1"=="-h" goto Usage\r
48@if /I "%1"=="-help" goto Usage\r
49@if /I "%1"=="--help" goto Usage\r
50@if /I "%1"=="/h" goto Usage\r
51@if /I "%1"=="/?" goto Usage\r
52@if /I "%1"=="/help" goto Usage\r
53\r
54@if /I not "%1"=="--nt32" goto no_nt32\r
55\r
56@REM Flag, --nt32 is set\r
57@REM The Nt32 Emluation Platform requires Microsoft Libraries\r
58@REM and headers to interface with Windows.\r
59\r
60if not defined VCINSTALLDIR (\r
61 if defined VS71COMNTOOLS (\r
62 call "%VS71COMNTOOLS%\vsvars32.bat"\r
63 ) else (\r
64 if defined VS80COMNTOOLS (\r
65 call "%VS80COMNTOOLS%\vsvars32.bat"\r
66 ) else (\r
67 if defined VS90COMNTOOLS (\r
68 call "%VS90COMNTOOLS%\vsvars32.bat"\r
69 ) else (\r
70 echo.\r
71 echo !!! WARNING !!! Cannot find Visual Studio !!!\r
72 echo.\r
73 )\r
74 )\r
75 )\r
76)\r
77shift\r
78\r
79:no_nt32\r
80@if /I "%1"=="NewBuild" shift\r
81@if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
82@IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools\r
83@call %EDK_TOOLS_PATH%\toolsetup.bat %*\r
84@if /I "%1"=="Reconfig" shift\r
85@goto check_cygwin\r
86\r
87:BadBaseTools\r
88 @REM\r
89 @REM Need the BaseTools Package in order to build\r
90 @REM\r
91 echo.\r
92 echo !!! ERROR !!! The BaseTools Package was not found !!!\r
93 echo.\r
94 echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,\r
95 echo For example,\r
96 echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools\r
97 echo The setup script, toolsetup.bat must reside in this folder.\r
98 echo.\r
99 @goto end\r
100\r
101:check_cygwin\r
102 @if exist c:\cygwin (\r
103 @set CYGWIN_HOME=c:\cygwin\r
104 ) else (\r
105 @echo.\r
106 @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!\r
107 @echo.\r
108 )\r
109\r
110@if NOT "%1"=="" goto Usage\r
111@goto end\r
112\r
113:Usage\r
114 @echo.\r
115 @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"\r
116 @echo --nt32 Call vsvars32.bat for NT32 platform build.\r
117 @echo.\r
118 @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.\r
119 @echo.\r
120 @echo Note that target.template, tools_def.template and build_rules.template\r
121 @echo will be only copied to target.txt, tools_def.txt and build_rule.txt\r
122 @echo respectively if they do not exist. Using option [Reconfig] to force the copy. \r
123 @echo.\r
124 @goto end\r
125\r
126:end\r
127 @popd\r
128 @echo on\r
129\r