]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - edksetup.bat
FatBinPkg: Update EBC/IA32/X64/IPF binaries
[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 - 2014, Intel Corporation. All rights reserved.<BR>\r
5@REM 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 not defined WORKSPACE (\r
34 goto SetWorkSpace\r
35)\r
36\r
37if %WORKSPACE% == %CD% (\r
38 @REM Workspace is not changed.\r
39 goto ParseArgs\r
40)\r
41\r
42:SetWorkSpace\r
43@REM set new workspace\r
44@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace\r
45set WORKSPACE=%CD%\r
46set EFI_SOURCE=\r
47set EDK_SOURCE=\r
48\r
49:ParseArgs\r
50if /I "%1"=="-h" goto Usage\r
51if /I "%1"=="-help" goto Usage\r
52if /I "%1"=="--help" goto Usage\r
53if /I "%1"=="/h" goto Usage\r
54if /I "%1"=="/?" goto Usage\r
55if /I "%1"=="/help" goto Usage\r
56\r
57if /I not "%1"=="--nt32" goto no_nt32\r
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
63if not defined VCINSTALLDIR (\r
64 if defined VS120COMNTOOLS (\r
65 call "%VS120COMNTOOLS%\vsvars32.bat"\r
66 ) else (\r
67 if defined VS110COMNTOOLS (\r
68 call "%VS110COMNTOOLS%\vsvars32.bat"\r
69 ) else (\r
70 if defined VS100COMNTOOLS (\r
71 call "%VS100COMNTOOLS%\vsvars32.bat"\r
72 ) else (\r
73 if defined VS90COMNTOOLS (\r
74 call "%VS90COMNTOOLS%\vsvars32.bat"\r
75 ) else (\r
76 if defined VS80COMNTOOLS (\r
77 call "%VS80COMNTOOLS%\vsvars32.bat"\r
78 ) else (\r
79 if defined VS71COMNTOOLS (\r
80 call "%VS71COMNTOOLS%\vsvars32.bat"\r
81 ) else (\r
82 echo.\r
83 echo !!! WARNING !!! Cannot find Visual Studio !!!\r
84 echo.\r
85 )\r
86 )\r
87 )\r
88 )\r
89 )\r
90 )\r
91)\r
92shift\r
93\r
94:no_nt32\r
95if /I "%1"=="NewBuild" shift\r
96set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
97IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools\r
98call %EDK_TOOLS_PATH%\toolsetup.bat %*\r
99if /I "%1"=="Reconfig" shift\r
100goto check_cygwin\r
101\r
102:BadBaseTools\r
103 @REM\r
104 REM Need the BaseTools Package in order to build\r
105 @REM\r
106 @echo.\r
107 @echo !!! ERROR !!! The BaseTools Package was not found !!!\r
108 @echo.\r
109 @echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,\r
110 @echo For example,\r
111 @echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools\r
112 @echo The setup script, toolsetup.bat must reside in this folder.\r
113 @echo.\r
114 goto end\r
115\r
116:check_cygwin\r
117if defined CYGWIN_HOME (\r
118 if not exist "%CYGWIN_HOME%" (\r
119 @echo.\r
120 @echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!\r
121 @echo.\r
122 )\r
123) else (\r
124 if exist c:\cygwin (\r
125 set CYGWIN_HOME=c:\cygwin\r
126 ) else (\r
127 @echo.\r
128 @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!\r
129 @echo.\r
130 )\r
131)\r
132\r
133:cygwin_done\r
134if "%1"=="" goto end\r
135\r
136:Usage\r
137 @echo.\r
138 @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"\r
139 @echo --nt32 Call vsvars32.bat for NT32 platform build.\r
140 @echo.\r
141 @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.\r
142 @echo.\r
143 @echo Note that target.template, tools_def.template and build_rules.template\r
144 @echo will only be copied to target.txt, tools_def.txt and build_rule.txt\r
145 @echo respectively if they do not exist. Use option [Reconfig] to force the copy.\r
146 @echo.\r
147 goto end\r
148\r
149:end\r
150 popd\r
151\r