summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Sample
diff options
context:
space:
mode:
Diffstat (limited to 'EdkCompatibilityPkg/Sample')
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Ipf/Build/Config.env31
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Ipf/Build/IPF.dsc101
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Ipf/Build/Makefile140
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Ipf/Build/PlatformTools.env69
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Ipf/Build/build.bat304
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Config.env33
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Makefile231
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Nt32.dsc154
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Nt32/Build/PlatformTools.env68
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/Nt32/Build/build.bat304
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/X64/Build/Config.env33
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/X64/Build/Makefile147
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/X64/Build/PlatformTools.env65
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/X64/Build/X64.dsc106
-rw-r--r--EdkCompatibilityPkg/Sample/Platform/X64/Build/build.bat304
15 files changed, 2090 insertions, 0 deletions
diff --git a/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/Config.env b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/Config.env
new file mode 100644
index 0000000000..d294b50c6d
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/Config.env
@@ -0,0 +1,31 @@
+#/*++
+#
+# Copyright (c) 2006 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# Config.env
+#
+# Abstract:
+#
+# This file is used to define platform build configuration.
+# It gets included by PlatformTools.env.
+#
+#--*/
+
+BUILD_TARGET_DIRECTORY = Build
+EFI_DEBUG = NO
+EFI_DEBUG_CLEAR_MEMORY = NO
+EFI_SYMBOLIC_DEBUG = NO
+EFI_GENERATE_INTERMEDIATE_FILE = NO
+UEFI_MODE = YES
+USE_VC8 = NO
+USE_VC8_IPF = NO
+USE_NEWDDK = YES
diff --git a/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/IPF.dsc b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/IPF.dsc
new file mode 100644
index 0000000000..c36e6b0436
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/IPF.dsc
@@ -0,0 +1,101 @@
+#/*++
+#
+# Copyright (c) 2004 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# IPF.dsc
+#
+# Abstract:
+#
+# This is the build description file containing the platform
+# specific build definitions.
+#
+#
+# Notes:
+#
+# The info in this file is broken down into sections. The start of a section
+# is designated by a "[" in the first column. So the [=====] separater ends
+# a section.
+#
+#--*/
+
+
+[=============================================================================]
+#
+# This section gets processed first by the utility. Define any
+# macros that you may use elsewhere in this description file. This is the
+# mechanism by which you can pass parameters and defines to the makefiles
+# generated for each component. You can define it here, and then make an
+# assignment in the [makefile.common] section. For example, if here you
+# define MY_VAR = my_var_value, then you can add MY_VAR = $(MY_VAR) in
+# the [makefile.common] section and it becomes MY_VAR = my_var_value in
+# the output makefiles for each component.
+#
+[Defines]
+PLATFORM=$(PROJECT_NAME)
+
+
+[=============================================================================]
+#
+# Include other common build descriptions
+#
+!include "$(EDK_SOURCE)\Sample\Platform\Common.dsc"
+!include "$(EDK_SOURCE)\Sample\Platform\Common$(PROCESSOR).dsc"
+
+
+
+[=============================================================================]
+[Fv.Fv.Attributes]
+
+[Fv.Fv.options]
+
+[build.fv.Fv]
+
+[=============================================================================]
+#
+# These are the libraries that will be built by the master makefile
+#
+[=============================================================================]
+[Libraries]
+DEFINE EDK_PREFIX=
+
+!include "$(EDK_SOURCE)\Sample\Platform\EdkLibAll.dsc"
+
+#
+# EdkII Glue Library
+#
+#!include "$(EDK_SOURCE)\Sample\Platform\EdkIIGlueLibAll.dsc"
+
+[=============================================================================]
+#
+# These are platform specific libraries that must be built prior to building
+# certain drivers that depend upon them.
+#
+[=============================================================================]
+[Libraries.Platform]
+Sample\Platform\Generic\RuntimeDxe\StatusCode\Lib\RtMemoryStatusCode\RtMemoryStatusCode.inf
+Sample\Platform\Generic\RuntimeDxe\StatusCode\Lib\BsDataHubStatusCode\BsDataHubStatusCode.inf
+Sample\Platform\Generic\RuntimeDxe\StatusCode\Lib\BsSerialStatusCode\BsSerialStatusCode.inf
+
+#Other\Maintained\Application\Shell\Library\EfiShellLib.inf
+
+[=============================================================================]
+#
+# These are the components that will be built by the master makefile
+#
+[=============================================================================]
+[Components]
+DEFINE PACKAGE=Default
+
+#Other\Maintained\Application\Shell\Shell.inf
+Other\Maintained\Application\Shell\ShellFull.inf
+
+[=============================================================================]
diff --git a/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/Makefile b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/Makefile
new file mode 100644
index 0000000000..7df7d84cbf
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/Makefile
@@ -0,0 +1,140 @@
+#/*++
+#
+# Copyright (c) 2004 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# Makefile
+#
+# Abstract:
+#
+# This makefile is used to build the IPF build tip.
+#
+#--*/
+
+#
+# Everything depends on EDK_SOURCE & EDK_TOOLS_PATH. Make sure it's defined
+#
+!IFNDEF EDK_SOURCE
+!ERROR EDK_SOURCE environmental variable not set
+!ENDIF
+
+!IFNDEF EDK_TOOLS_PATH
+!MESSAGE EDK_TOOLS_PATH environmental variable not set, default setting used
+!ENDIF
+
+#
+# Set the processor type
+#
+PROCESSOR = IPF
+
+#
+# Define a toolchain so we can pick up the basic defines from
+# the EFI tool setup file.
+#
+TOOLCHAIN = TOOLCHAIN_MSVC
+
+!INCLUDE PlatformTools.env
+
+#
+# Target to build customer config
+#
+all : tempstamp_file build_tools makefiles builds
+
+#
+# Create a file to store the date and time, and used by SetStamp.exe
+#
+tempstamp_file:
+!IF DEFINED(DATE_STAMP) && DEFINED(TIME_STAMP)
+ @echo $(DATE_STAMP) $(TIME_STAMP) > GenStamp.txt
+!ELSEIF EXIST(GenStamp.txt)
+ - @del GenStamp.txt
+!ENDIF
+
+#
+# Make all the EFI build tools by calling the makefile
+#
+build_tools :
+ -if not exist $(EDK_TOOLS_OUTPUT) mkdir $(EDK_TOOLS_OUTPUT)
+ -if exist $(EDK_TOOLS_BIN)\*.* copy $(EDK_TOOLS_BIN)\*.* $(EDK_TOOLS_OUTPUT)
+ $(MAKE) -f $(EDK_TOOLS_SOURCE)\makefile PROCESSOR=$(PROCESSOR) BUILD_DIR=$(BUILD_DIR)
+ $(GUIDCHK) -b $(EDK_TOOLS_OUTPUT)\GuidDatabase.txt
+
+#
+# Run the utility that processes our description files and generates the
+# makefiles. Specify -v option for more verbose output.
+# Specify "-xref filename" to generate a cross-reference file of
+# basename-to-fileguid that can be used by VolInfo.
+#
+makefiles :
+ $(PROCESSDSC) \
+ -d EFI_SOURCE=$(EDK_SOURCE) \
+ -d EDK_SOURCE=$(EDK_SOURCE) \
+ -d PROCESSOR=$(PROCESSOR) \
+ -d PROJECT_NAME=$(PROJECT_NAME) \
+ -d OEMTOOLPATH=$(EDK_TOOLS_OUTPUT) \
+ -d COMPRESS_METHOD=$(COMPRESS_METHOD) \
+ -d UEFI_PREFIX=$(UEFI_PREFIX) \
+ -d PI_PREFIX=$(PI_PREFIX) \
+ -g $(EDK_TOOLS_OUTPUT)\GuidDatabase.txt \
+ $(PROJECT_NAME).dsc
+
+
+#
+# Call all the makefiles that were generated by ProcessDsc. ProcessDsc
+# creates the makefile.out that calls all the component makefiles.
+#
+builds :
+ $(MAKE) -f makefile.out libraries
+ $(MAKE) -f makefile.out components
+
+#
+# Create a target to clean up all build directories
+#
+clean :
+ - @if exist vc??.* del vc??.* > NUL
+ - @if exist *.bak del *.bak > NUL
+ - @if exist $(PROCESSOR) rd /s /q $(PROCESSOR) > NUL
+ - @if exist ebc rd /s /q ebc > NUL
+ - @if exist fv rd /s /q fv > NUL
+ - @if exist Tools rd /s /q Tools > NUL
+ - @if exist makefile.out del makefile.out > NUL
+ - @if exist module.* del module.* > NUL
+ - @echo All targets cleaned
+
+#
+# Clean up all build directories except for tools.
+#
+cleanbuilds :
+ - @if exist *.bak del *.bak > NUL
+ - @if exist $(PROCESSOR) rd /s /q $(PROCESSOR) > NUL
+ - @if exist ebc rd /s /q ebc > NUL
+ - @if exist fv rd /s /q fv > NUL
+ - @if exist makefile.out del makefile.out > NUL
+ - @if exist module.* del module.* > NUL
+ - @echo All modules cleaned
+
+#
+# Clean up only the tools
+#
+cleantools :
+ - @if exist vc??.* del vc??.* > NUL
+ - @if exist Tools rd /s /q Tools > NUL
+ - @echo All tools cleaned
+
+#
+# Rebuild target, clean and build all
+#
+rebuild : clean all
+
+#
+# cleanall target to clean all build directories.
+#
+cleanall : clean
diff --git a/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/PlatformTools.env b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/PlatformTools.env
new file mode 100644
index 0000000000..b12060e6d1
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/PlatformTools.env
@@ -0,0 +1,69 @@
+#/*++
+#
+# Copyright (c) 2004 - 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# PlatformTools.env
+#
+# Abstract:
+#
+# This file is used to define platform specific environment variables.
+# It gets included by every makefile.
+#
+#--*/
+
+!INCLUDE Config.env
+
+#
+# Set the project name
+#
+PROJECT_NAME = IPF
+
+#
+# Set the build directory
+#
+BUILD_DIR = $(EDK_SOURCE)\Sample\Platform\$(PROJECT_NAME)\$(BUILD_TARGET_DIRECTORY)
+
+#
+# Define compiler names
+#
+
+!IFNDEF EDK_TOOLS_PATH
+EFI_ASL_LOCAL = YES
+!ELSE
+!IF "$(USE_NEWDDK)" == "YES"
+EFI_COMPILER_NAME = DDK3790.1830
+EFI_ASSEMBLER_NAME = DDK3790.1830
+!ELSE
+EFI_COMPILER_NAME = DDK3790
+EFI_ASSEMBLER_NAME = DDK3790
+!ENDIF
+EFI_ASL_LOCAL = NO
+!ENDIF
+
+#
+# These flags are specific to this platform. If a flag is not specific to this
+# platform the flag should be placed in the CommonTools.env file.
+# Processor architecture specific and global macros can be found in
+# CommonTools.env, macros named xxx_ARCH_FLAGS and xxx_STD_FLAGS respectively.
+#
+C_PROJ_FLAGS = /Os
+ASM_PROJ_FLAGS =
+LINK_PROJ_FLAGS = /ALIGN:32
+LIB_PROJ_FLAGS =
+EBC_C_PROJ_FLAGS =
+EBC_LINK_PROJ_FLAGS =
+EBC_LIB_PROJ_FLAGS =
+
+#
+# Include processor architecture specific and general EFI build flags.
+#
+!INCLUDE $(EDK_SOURCE)\Sample\CommonTools.env \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/build.bat b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/build.bat
new file mode 100644
index 0000000000..c224c2ee74
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Ipf/Build/build.bat
@@ -0,0 +1,304 @@
+@rem #/*++
+@rem #
+@rem # Copyright (c) 2007, Intel Corporation
+@rem # All rights reserved. This program and the accompanying materials
+@rem # are licensed and made available under the terms and conditions of the BSD License
+@rem # which accompanies this distribution. The full text of the license may be found at
+@rem # http://opensource.org/licenses/bsd-license.php
+@rem #
+@rem # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+@rem # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+@rem #
+@rem # Module Name:
+@rem #
+@rem # build.bat
+@rem #
+@rem # Abstract:
+@rem #
+@rem # This script provides single module build, clean and find function
+@rem # based on module name.
+@rem #
+@rem # The auto-generated module.list file records all module names
+@rem # described in the current platform.dsc.
+@rem #
+@rem #--*/
+
+@echo off
+
+setlocal
+@rem initilize local variable
+set FUNCTION=build
+set MODULE=
+set UPDATE=
+set VERBOSE=
+
+:parse
+if /I "%1"=="/c" (
+ set FUNCTION=clean
+ shift
+ goto parse
+)
+if /I "%1"=="clean" (
+ set FUNCTION=clean
+ shift
+ goto parse
+)
+if /I "%1"=="/r" (
+ set FUNCTION=rebuild
+ shift
+ goto parse
+)
+if /I "%1"=="/h" (
+ set FUNCTION=usage
+ shift
+ goto parse
+)
+if /I "%1"=="/?" (
+ set FUNCTION=usage
+ shift
+ goto parse
+)
+if /I "%1"=="/f" (
+ set FUNCTION=find
+ shift
+ goto parse
+)
+if /I "%1"=="/a" (
+ set UPDATE=TRUE
+ shift
+ goto parse
+)
+if /I "%1"=="/v" (
+ set VERBOSE=TRUE
+ shift
+ goto parse
+)
+if not "%1"=="" (
+ set MODULE=%1
+ shift
+ goto parse
+) else (
+ @rem no other paramters
+ if "%FUNCTION%"=="rebuild" goto build
+ goto %FUNCTION%
+)
+
+:build
+set StartTime=%time%
+@rem if no input, build all
+if "%MODULE%"=="" (
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile clean
+ )
+ nmake -nologo -f Makefile all
+ goto endtime
+)
+@rem then try to build special targets: all, fast, tools.
+if /I "%MODULE%"=="all" (
+ @rem build all modules and tools.
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile cleanall
+ )
+ nmake -nologo -f Makefile all
+ goto endtime
+)
+if /I "%MODULE%"=="fast" (
+ @rem build fast target to skip FV=NULL modules.
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile clean
+ )
+ nmake -nologo -f Makefile fast
+ goto endtime
+)
+if /I "%MODULE%"=="tools" (
+ @rem build all tools.
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile cleantools
+ )
+ nmake -nologo -f Makefile build_tools
+ echo.
+ echo All tools are built.
+ goto endtime
+)
+@rem build single module, update build makefiles
+if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f module.mak %MODULE%Clean 2>NUL
+)
+nmake -nologo -f Makefile flashmap > NUL 2>&1
+nmake -nologo -f Makefile makefiles
+if errorlevel 1 goto builderror
+@rem check whether input module name is described in current dsc file.
+findstr /I /C:" %MODULE% " module.list > NUL
+if errorlevel 1 (
+ echo.
+ echo.
+ findstr /I /C:"%MODULE%" module.list > NUL
+ if errorlevel 1 goto finderror
+ for /F %%A in ('findstr /I /C:"%MODULE%" module.list') do echo %%A
+ echo.
+ echo Warning!!! Your specified module name can't be found.
+ echo One of the above modules may be what you want to build.
+ goto end
+)
+@rem build this module
+nmake -nologo -f module.mak %MODULE%Build
+echo.
+if "%FUNCTION%"=="rebuild" (
+ echo Module %MODULE% is rebuilt.
+) else (
+ echo Module %MODULE% is built.
+)
+:endtime
+@rem output build time.
+set EndTime=%time%
+echo.
+echo Start time %StartTime%
+echo End time %EndTime%
+goto end
+
+:clean
+@rem if no input, default clean all build directories.
+if "%MODULE%"=="" (
+ nmake -nologo -f Makefile clean
+ goto end
+)
+@rem first try to clean special tasks: all, modules and tools
+if /I "%MODULE%"=="all" (
+ nmake -nologo -f Makefile cleanall
+ goto end
+)
+if /I "%MODULE%"=="modules" (
+ nmake -nologo -f Makefile cleanbuilds
+ goto end
+)
+if /I "%MODULE%"=="tools" (
+ nmake -nologo -f Makefile cleantools
+ goto end
+)
+@rem clean single module
+@rem check whether input module name is in module.list file.
+if not exist module.list (
+ echo Module list info doesn't exist.
+ echo Processing dsc file to generate module list info.
+ nmake -nologo -f Makefile flashmap > NUL 2>&1
+ nmake -nologo -f Makefile makefiles > error.log 2>&1
+ if errorlevel 1 goto builderror
+)
+findstr /I /C:" %MODULE% " module.list > NUL
+if errorlevel 1 (
+ echo.
+ findstr /I /C:"%MODULE%" module.list > NUL
+ if errorlevel 1 goto finderror
+ for /F %%A in ('findstr /I /C:"%MODULE%" module.list') do echo %%A
+ echo.
+ echo Warning!!! Your specified module name can't be found.
+ echo One of the above modules may be what you want to clean.
+ goto end
+)
+@rem clean this module
+nmake -nologo -f module.mak %MODULE%Clean 2>NUL
+echo.
+echo Module %MODULE% is cleaned.
+goto end
+
+:find
+@rem find match module name by subname.
+if "%UPDATE%"=="TRUE" (
+ echo Processing dsc file to update module list info.
+ nmake -nologo -f Makefile flashmap > NUL 2>&1
+ nmake -nologo -f Makefile makefiles > error.log 2>&1
+ if errorlevel 1 goto builderror
+)
+if not exist module.list (
+ echo Module list info doesn't exist.
+ echo Processing dsc file to generate module list info.
+ nmake -nologo -f Makefile flashmap > NUL 2>&1
+ nmake -nologo -f Makefile makefiles > error.log 2>&1
+ if errorlevel 1 goto builderror
+)
+if "%MODULE%"=="" (
+ @rem display all
+ echo.
+ if "%VERBOSE%"=="TRUE" (
+ type module.list
+ ) else (
+ @rem only output module name without module.inf file name
+ for /F %%A in (module.list) do echo %%A
+ )
+) else (
+ @rem display match module name
+ echo.
+ if "%VERBOSE%"=="TRUE" (
+ findstr /I /C:"%MODULE%" module.list
+ if errorlevel 1 goto notfind
+ ) else (
+ findstr /I /C:"%MODULE%" module.list > NUL
+ if errorlevel 1 goto notfind
+ for /F %%A in ('findstr /I /C:"%MODULE%" module.list') do echo %%A
+ )
+)
+goto end
+
+:usage
+echo build or clean single module based on module name after tools are built.
+echo.
+echo build [/r] [/c] [/f] [/h] [modulename]
+echo.
+echo build [/r] [modulename]
+echo build single module, such as build DxeMain.
+echo If /r is specified, the target will be rebuit after cleaned first.
+echo if no input modulename or modulename is all, then build all
+echo Specail build targets: all, fast, tools.
+echo These special targets may not exist in your tip main makefile.
+echo build - build all tools and modules
+echo build all - build all tools and modules
+echo build fast - build all without FV=NULL modules
+echo build tools - build all tools.
+echo.
+echo build /c [modulename]
+echo build clean [modulename]
+echo remove the temp generated files for single module
+echo if no input modulename, then clean all
+echo Specail clean targets: all, modules, tools.
+echo These special targets may not exist in your tip main makefile.
+echo build /c - clean up all build directories
+echo build /c all - clean up all build directories and binary dirs.
+echo build /c modules - clean up all build directories except for tools.
+echo build /c tools - clean up only tools directory.
+echo.
+echo build /f [/a] [/v] [subname]
+echo find all matched modulename with the sub string of module name.
+echo option /a re-processes dsc files to update module name list.
+echo option /v outputs module name and module.inf file name both.
+echo.
+echo build /h
+echo build /?
+echo display help information.
+echo.
+goto end
+
+:notfind
+echo Warning!!! Your specified module name can't be found.
+echo Try to use /f /a options to update module name list.
+goto end
+
+:finderror
+echo Warning!!! Your specified module name can't be found.
+echo Try to use /f to find modules that you want to build.
+echo Or use /h to get the helpinfo of this script.
+goto end
+
+:builderror
+if exist error.log type error.log
+echo.
+if not exist Tools\ProcessDsc.exe (
+ echo.
+ echo Error!!! Build tools may not be ready. Try to build tools first.
+ echo.
+)
+del module.* > NUL 2>&1
+goto end
+
+:end
+if exist error.log del error.log
+echo on
diff --git a/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Config.env b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Config.env
new file mode 100644
index 0000000000..43d7fa939a
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Config.env
@@ -0,0 +1,33 @@
+#/*++
+#
+# Copyright (c) 2006 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# Config.env
+#
+# Abstract:
+#
+# This file is used to define platform build configuration.
+# It gets included by PlatformTools.env.
+#
+#--*/
+
+BUILD_TARGET_DIRECTORY = Build
+EFI_DEBUG = YES
+EFI_DEBUG_CLEAR_MEMORY = YES
+EFI_PEI_PERFORMANCE = YES
+EFI_DXE_PERFORMANCE = YES
+EFI_SYMBOLIC_DEBUG = YES
+EFI_GENERATE_INTERMEDIATE_FILE = NO
+EFI_PEI_REPORT_STATUS_CODE = YES
+UEFI_MODE = YES
+PI_MODE = YES
+USE_VC8 = NO
diff --git a/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Makefile b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Makefile
new file mode 100644
index 0000000000..8ad8646dc4
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Makefile
@@ -0,0 +1,231 @@
+#/*++
+#
+# Copyright (c) 2004 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# Makefile
+#
+# Abstract:
+#
+# This makefile is used to build the NT emulation.
+#
+#--*/
+
+#
+# Everything depends on EDK_SOURCE & EDK_TOOLS_PATH. Make sure it's defined
+#
+!IFNDEF EDK_SOURCE
+!ERROR EDK_SOURCE environmental variable not set
+!ENDIF
+
+!IFNDEF EDK_TOOLS_PATH
+!MESSAGE EDK_TOOLS_PATH environmental variable not set, default setting used
+!ENDIF
+
+#
+# Set the processor type
+#
+PROCESSOR = IA32
+
+#
+# Define a toolchain so we can pick up the basic defines from
+# the EFI tool setup file.
+#
+TOOLCHAIN = TOOLCHAIN_MSVC
+
+!INCLUDE PlatformTools.env
+
+#
+# Default target
+#
+all : customer
+
+#
+# Target to build customer config
+#
+customer : tempstamp_file build_tools makefiles builds
+
+#
+# Target to build everything quickly
+#
+fast : build_tools fast_makefiles builds
+
+#
+# Create a file to store the date and time, and used by SetStamp.exe
+#
+tempstamp_file:
+!IF DEFINED(DATE_STAMP) && DEFINED(TIME_STAMP)
+ @echo $(DATE_STAMP) $(TIME_STAMP) > GenStamp.txt
+!ELSEIF EXIST(GenStamp.txt)
+ - @del GenStamp.txt
+!ENDIF
+
+#
+# Make all the EFI build tools by calling the makefile
+#
+build_tools :
+ -if not exist $(EDK_TOOLS_OUTPUT) mkdir $(EDK_TOOLS_OUTPUT)
+ -if exist $(EDK_TOOLS_BIN)\*.* copy $(EDK_TOOLS_BIN)\*.* $(EDK_TOOLS_OUTPUT)
+ $(MAKE) -f $(EDK_TOOLS_SOURCE)\makefile PROCESSOR=$(PROCESSOR) BUILD_DIR=$(BUILD_DIR)
+ $(GUIDCHK) -b $(EDK_TOOLS_OUTPUT)\GuidDatabase.txt
+
+#
+# Run ProcessDsc on our main description files to generate the
+# makefiles and package files. Specify -v option for more verbose output.
+# Specify "-xref filename" to generate a cross-reference file of
+# basename-to-fileguid that can be used by VolInfo.
+#
+makefiles :
+ $(PROCESSDSC) \
+ -d EFI_SOURCE=$(EDK_SOURCE) \
+ -d EDK_SOURCE=$(EDK_SOURCE) \
+ -d PROCESSOR=$(PROCESSOR) \
+ -d PROJECT_NAME=$(PROJECT_NAME) \
+ -d COMPRESS_METHOD=$(COMPRESS_METHOD) \
+ -d OEMTOOLPATH=$(EDK_TOOLS_OUTPUT) \
+ -d SHELL_INF=$(SHELL_INF) \
+ -d UEFI_PREFIX=$(UEFI_PREFIX) \
+ -d PI_PREFIX=$(PI_PREFIX) \
+ -d CAPSULE_INF=$(CAPSULE_INF) \
+ -d ATAPI_PASS_THRU_INF=$(ATAPI_PASS_THRU_INF) \
+ -d DEVPATH_INF=$(DEVPATH_INF) \
+ -d GRAPHICS_INF=$(GRAPHICS_INF) \
+ -g $(EDK_TOOLS_OUTPUT)\GuidDatabase.txt \
+ -xref FV\Guid.xref \
+ $(PROJECT_NAME).dsc
+
+#
+# Build faster by not building components with FV=NULL. Override in the
+# DSC file by adding SKIP_FV_NULL=0 on the component lines you want built
+# but still have FV=NULL. For example:
+#
+# Dxe\Drivers\MyDriver\MyDriver.inf FV=NULL SKIP_FV_NULL=0
+#
+fast_makefiles :
+ $(PROCESSDSC) \
+ -d EFI_SOURCE=$(EDK_SOURCE) \
+ -d EDK_SOURCE=$(EDK_SOURCE) \
+ -d PROCESSOR=$(PROCESSOR) \
+ -d PROJECT_NAME=$(PROJECT_NAME) \
+ -d COMPRESS_METHOD=$(COMPRESS_METHOD) \
+ -d OEMTOOLPATH=$(EDK_TOOLS_OUTPUT) \
+ -d SHELL_INF=$(SHELL_INF) \
+ -d UEFI_PREFIX=$(UEFI_PREFIX) \
+ -d PI_PREFIX=$(PI_PREFIX) \
+ -d CAPSULE_INF=$(CAPSULE_INF) \
+ -d ATAPI_PASS_THRU_INF=$(ATAPI_PASS_THRU_INF) \
+ -d DEVPATH_INF=$(DEVPATH_INF) \
+ -d GRAPHICS_INF=$(GRAPHICS_INF) \
+ -g $(EDK_TOOLS_OUTPUT)\GuidDatabase.txt \
+ -xref FV\Guid.xref \
+ -d SKIP_FV_NULL=1 \
+ $(PROJECT_NAME).dsc
+
+#
+# Create the guid-to-basename cross reference file of protocols
+# used by volinfo for decoding dependency expressions.
+#
+protocols.xref :
+ -@if not exist fv mkdir FV
+ cd $(EDK_SOURCE)
+ $(GUIDCHK) -g -u $(BUILD_TARGET_DIRECTORY) -e inf -x > $(BUILD_DIR)\Fv\protocols.xref
+ cd $(BUILD_DIR)
+
+#
+# Call all the makefiles that were generated by ProcessDsc. ProcessDsc
+# creates the makefile.out that calls all the component makefiles.
+#
+builds :
+ $(MAKE) -f makefile.out
+
+#
+# Useful targets
+#
+
+#
+# Define a pseudo-target that skips over compiling the build tools and
+# also skips creation of the makefiles for the components. The user
+# has to be aware that any changes to INF files renders this target
+# invalid.
+#
+quick : builds
+
+#
+# Define a pseudo-target to start building with the libraries or with the
+# components.
+#
+libraries :
+ $(MAKE) -f makefile.out libraries
+
+components :
+ $(MAKE) -f makefile.out components
+
+#
+# Make a pseudo-target to simplify running of the NT emulation.
+#
+!IF "$(EFI_WIN_NT_FILE_SYSTEM)" == ""
+EFI_WIN_NT_FILE_SYSTEM = $(EDK_SOURCE)\Other\Maintained\Application\$(UEFI_PREFIX)Shell\bin\ia32\Apps
+!ELSE
+EFI_WIN_NT_FILE_SYSTEM = $(EFI_WIN_NT_FILE_SYSTEM)!$(EDK_SOURCE)\Other\Maintained\Application\$(UEFI_PREFIX)Shell\bin\ia32\Apps
+!ENDIF
+
+#
+# Make browse info file
+#
+bsc:
+ - dir /s /b *.sbr > $(PROCESSOR)\temp.rm
+ $(BSCMAKE) /n /o $(PROCESSOR)\$(PROJECT_NAME).bsc "@$(PROCESSOR)\temp.rm"
+
+#
+# Create a target to clean up all build directories
+#
+clean :
+ - @if exist vc??.* del vc??.* > NUL
+ - @if exist *.bak del *.bak > NUL
+ - @if exist $(PROCESSOR) rd /s /q $(PROCESSOR) > NUL
+ - @if exist ipf rd /s /q ipf > NUL
+ - @if exist ebc rd /s /q ebc > NUL
+ - @if exist fv rd /s /q fv > NUL
+ - @if exist Tools rd /s /q Tools > NUL
+ - @if exist makefile.out del makefile.out > NUL
+ - @if exist module.* del module.* > NUL
+ - @echo All targets cleaned
+
+#
+# Clean up all build directories except for tools.
+#
+cleanbuilds :
+ - @if exist *.bak del *.bak > NUL
+ - @if exist $(PROCESSOR) rd /s /q $(PROCESSOR) > NUL
+ - @if exist ipf rd /s /q ipf > NUL
+ - @if exist ebc rd /s /q ebc > NUL
+ - @if exist fv rd /s /q fv > NUL
+ - @if exist makefile.out del makefile.out > NUL
+ - @if exist module.* del module.* > NUL
+ - @echo All modules cleaned
+
+#
+# Clean up only the tools
+#
+cleantools :
+ - @if exist vc??.* del vc??.* > NUL
+ - @if exist Tools rd /s /q Tools > NUL
+ - @echo All tools cleaned
+
+#
+# Rebuild target, clean and build all
+#
+rebuild : clean all
+
+#
+# cleanall target to clean all build directories.
+#
+cleanall : clean
diff --git a/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Nt32.dsc b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Nt32.dsc
new file mode 100644
index 0000000000..03c14e0dc2
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/Nt32.dsc
@@ -0,0 +1,154 @@
+#/*++
+#
+# Copyright (c) 2004 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# Nt32.dsc
+#
+# Abstract:
+#
+# This is the build description file containing the platform
+# build definitions.
+#
+#
+# Notes:
+#
+# The info in this file is broken down into sections. The start of a section
+# is designated by a "[" in the first column. So the [=====] separater ends
+# a section.
+#
+#--*/
+
+
+[=============================================================================]
+#
+# This section gets processed first by the utility. Define any
+# macros that you may use elsewhere in this description file. This is the
+# mechanism by which you can pass parameters and defines to the makefiles
+# generated for each component. You can define it here, and then make an
+# assignment in the [makefile.common] section. For example, if here you
+# define MY_VAR = my_var_value, then you can add MY_VAR = $(MY_VAR) in
+# the [makefile.common] section and it becomes MY_VAR = my_var_value in
+# the output makefiles for each component.
+#
+[Defines]
+PLATFORM = $(PROJECT_NAME)
+
+[=============================================================================]
+#
+# Include other common build descriptions
+#
+!include "$(EDK_SOURCE)\Sample\Platform\Common.dsc"
+!include "$(EDK_SOURCE)\Sample\Platform\Common$(PROCESSOR).dsc"
+
+[=============================================================================]
+#
+# These control the generation of the FV files
+#
+[=============================================================================]
+[Fv.Fv.Attributes]
+
+[Fv.Fv.options]
+
+[Build.Fv.Fv]
+
+[=============================================================================]
+#
+# These are the libraries that will be built by the master makefile
+#
+[=============================================================================]
+[Libraries]
+DEFINE EDK_PREFIX=
+
+!include "$(EDK_SOURCE)\Sample\Platform\EdkLibAll.dsc"
+
+#
+# EdkII Glue Library
+#
+#!include "$(EDK_SOURCE)\Sample\Platform\EdkIIGlueLibAll.dsc"
+
+[=============================================================================]
+#
+# These are platform specific libraries that must be built prior to building
+# certain drivers that depend upon them.
+#
+[=============================================================================]
+[Libraries.Platform]
+Sample\Platform\Nt32\Protocol\EdkNt32ProtocolLib.inf
+Sample\Library\Dxe\WinNt\WinNtLib.inf
+#Sample\Platform\Generic\MonoStatusCode\Library\Pei\MemoryStatusCode\MemoryStatusCode.inf
+Sample\Platform\Generic\RuntimeDxe\StatusCode\Lib\BsDataHubStatusCode\BsDataHubStatusCode.inf
+Sample\Platform\Generic\RuntimeDxe\StatusCode\Lib\RtMemoryStatusCode\RtMemoryStatusCode.inf
+Sample\Platform\Generic\RuntimeDxe\StatusCode\Lib\RtPlatformStatusCode\$(PROJECT_NAME)\RtPlatformStatusCode.inf
+
+Other\Maintained\Application\Shell\Library\EfiShellLib.inf
+
+[=============================================================================]
+#
+# These are the components that will be built by the master makefile
+#
+[=============================================================================]
+[Components]
+DEFINE PACKAGE=Default
+
+#Other\Maintained\Application\Shell\Shell.inf
+#Other\Maintained\Application\Shell\ShellFull.inf
+Other\Maintained\Application\Shell\attrib\attrib.inf
+Other\Maintained\Application\Shell\cls\cls.inf
+Other\Maintained\Application\Shell\comp\comp.inf
+Other\Maintained\Application\Shell\cp\cp.inf
+Other\Maintained\Application\Shell\date\date.inf
+Other\Maintained\Application\Shell\dblk\dblk.inf
+Other\Maintained\Application\Shell\devices\devices.inf
+Other\Maintained\Application\Shell\DeviceTree\devicetree.inf
+Other\Maintained\Application\Shell\dmem\dmem.inf
+Other\Maintained\Application\Shell\dmpstore\dmpstore.inf
+Other\Maintained\Application\Shell\drivers\drivers.inf
+Other\Maintained\Application\Shell\drvcfg\drvcfg.inf
+Other\Maintained\Application\Shell\drvdiag\drvdiag.inf
+Other\Maintained\Application\Shell\edit\edit.inf
+Other\Maintained\Application\Shell\EfiCompress\compress.inf
+Other\Maintained\Application\Shell\EfiDecompress\Decompress.inf
+Other\Maintained\Application\Shell\err\err.inf
+Other\Maintained\Application\Shell\guid\guid.inf
+Other\Maintained\Application\Shell\hexedit\hexedit.inf
+Other\Maintained\Application\Shell\IfConfig\IfConfig.inf
+Other\Maintained\Application\Shell\IpConfig\IpConfig.inf
+Other\Maintained\Application\Shell\load\load.inf
+Other\Maintained\Application\Shell\LoadPciRom\LoadPciRom.inf
+Other\Maintained\Application\Shell\ls\ls.inf
+Other\Maintained\Application\Shell\mem\mem.inf
+Other\Maintained\Application\Shell\memmap\memmap.inf
+Other\Maintained\Application\Shell\mkdir\mkdir.inf
+Other\Maintained\Application\Shell\mm\mm.inf
+Other\Maintained\Application\Shell\mode\mode.inf
+Other\Maintained\Application\Shell\mount\mount.inf
+Other\Maintained\Application\Shell\mv\mv.inf
+Other\Maintained\Application\Shell\newshell\nshell.inf
+Other\Maintained\Application\Shell\openinfo\openinfo.inf
+Other\Maintained\Application\Shell\pci\pci.inf
+Other\Maintained\Application\Shell\Ping\Ping.inf
+Other\Maintained\Application\Shell\reset\reset.inf
+Other\Maintained\Application\Shell\rm\rm.inf
+Other\Maintained\Application\Shell\sermode\sermode.inf
+Other\Maintained\Application\Shell\SmbiosView\Smbiosview.inf
+Other\Maintained\Application\Shell\stall\stall.inf
+Other\Maintained\Application\Shell\TelnetMgmt\TelnetMgmt.inf
+Other\Maintained\Application\Shell\time\time.inf
+Other\Maintained\Application\Shell\touch\touch.inf
+Other\Maintained\Application\Shell\type\type.inf
+Other\Maintained\Application\Shell\tzone\timezone.inf
+Other\Maintained\Application\Shell\unload\unload.inf
+Other\Maintained\Application\Shell\ver\Ver.inf
+Other\Maintained\Application\Shell\vol\Vol.inf
+
+[=============================================================================]
+
diff --git a/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/PlatformTools.env b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/PlatformTools.env
new file mode 100644
index 0000000000..ec799ab2f5
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/PlatformTools.env
@@ -0,0 +1,68 @@
+#/*++
+#
+# Copyright (c) 2004 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# PlatformTools.env
+#
+# Abstract:
+#
+# This file is used to define platform specific environment variables.
+# It gets included by every makefile.
+#
+#--*/
+
+!INCLUDE Config.env
+
+#
+# Set the project name
+#
+PROJECT_NAME = Nt32
+
+#
+# Set the build directory
+#
+BUILD_DIR = $(EDK_SOURCE)\Sample\Platform\$(PROJECT_NAME)\$(BUILD_TARGET_DIRECTORY)
+
+!IF "$(UEFI_MODE)" == "YES"
+GRAPHICS_INF = Sample\Bus\WinNtThunk\Gop\Dxe\WinNtGop.inf
+!ELSE
+GRAPHICS_INF = Sample\Bus\WinNtThunk\Uga\Dxe\WinNtUga.inf
+!ENDIF
+
+#
+# Define compiler names
+#
+!IFNDEF EDK_TOOLS_PATH
+EFI_ASL_LOCAL = YES
+!ELSE
+EFI_ASSEMBLER_NAME = Masm611
+EFI_ASL_LOCAL = NO
+!ENDIF
+
+#
+# These flags are specific to this platform. If a flag is not specific to this
+# platform the flag should be placed in the CommonTools.env file.
+# Processor architecture specific and global macros can be found in
+# CommonTools.env, macros named xxx_ARCH_FLAGS and xxx_STD_FLAGS respectively.
+#
+C_PROJ_FLAGS = /D UNICODE /D NEW_PEI_HOBS
+ASM_PROJ_FLAGS = /Cx /Zd /Fl$*.lst /DEFI_NT_EMULATOR
+LINK_PROJ_FLAGS =
+LIB_PROJ_FLAGS =
+EBC_C_PROJ_FLAGS =
+EBC_LINK_PROJ_FLAGS =
+EBC_LIB_PROJ_FLAGS =
+
+#
+# Include processor architecture specific and general Tiano build flags.
+#
+!INCLUDE $(EDK_SOURCE)\Sample\CommonTools.env
diff --git a/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/build.bat b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/build.bat
new file mode 100644
index 0000000000..c224c2ee74
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/Nt32/Build/build.bat
@@ -0,0 +1,304 @@
+@rem #/*++
+@rem #
+@rem # Copyright (c) 2007, Intel Corporation
+@rem # All rights reserved. This program and the accompanying materials
+@rem # are licensed and made available under the terms and conditions of the BSD License
+@rem # which accompanies this distribution. The full text of the license may be found at
+@rem # http://opensource.org/licenses/bsd-license.php
+@rem #
+@rem # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+@rem # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+@rem #
+@rem # Module Name:
+@rem #
+@rem # build.bat
+@rem #
+@rem # Abstract:
+@rem #
+@rem # This script provides single module build, clean and find function
+@rem # based on module name.
+@rem #
+@rem # The auto-generated module.list file records all module names
+@rem # described in the current platform.dsc.
+@rem #
+@rem #--*/
+
+@echo off
+
+setlocal
+@rem initilize local variable
+set FUNCTION=build
+set MODULE=
+set UPDATE=
+set VERBOSE=
+
+:parse
+if /I "%1"=="/c" (
+ set FUNCTION=clean
+ shift
+ goto parse
+)
+if /I "%1"=="clean" (
+ set FUNCTION=clean
+ shift
+ goto parse
+)
+if /I "%1"=="/r" (
+ set FUNCTION=rebuild
+ shift
+ goto parse
+)
+if /I "%1"=="/h" (
+ set FUNCTION=usage
+ shift
+ goto parse
+)
+if /I "%1"=="/?" (
+ set FUNCTION=usage
+ shift
+ goto parse
+)
+if /I "%1"=="/f" (
+ set FUNCTION=find
+ shift
+ goto parse
+)
+if /I "%1"=="/a" (
+ set UPDATE=TRUE
+ shift
+ goto parse
+)
+if /I "%1"=="/v" (
+ set VERBOSE=TRUE
+ shift
+ goto parse
+)
+if not "%1"=="" (
+ set MODULE=%1
+ shift
+ goto parse
+) else (
+ @rem no other paramters
+ if "%FUNCTION%"=="rebuild" goto build
+ goto %FUNCTION%
+)
+
+:build
+set StartTime=%time%
+@rem if no input, build all
+if "%MODULE%"=="" (
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile clean
+ )
+ nmake -nologo -f Makefile all
+ goto endtime
+)
+@rem then try to build special targets: all, fast, tools.
+if /I "%MODULE%"=="all" (
+ @rem build all modules and tools.
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile cleanall
+ )
+ nmake -nologo -f Makefile all
+ goto endtime
+)
+if /I "%MODULE%"=="fast" (
+ @rem build fast target to skip FV=NULL modules.
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile clean
+ )
+ nmake -nologo -f Makefile fast
+ goto endtime
+)
+if /I "%MODULE%"=="tools" (
+ @rem build all tools.
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile cleantools
+ )
+ nmake -nologo -f Makefile build_tools
+ echo.
+ echo All tools are built.
+ goto endtime
+)
+@rem build single module, update build makefiles
+if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f module.mak %MODULE%Clean 2>NUL
+)
+nmake -nologo -f Makefile flashmap > NUL 2>&1
+nmake -nologo -f Makefile makefiles
+if errorlevel 1 goto builderror
+@rem check whether input module name is described in current dsc file.
+findstr /I /C:" %MODULE% " module.list > NUL
+if errorlevel 1 (
+ echo.
+ echo.
+ findstr /I /C:"%MODULE%" module.list > NUL
+ if errorlevel 1 goto finderror
+ for /F %%A in ('findstr /I /C:"%MODULE%" module.list') do echo %%A
+ echo.
+ echo Warning!!! Your specified module name can't be found.
+ echo One of the above modules may be what you want to build.
+ goto end
+)
+@rem build this module
+nmake -nologo -f module.mak %MODULE%Build
+echo.
+if "%FUNCTION%"=="rebuild" (
+ echo Module %MODULE% is rebuilt.
+) else (
+ echo Module %MODULE% is built.
+)
+:endtime
+@rem output build time.
+set EndTime=%time%
+echo.
+echo Start time %StartTime%
+echo End time %EndTime%
+goto end
+
+:clean
+@rem if no input, default clean all build directories.
+if "%MODULE%"=="" (
+ nmake -nologo -f Makefile clean
+ goto end
+)
+@rem first try to clean special tasks: all, modules and tools
+if /I "%MODULE%"=="all" (
+ nmake -nologo -f Makefile cleanall
+ goto end
+)
+if /I "%MODULE%"=="modules" (
+ nmake -nologo -f Makefile cleanbuilds
+ goto end
+)
+if /I "%MODULE%"=="tools" (
+ nmake -nologo -f Makefile cleantools
+ goto end
+)
+@rem clean single module
+@rem check whether input module name is in module.list file.
+if not exist module.list (
+ echo Module list info doesn't exist.
+ echo Processing dsc file to generate module list info.
+ nmake -nologo -f Makefile flashmap > NUL 2>&1
+ nmake -nologo -f Makefile makefiles > error.log 2>&1
+ if errorlevel 1 goto builderror
+)
+findstr /I /C:" %MODULE% " module.list > NUL
+if errorlevel 1 (
+ echo.
+ findstr /I /C:"%MODULE%" module.list > NUL
+ if errorlevel 1 goto finderror
+ for /F %%A in ('findstr /I /C:"%MODULE%" module.list') do echo %%A
+ echo.
+ echo Warning!!! Your specified module name can't be found.
+ echo One of the above modules may be what you want to clean.
+ goto end
+)
+@rem clean this module
+nmake -nologo -f module.mak %MODULE%Clean 2>NUL
+echo.
+echo Module %MODULE% is cleaned.
+goto end
+
+:find
+@rem find match module name by subname.
+if "%UPDATE%"=="TRUE" (
+ echo Processing dsc file to update module list info.
+ nmake -nologo -f Makefile flashmap > NUL 2>&1
+ nmake -nologo -f Makefile makefiles > error.log 2>&1
+ if errorlevel 1 goto builderror
+)
+if not exist module.list (
+ echo Module list info doesn't exist.
+ echo Processing dsc file to generate module list info.
+ nmake -nologo -f Makefile flashmap > NUL 2>&1
+ nmake -nologo -f Makefile makefiles > error.log 2>&1
+ if errorlevel 1 goto builderror
+)
+if "%MODULE%"=="" (
+ @rem display all
+ echo.
+ if "%VERBOSE%"=="TRUE" (
+ type module.list
+ ) else (
+ @rem only output module name without module.inf file name
+ for /F %%A in (module.list) do echo %%A
+ )
+) else (
+ @rem display match module name
+ echo.
+ if "%VERBOSE%"=="TRUE" (
+ findstr /I /C:"%MODULE%" module.list
+ if errorlevel 1 goto notfind
+ ) else (
+ findstr /I /C:"%MODULE%" module.list > NUL
+ if errorlevel 1 goto notfind
+ for /F %%A in ('findstr /I /C:"%MODULE%" module.list') do echo %%A
+ )
+)
+goto end
+
+:usage
+echo build or clean single module based on module name after tools are built.
+echo.
+echo build [/r] [/c] [/f] [/h] [modulename]
+echo.
+echo build [/r] [modulename]
+echo build single module, such as build DxeMain.
+echo If /r is specified, the target will be rebuit after cleaned first.
+echo if no input modulename or modulename is all, then build all
+echo Specail build targets: all, fast, tools.
+echo These special targets may not exist in your tip main makefile.
+echo build - build all tools and modules
+echo build all - build all tools and modules
+echo build fast - build all without FV=NULL modules
+echo build tools - build all tools.
+echo.
+echo build /c [modulename]
+echo build clean [modulename]
+echo remove the temp generated files for single module
+echo if no input modulename, then clean all
+echo Specail clean targets: all, modules, tools.
+echo These special targets may not exist in your tip main makefile.
+echo build /c - clean up all build directories
+echo build /c all - clean up all build directories and binary dirs.
+echo build /c modules - clean up all build directories except for tools.
+echo build /c tools - clean up only tools directory.
+echo.
+echo build /f [/a] [/v] [subname]
+echo find all matched modulename with the sub string of module name.
+echo option /a re-processes dsc files to update module name list.
+echo option /v outputs module name and module.inf file name both.
+echo.
+echo build /h
+echo build /?
+echo display help information.
+echo.
+goto end
+
+:notfind
+echo Warning!!! Your specified module name can't be found.
+echo Try to use /f /a options to update module name list.
+goto end
+
+:finderror
+echo Warning!!! Your specified module name can't be found.
+echo Try to use /f to find modules that you want to build.
+echo Or use /h to get the helpinfo of this script.
+goto end
+
+:builderror
+if exist error.log type error.log
+echo.
+if not exist Tools\ProcessDsc.exe (
+ echo.
+ echo Error!!! Build tools may not be ready. Try to build tools first.
+ echo.
+)
+del module.* > NUL 2>&1
+goto end
+
+:end
+if exist error.log del error.log
+echo on
diff --git a/EdkCompatibilityPkg/Sample/Platform/X64/Build/Config.env b/EdkCompatibilityPkg/Sample/Platform/X64/Build/Config.env
new file mode 100644
index 0000000000..b846afe277
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/X64/Build/Config.env
@@ -0,0 +1,33 @@
+#/*++
+#
+# Copyright (c) 2006 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# Config.env
+#
+# Abstract:
+#
+# This file is used to define platform build configuration.
+# It gets included by PlatformTools.env.
+#
+#--*/
+
+BUILD_TARGET_DIRECTORY = Build
+EFI_DEBUG = NO
+EFI_DEBUG_CLEAR_MEMORY = NO
+EFI_PEI_PERFORMANCE = NO
+EFI_DXE_PERFORMANCE = NO
+EFI_SYMBOLIC_DEBUG = NO
+EFI_GENERATE_INTERMEDIATE_FILE = NO
+UEFI_MODE = YES
+USE_VC8 = NO
+USE_VC8_X64 = NO
+USE_NEWDDK = YES
diff --git a/EdkCompatibilityPkg/Sample/Platform/X64/Build/Makefile b/EdkCompatibilityPkg/Sample/Platform/X64/Build/Makefile
new file mode 100644
index 0000000000..bbb1ad36ca
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/X64/Build/Makefile
@@ -0,0 +1,147 @@
+#/*++
+#
+# Copyright (c) 2006 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+# Makefile
+#
+# Abstract:
+# Makefile for this build tip
+#
+#--*/
+
+#
+# Everything depends on EDK_SOURCE being set.
+#
+!IFNDEF EDK_SOURCE
+!ERROR EDK_SOURCE environmental variable not set
+!ENDIF
+
+!IFNDEF EDK_TOOLS_PATH
+!MESSAGE EDK_TOOLS_PATH environmental variable not set, default setting used
+!ENDIF
+
+#
+# Set the processor type
+#
+PROCESSOR = IA32
+
+#
+# Define a toolchain so we can pick up the basic defines from
+# the EFI tool setup file.
+#
+TOOLCHAIN = TOOLCHAIN_MSVC
+
+#
+# Include the platform-specific settings file
+#
+!INCLUDE PlatformTools.env
+
+#
+# Default target to create the makefiles and then build the drivers
+#
+all : build_tools makefiles builds
+
+#
+# Make all the build tools by calling the makefile
+#
+build_tools :
+ -if not exist $(EDK_TOOLS_OUTPUT) mkdir $(EDK_TOOLS_OUTPUT)
+ -if exist $(EDK_TOOLS_BIN)\*.* copy $(EDK_TOOLS_BIN)\*.* $(EDK_TOOLS_OUTPUT)
+ $(MAKE) -f $(EDK_TOOLS_SOURCE)\makefile PROCESSOR=$(PROCESSOR) BUILD_DIR=$(BUILD_DIR)
+ $(GUIDCHK) -b $(EDK_TOOLS_OUTPUT)\GuidDatabase.txt
+
+PROCESSOR=X64
+
+#
+# Run ProcessDsc on our main description files to generate the
+# makefiles and package files. Specify -v option for more verbose output.
+# Specify "-xref filename" to generate a cross-reference file of
+# basename-to-fileguid that can be used by VolInfo.
+#
+makefiles :
+ $(PROCESSDSC) \
+ -d EFI_SOURCE=$(EDK_SOURCE) \
+ -d EDK_SOURCE=$(EDK_SOURCE) \
+ -d PROCESSOR=$(PROCESSOR) \
+ -d PROJECT_NAME=$(PROJECT_NAME) \
+ -d PROJECT_FAMILY=$(PROJECT_FAMILY) \
+ -d UEFI_PREFIX=$(UEFI_PREFIX) \
+ -d PI_PREFIX=$(PI_PREFIX) \
+ -d COMPRESS_METHOD=$(COMPRESS_METHOD) \
+ -d OEMTOOLPATH=$(EDK_TOOLS_OUTPUT) \
+ -g $(EDK_TOOLS_OUTPUT)\GuidDatabase.txt \
+ $(PROJECT_NAME).dsc
+
+#
+# Call all the makefiles that were generated by ProcessDsc. ProcessDsc
+# creates the makefile.out that calls all the component makefiles.
+#
+builds :
+ $(MAKE) -f makefile.out libraries
+ $(MAKE) -f makefile.out components
+
+#
+# Define a pseudo-target to start building with the libraries or with the
+# components.
+#
+libraries :
+ $(MAKE) -f makefile.out libraries
+
+components :
+ $(MAKE) -f makefile.out components
+
+#
+# Create a target to clean up all build directories
+#
+clean :
+ - @if exist vc??.* del vc??.* > NUL
+ - @if exist *.bak del *.bak > NUL
+ - @if exist ia32 rd /s/q ia32 > NUL
+ - @if exist ipf rd /s /q ipf > NUL
+ - @if exist ebc rd /s /q ebc > NUL
+ - @if exist x64 rd /s /q x64 > NUL
+ - @if exist fv rd /s /q fv > NUL
+ - @if exist Tools rd /s /q Tools > NUL
+ - @if exist makefile.out del makefile.out > NUL
+ - @if exist module.* del module.* > NUL
+ - @echo All targets cleaned
+
+#
+# Clean up all build directories except for tools.
+#
+cleanbuilds :
+ - @if exist *.bak del *.bak > NUL
+ - @if exist ia32 rd /s/q ia32 > NUL
+ - @if exist ipf rd /s /q ipf > NUL
+ - @if exist ebc rd /s /q ebc > NUL
+ - @if exist x64 rd /s /q x64 > NUL
+ - @if exist fv rd /s /q fv > NUL
+ - @if exist makefile.out del makefile.out > NUL
+ - @if exist module.* del module.* > NUL
+ - @echo All modules cleaned
+
+#
+# Clean up only the tools
+#
+cleantools :
+ - @if exist vc??.* del vc??.* > NUL
+ - @if exist Tools rd /s /q Tools > NUL
+ - @echo All tools cleaned
+
+#
+# Rebuild target, clean and build all
+#
+rebuild : clean all
+
+#
+# cleanall target to clean all build directories.
+#
+cleanall : clean
diff --git a/EdkCompatibilityPkg/Sample/Platform/X64/Build/PlatformTools.env b/EdkCompatibilityPkg/Sample/Platform/X64/Build/PlatformTools.env
new file mode 100644
index 0000000000..79882f3b89
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/X64/Build/PlatformTools.env
@@ -0,0 +1,65 @@
+#/*++
+#
+# Copyright (c) 2006, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# PlatformTools.env
+#
+# Abstract:
+# This file is used to define platform specific environment variables.
+# It gets included by every makefile.
+#
+#--*/
+
+!INCLUDE Config.env
+
+#
+# Set the project name
+#
+PROJECT_NAME = X64
+
+#
+# Set the build directory
+#
+BUILD_DIR = $(EDK_SOURCE)\Sample\Platform\$(PROJECT_NAME)\$(BUILD_TARGET_DIRECTORY)
+
+#
+# Define compiler names
+#
+!IFNDEF EDK_TOOLS_PATH
+EFI_ASL_LOCAL = YES
+!ELSE
+EFI_ASSEMBLER_NAME = Masm611
+EFI_COMPILER_X64_NAME = AMD64
+EFI_ASL_LOCAL = NO
+!ENDIF
+
+#
+# These flags are specific to this platform. If a flag is not specific to this
+# platform the flag should be placed in the CommonTools.env file.
+# Processor architecture specific and global macros can be found in
+# CommonTools.env, macros named xxx_ARCH_FLAGS and xxx_STD_FLAGS respectively.
+#
+C_PROJ_FLAGS = /O1
+ASM_PROJ_FLAGS =
+LINK_PROJ_FLAGS = /ALIGN:32
+LIB_PROJ_FLAGS =
+EBC_C_PROJ_FLAGS =
+EBC_LINK_PROJ_FLAGS =
+EBC_LIB_PROJ_FLAGS =
+
+#
+# Include processor architecture specific and general Tiano build flags.
+#
+!INCLUDE $(EDK_SOURCE)\Sample\CommonTools.env
+
+
+
diff --git a/EdkCompatibilityPkg/Sample/Platform/X64/Build/X64.dsc b/EdkCompatibilityPkg/Sample/Platform/X64/Build/X64.dsc
new file mode 100644
index 0000000000..4dd85ae95c
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/X64/Build/X64.dsc
@@ -0,0 +1,106 @@
+#/*++
+#
+# Copyright (c) 2006 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# X64.dsc
+#
+# Abstract:
+#
+# This is the build description file containing the platform
+# build definitions.
+#
+#
+# Notes:
+#
+# The info in this file is broken down into sections. The start of a section
+# is designated by a "[" in the first column. So the [=====] separater ends
+# a section.
+#
+#--*/
+
+
+[=============================================================================]
+#
+# This section gets processed first by the utility. Define any
+# macros that you may use elsewhere in this description file. This is the
+# mechanism by which you can pass parameters and defines to the makefiles
+# generated for each component. You can define it here, and then make an
+# assignment in the [makefile.common] section. For example, if here you
+# define MY_VAR = my_var_value, then you can add MY_VAR = $(MY_VAR) in
+# the [makefile.common] section and it becomes MY_VAR = my_var_value in
+# the output makefiles for each component.
+#
+[Defines]
+PLATFORM = $(PROJECT_NAME)
+
+[=============================================================================]
+#
+# Include other common build descriptions
+#
+!include "$(EDK_SOURCE)\Sample\Platform\Common.dsc"
+!include "$(EDK_SOURCE)\Sample\Platform\Common$(PROCESSOR).dsc"
+
+[=============================================================================]
+[Fv.Fv.Attributes]
+
+[Fv.Fv.options]
+
+[Build.Fv.Fv]
+
+[=============================================================================]
+#
+# These are the libraries that will be built by the master makefile
+#
+[=============================================================================]
+[Libraries]
+DEFINE EDK_PREFIX=
+
+DEFINE PROCESSOR=IA32
+
+!include "$(EDK_SOURCE)\Sample\Platform\EdkLib32.dsc"
+
+#!include "$(EDK_SOURCE)\Sample\Platform\EdkIIGlueLib32.dsc"
+
+DEFINE PROCESSOR=X64
+
+!include "$(EDK_SOURCE)\Sample\Platform\EdkLibAll.dsc"
+
+#!include "$(EDK_SOURCE)\Sample\Platform\EdkIIGlueLibAll.dsc"
+
+[=============================================================================]
+#
+# These are platform specific libraries that must be built prior to building
+# certain drivers that depend upon them.
+#
+[=============================================================================]
+[Libraries.Platform]
+
+DEFINE PROCESSOR=X64
+
+Sample\Platform\Generic\RuntimeDxe\StatusCode\Lib\BsDataHubStatusCode\BsDataHubStatusCode.inf
+Sample\Platform\Generic\RuntimeDxe\StatusCode\Lib\RtMemoryStatusCode\RtMemoryStatusCode.inf
+
+#Other\Maintained\Application\Shell\Library\EfiShellLib.inf
+
+[=============================================================================]
+#
+# These are the components that will be built by the master makefile
+#
+[=============================================================================]
+[Components]
+DEFINE PACKAGE=Default
+
+#Other\Maintained\Application\Shell\Shell.inf
+#Other\Maintained\Application\Shell\ShellFull.inf
+
+
+[=============================================================================] \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Sample/Platform/X64/Build/build.bat b/EdkCompatibilityPkg/Sample/Platform/X64/Build/build.bat
new file mode 100644
index 0000000000..c224c2ee74
--- /dev/null
+++ b/EdkCompatibilityPkg/Sample/Platform/X64/Build/build.bat
@@ -0,0 +1,304 @@
+@rem #/*++
+@rem #
+@rem # Copyright (c) 2007, Intel Corporation
+@rem # All rights reserved. This program and the accompanying materials
+@rem # are licensed and made available under the terms and conditions of the BSD License
+@rem # which accompanies this distribution. The full text of the license may be found at
+@rem # http://opensource.org/licenses/bsd-license.php
+@rem #
+@rem # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+@rem # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+@rem #
+@rem # Module Name:
+@rem #
+@rem # build.bat
+@rem #
+@rem # Abstract:
+@rem #
+@rem # This script provides single module build, clean and find function
+@rem # based on module name.
+@rem #
+@rem # The auto-generated module.list file records all module names
+@rem # described in the current platform.dsc.
+@rem #
+@rem #--*/
+
+@echo off
+
+setlocal
+@rem initilize local variable
+set FUNCTION=build
+set MODULE=
+set UPDATE=
+set VERBOSE=
+
+:parse
+if /I "%1"=="/c" (
+ set FUNCTION=clean
+ shift
+ goto parse
+)
+if /I "%1"=="clean" (
+ set FUNCTION=clean
+ shift
+ goto parse
+)
+if /I "%1"=="/r" (
+ set FUNCTION=rebuild
+ shift
+ goto parse
+)
+if /I "%1"=="/h" (
+ set FUNCTION=usage
+ shift
+ goto parse
+)
+if /I "%1"=="/?" (
+ set FUNCTION=usage
+ shift
+ goto parse
+)
+if /I "%1"=="/f" (
+ set FUNCTION=find
+ shift
+ goto parse
+)
+if /I "%1"=="/a" (
+ set UPDATE=TRUE
+ shift
+ goto parse
+)
+if /I "%1"=="/v" (
+ set VERBOSE=TRUE
+ shift
+ goto parse
+)
+if not "%1"=="" (
+ set MODULE=%1
+ shift
+ goto parse
+) else (
+ @rem no other paramters
+ if "%FUNCTION%"=="rebuild" goto build
+ goto %FUNCTION%
+)
+
+:build
+set StartTime=%time%
+@rem if no input, build all
+if "%MODULE%"=="" (
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile clean
+ )
+ nmake -nologo -f Makefile all
+ goto endtime
+)
+@rem then try to build special targets: all, fast, tools.
+if /I "%MODULE%"=="all" (
+ @rem build all modules and tools.
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile cleanall
+ )
+ nmake -nologo -f Makefile all
+ goto endtime
+)
+if /I "%MODULE%"=="fast" (
+ @rem build fast target to skip FV=NULL modules.
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile clean
+ )
+ nmake -nologo -f Makefile fast
+ goto endtime
+)
+if /I "%MODULE%"=="tools" (
+ @rem build all tools.
+ if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f Makefile cleantools
+ )
+ nmake -nologo -f Makefile build_tools
+ echo.
+ echo All tools are built.
+ goto endtime
+)
+@rem build single module, update build makefiles
+if "%FUNCTION%"=="rebuild" (
+ nmake -nologo -f module.mak %MODULE%Clean 2>NUL
+)
+nmake -nologo -f Makefile flashmap > NUL 2>&1
+nmake -nologo -f Makefile makefiles
+if errorlevel 1 goto builderror
+@rem check whether input module name is described in current dsc file.
+findstr /I /C:" %MODULE% " module.list > NUL
+if errorlevel 1 (
+ echo.
+ echo.
+ findstr /I /C:"%MODULE%" module.list > NUL
+ if errorlevel 1 goto finderror
+ for /F %%A in ('findstr /I /C:"%MODULE%" module.list') do echo %%A
+ echo.
+ echo Warning!!! Your specified module name can't be found.
+ echo One of the above modules may be what you want to build.
+ goto end
+)
+@rem build this module
+nmake -nologo -f module.mak %MODULE%Build
+echo.
+if "%FUNCTION%"=="rebuild" (
+ echo Module %MODULE% is rebuilt.
+) else (
+ echo Module %MODULE% is built.
+)
+:endtime
+@rem output build time.
+set EndTime=%time%
+echo.
+echo Start time %StartTime%
+echo End time %EndTime%
+goto end
+
+:clean
+@rem if no input, default clean all build directories.
+if "%MODULE%"=="" (
+ nmake -nologo -f Makefile clean
+ goto end
+)
+@rem first try to clean special tasks: all, modules and tools
+if /I "%MODULE%"=="all" (
+ nmake -nologo -f Makefile cleanall
+ goto end
+)
+if /I "%MODULE%"=="modules" (
+ nmake -nologo -f Makefile cleanbuilds
+ goto end
+)
+if /I "%MODULE%"=="tools" (
+ nmake -nologo -f Makefile cleantools
+ goto end
+)
+@rem clean single module
+@rem check whether input module name is in module.list file.
+if not exist module.list (
+ echo Module list info doesn't exist.
+ echo Processing dsc file to generate module list info.
+ nmake -nologo -f Makefile flashmap > NUL 2>&1
+ nmake -nologo -f Makefile makefiles > error.log 2>&1
+ if errorlevel 1 goto builderror
+)
+findstr /I /C:" %MODULE% " module.list > NUL
+if errorlevel 1 (
+ echo.
+ findstr /I /C:"%MODULE%" module.list > NUL
+ if errorlevel 1 goto finderror
+ for /F %%A in ('findstr /I /C:"%MODULE%" module.list') do echo %%A
+ echo.
+ echo Warning!!! Your specified module name can't be found.
+ echo One of the above modules may be what you want to clean.
+ goto end
+)
+@rem clean this module
+nmake -nologo -f module.mak %MODULE%Clean 2>NUL
+echo.
+echo Module %MODULE% is cleaned.
+goto end
+
+:find
+@rem find match module name by subname.
+if "%UPDATE%"=="TRUE" (
+ echo Processing dsc file to update module list info.
+ nmake -nologo -f Makefile flashmap > NUL 2>&1
+ nmake -nologo -f Makefile makefiles > error.log 2>&1
+ if errorlevel 1 goto builderror
+)
+if not exist module.list (
+ echo Module list info doesn't exist.
+ echo Processing dsc file to generate module list info.
+ nmake -nologo -f Makefile flashmap > NUL 2>&1
+ nmake -nologo -f Makefile makefiles > error.log 2>&1
+ if errorlevel 1 goto builderror
+)
+if "%MODULE%"=="" (
+ @rem display all
+ echo.
+ if "%VERBOSE%"=="TRUE" (
+ type module.list
+ ) else (
+ @rem only output module name without module.inf file name
+ for /F %%A in (module.list) do echo %%A
+ )
+) else (
+ @rem display match module name
+ echo.
+ if "%VERBOSE%"=="TRUE" (
+ findstr /I /C:"%MODULE%" module.list
+ if errorlevel 1 goto notfind
+ ) else (
+ findstr /I /C:"%MODULE%" module.list > NUL
+ if errorlevel 1 goto notfind
+ for /F %%A in ('findstr /I /C:"%MODULE%" module.list') do echo %%A
+ )
+)
+goto end
+
+:usage
+echo build or clean single module based on module name after tools are built.
+echo.
+echo build [/r] [/c] [/f] [/h] [modulename]
+echo.
+echo build [/r] [modulename]
+echo build single module, such as build DxeMain.
+echo If /r is specified, the target will be rebuit after cleaned first.
+echo if no input modulename or modulename is all, then build all
+echo Specail build targets: all, fast, tools.
+echo These special targets may not exist in your tip main makefile.
+echo build - build all tools and modules
+echo build all - build all tools and modules
+echo build fast - build all without FV=NULL modules
+echo build tools - build all tools.
+echo.
+echo build /c [modulename]
+echo build clean [modulename]
+echo remove the temp generated files for single module
+echo if no input modulename, then clean all
+echo Specail clean targets: all, modules, tools.
+echo These special targets may not exist in your tip main makefile.
+echo build /c - clean up all build directories
+echo build /c all - clean up all build directories and binary dirs.
+echo build /c modules - clean up all build directories except for tools.
+echo build /c tools - clean up only tools directory.
+echo.
+echo build /f [/a] [/v] [subname]
+echo find all matched modulename with the sub string of module name.
+echo option /a re-processes dsc files to update module name list.
+echo option /v outputs module name and module.inf file name both.
+echo.
+echo build /h
+echo build /?
+echo display help information.
+echo.
+goto end
+
+:notfind
+echo Warning!!! Your specified module name can't be found.
+echo Try to use /f /a options to update module name list.
+goto end
+
+:finderror
+echo Warning!!! Your specified module name can't be found.
+echo Try to use /f to find modules that you want to build.
+echo Or use /h to get the helpinfo of this script.
+goto end
+
+:builderror
+if exist error.log type error.log
+echo.
+if not exist Tools\ProcessDsc.exe (
+ echo.
+ echo Error!!! Build tools may not be ready. Try to build tools first.
+ echo.
+)
+del module.* > NUL 2>&1
+goto end
+
+:end
+if exist error.log del error.log
+echo on