]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - edksetup.bat
Edk2: Remove nt32 related flag in bat files
[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 - 2016, Intel Corporation. All rights reserved.<BR>\r
5@REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
6@REM SPDX-License-Identifier: BSD-2-Clause-Patent\r
7@REM\r
8\r
9@REM set CYGWIN_HOME=C:\cygwin\r
10\r
11@REM usage:\r
12@REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]\r
13@REM if the argument, skip is present, only the paths and the\r
14@REM test and set of environment settings are performed.\r
15\r
16@REM ##############################################################\r
17@REM # You should not have to modify anything below this line\r
18@REM #\r
19\r
20@echo off\r
21\r
22@REM\r
23@REM Set the WORKSPACE to the current working directory\r
24@REM\r
25pushd .\r
26cd %~dp0\r
27\r
28if not defined WORKSPACE (\r
29 goto SetWorkSpace\r
30)\r
31\r
32if %WORKSPACE% == %CD% (\r
33 @REM Workspace is not changed.\r
34 goto ParseArgs\r
35)\r
36\r
37:SetWorkSpace\r
38@REM set new workspace\r
39if not defined WORKSPACE (\r
40 set WORKSPACE=%CD%\r
41)\r
42\r
43:ParseArgs\r
44if /I "%1"=="-h" goto Usage\r
45if /I "%1"=="-help" goto Usage\r
46if /I "%1"=="--help" goto Usage\r
47if /I "%1"=="/h" goto Usage\r
48if /I "%1"=="/?" goto Usage\r
49if /I "%1"=="/help" goto Usage\r
50\r
51if /I "%1"=="NewBuild" shift\r
52if not defined EDK_TOOLS_PATH (\r
53 goto SetEdkToolsPath\r
54) else (\r
55 goto checkNt32Flag\r
56)\r
57\r
58:SetEdkToolsPath\r
59if %WORKSPACE:~-1% EQU \ (\r
60 @set EDK_BASETOOLS=%WORKSPACE%BaseTools\r
61) else (\r
62 @set EDK_BASETOOLS=%WORKSPACE%\BaseTools\r
63)\r
64if exist %EDK_BASETOOLS% (\r
65 set EDK_TOOLS_PATH=%EDK_BASETOOLS%\r
66 set EDK_BASETOOLS=\r
67) else (\r
68 if defined PACKAGES_PATH (\r
69 for %%i IN (%PACKAGES_PATH%) DO (\r
70 if exist %%~fi\BaseTools (\r
71 set EDK_TOOLS_PATH=%%~fi\BaseTools\r
72 goto checkNt32Flag\r
73 )\r
74 )\r
75 ) else (\r
76 echo.\r
77 echo !!! ERROR !!! Cannot find BaseTools !!!\r
78 echo.\r
79 goto BadBaseTools\r
80 )\r
81)\r
82\r
83:checkNt32Flag\r
84if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
85\r
86:checkBaseTools\r
87IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools\r
88call %EDK_TOOLS_PATH%\toolsetup.bat %*\r
89if /I "%1"=="Reconfig" shift\r
90goto check_NASM\r
91goto check_cygwin\r
92\r
93:BadBaseTools\r
94 @REM\r
95 REM Need the BaseTools Package in order to build\r
96 @REM\r
97 @echo.\r
98 @echo !!! ERROR !!! The BaseTools Package was not found !!!\r
99 @echo.\r
100 @echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,\r
101 @echo For example,\r
102 @echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools\r
103 @echo The setup script, toolsetup.bat must reside in this folder.\r
104 @echo.\r
105 goto end\r
106\r
107:check_NASM\r
108if not defined NASM_PREFIX (\r
109 @echo.\r
110 @echo !!! WARNING !!! NASM_PREFIX environment variable is not set\r
111 @if exist "C:\nasm\nasm.exe" @set "NASM_PREFIX=C:\nasm\"\r
112 @if exist "C:\nasm\nasm.exe" @echo Found nasm.exe, setting the environment variable to C:\nasm\\r
113 @if not exist "C:\nasm\nasm.exe" echo Attempting to build modules that require NASM will fail.\r
114)\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 /I "%1"=="Rebuild" shift\r
135if /I "%1"=="ForceRebuild" shift\r
136if "%1"=="" goto end\r
137\r
138:Usage\r
139 @echo.\r
140 @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Rebuild] [ForceRebuild]"\r
141 @echo.\r
142 @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.\r
143 @echo Rebuild Perform incremental rebuild of BaseTools binaries.\r
144 @echo ForceRebuild Force a full rebuild of BaseTools binaries.\r
145 @echo.\r
146 @echo Note that target.template, tools_def.template and build_rules.template\r
147 @echo will only be copied to target.txt, tools_def.txt and build_rule.txt\r
148 @echo respectively if they do not exist. Use option [Reconfig] to force the copy.\r
149 @echo.\r
150 goto end\r
151\r
152:end\r
153 popd\r