2007-06-25 13:16:31 +02:00
|
|
|
Intel(R) Platform Innovation Framework for EFI
|
2008-09-26 01:13:48 +02:00
|
|
|
EFI Development Kit II (EDK II)
|
2011-12-14 07:15:48 +01:00
|
|
|
2011-12-14
|
2007-06-25 13:16:31 +02:00
|
|
|
|
|
|
|
Intel is a trademark or registered trademark of Intel Corporation or its
|
|
|
|
subsidiaries in the United States and other countries.
|
|
|
|
* Other names and brands may be claimed as the property of others.
|
2011-12-14 07:15:48 +01:00
|
|
|
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
|
2007-06-25 13:16:31 +02:00
|
|
|
|
2016-03-17 23:21:50 +01:00
|
|
|
EDK II packages can be gathered from the following address:
|
|
|
|
https://github.com/tianocore/edk2.git
|
2007-06-25 13:16:31 +02:00
|
|
|
|
2010-03-31 18:25:38 +02:00
|
|
|
The detailed introduction of these packages can be found in each package
|
|
|
|
description file. (The *.dec file under the package directory)
|
2008-05-15 18:14:56 +02:00
|
|
|
|
2007-06-25 13:16:31 +02:00
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
2008-05-15 18:14:56 +02:00
|
|
|
The most recent version of the setup instructions is available on the EDK II
|
|
|
|
web-site:
|
2016-03-17 23:21:50 +01:00
|
|
|
https://github.com/tianocore/tianocore.github.io/wiki/Getting%20Started%20with%20EDK%20II
|
2008-05-15 18:14:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Quick Start (Windows Development Platform)
|
2007-06-25 13:16:31 +02:00
|
|
|
-----------
|
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
In a command prompt window, change to the top-level directory of the EDK II
|
|
|
|
source.
|
2007-06-25 13:16:31 +02:00
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
Note:
|
|
|
|
The first time the edksetup script is executed, it creates three files in the
|
|
|
|
%WORKSPACE%\Conf directory. The files: tools_def.txt, target.txt and
|
|
|
|
build_rule.txt, are only created if they do not exist, if they exist, they
|
|
|
|
are not touched.
|
|
|
|
|
|
|
|
First, set up your project workspace. If you have previously initialized this
|
|
|
|
WORKSPACE, and a newer version of the *.template files in
|
|
|
|
WORKSPACE\BaseTools\Conf exists, remove the *.txt files in the WORKSPACE\Conf
|
|
|
|
directory prior to running the edksetup script.
|
|
|
|
|
|
|
|
For the reference build of the Nt32 Platform emulation environment, use the
|
|
|
|
edksetup.bat option: --nt32. For building other platforms or modules, this
|
|
|
|
option is not required, as Visual Studio standard includes, libraries and/or
|
|
|
|
dlls are not required for normal development.
|
2008-02-22 17:31:23 +01:00
|
|
|
|
|
|
|
c:\MyWork\edk2\> edksetup --nt32
|
2007-06-25 13:16:31 +02:00
|
|
|
|
2011-12-14 07:15:48 +01:00
|
|
|
The default tool chain (named MYTOOLS) is pre-configured to use VS2008 for IA32
|
|
|
|
and X64 target architectures and DDK3790 for IPF target architectures. To use a
|
2008-05-15 18:14:56 +02:00
|
|
|
different tool chain, either modify the tools_def.txt file's MYTOOLS entries,
|
|
|
|
or modify the %WORKSPACE%\Conf\target.txt file's TOOL_CHAIN_TAG. The pre-defined
|
|
|
|
tags are listed near the top of the %WORKSPACE%\Conf\tools_def.txt file, below
|
|
|
|
the Supported Tool Chains comment.
|
|
|
|
Alternatively, you may use the build command's -t option to specify a different
|
2011-12-14 07:15:48 +01:00
|
|
|
tool chain tag name: build -t VS2008 ... , for example. Using this method will
|
|
|
|
require that you always use the build command's -t option. If you use 64-bit
|
2016-03-17 23:21:50 +01:00
|
|
|
Windows OS, you should use tool chain tag name with x86, such as VS2008x86.
|
2008-05-15 18:14:56 +02:00
|
|
|
|
|
|
|
|
2016-03-17 23:21:50 +01:00
|
|
|
Next, go to the module directory and begin to build. This example is for the
|
2008-05-15 18:14:56 +02:00
|
|
|
HelloWorld application.
|
|
|
|
|
2007-06-25 13:16:31 +02:00
|
|
|
c:\MyWork\edk2\> cd MdeModulePkg\Application\HelloWorld
|
|
|
|
c:\MyWork\edk2\> build
|
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
If you want to build the a module in another package (for example,
|
2016-03-17 23:21:50 +01:00
|
|
|
MdePkg\Library\BaseLib\BaseLib.inf), please edit the file
|
|
|
|
%WORKSPACE%\Conf\Target.txt first.
|
2007-06-25 13:16:31 +02:00
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
Change the following line
|
2007-06-25 13:16:31 +02:00
|
|
|
ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
|
|
|
|
to
|
|
|
|
ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
|
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
Then go to MdePkg\Library\BaseLib directory and type build:
|
2007-06-25 13:16:31 +02:00
|
|
|
c:\MyWork\edk2\> cd MdePkg\Library\BaseLib
|
|
|
|
c:\MyWork\edk2\> build
|
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
If you want build a platform, ACTIVE_PLATFORM must be set to your desired
|
|
|
|
platform dsc file, go to directory which must be not a module's directory, and
|
|
|
|
run "build" command.
|
2007-06-27 04:16:16 +02:00
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
Instead of changing Target.txt, you can specify platform, module and/or
|
|
|
|
architecture on command line.
|
2007-07-19 03:43:29 +02:00
|
|
|
For example, if you want to build NT32 platform, you can just type
|
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32
|
2007-07-19 03:43:29 +02:00
|
|
|
|
|
|
|
and if you want to build HelloWorld module, you can just type
|
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32 -m MdeModulePkg\Application\HelloWorld\HelloWorld.inf
|
2007-07-19 03:43:29 +02:00
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
Other helpful command line options of build tool include "-v" and "-d".
|
|
|
|
The "-v" option is used to turn on the verbose build, which provide more
|
|
|
|
information during the build. "-d <debug level 0-9>" option is used to
|
2007-07-19 03:43:29 +02:00
|
|
|
turn on the debug information which is helpful debugging build tools.
|
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
For more information on build options, please try "build -h" on command line.
|
|
|
|
|
|
|
|
Note:
|
|
|
|
The Windows style help option "/?" is not a valid option for the build
|
|
|
|
command.
|
2007-07-19 03:43:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Supported build targets
|
|
|
|
-----------------------
|
|
|
|
|
2007-09-03 08:11:35 +02:00
|
|
|
all - Build whole platform or module. It can be ignored.
|
|
|
|
genc - Generate AutoGen.c, AutoGen.h and <ModuleName>.depex files only.
|
|
|
|
genmake - Generate makefiles in addition to files generated by "genc" target.
|
2007-07-19 03:43:29 +02:00
|
|
|
clean - Clean intermediate files
|
2008-05-15 18:14:56 +02:00
|
|
|
cleanall - Clean all generated files and directories during build, except the
|
|
|
|
generated Makefile files (top level and module makefiles)
|
2007-07-19 03:43:29 +02:00
|
|
|
cleanlib - Clean all generated files and directories during library build
|
2007-09-03 08:11:35 +02:00
|
|
|
run - Launch NT32 shell (only valid for NT32 platform)
|
2007-07-19 03:43:29 +02:00
|
|
|
|
2007-06-27 04:16:16 +02:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
Tools in Python
|
|
|
|
---------------
|
|
|
|
|
2016-03-17 23:21:50 +01:00
|
|
|
* Run build tool written in Python from source
|
|
|
|
It can be executed from its source directly as long as you have the Python
|
|
|
|
interpreter (version 2.5.4) installed. The source code is located at
|
|
|
|
WORKSPACE/BaseTools.
|
2008-05-15 18:14:56 +02:00
|
|
|
|
|
|
|
where:
|
|
|
|
|
|
|
|
build/build.py - The entry tool of build tools
|
|
|
|
|
|
|
|
"build.py" steps:
|
|
|
|
1. Run "edksetup.bat"
|
|
|
|
2. set PYTHONPATH to the local directory of above source
|
|
|
|
(BaseTools/Source/Python)
|
|
|
|
3. Set ACTIVE_PLATFORM in WORKSPACE\Conf
|
|
|
|
4. Go to platform or module directory
|
|
|
|
5. Run "<python_interpreter.exe> <python_source_dir>/build/build.py" or
|
|
|
|
"<python_source_dir>/build/build.py" directly.
|
|
|
|
|
2007-06-27 04:16:16 +02:00
|
|
|
* Convert Python source to exe file
|
2019-02-06 08:44:39 +01:00
|
|
|
The tools written in Python can be converted into executable program which can
|
2008-05-15 18:14:56 +02:00
|
|
|
be executed without Python interpreter. One of the conversion tools is called
|
|
|
|
cx_Freeze, available at:
|
2007-06-27 04:16:16 +02:00
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
http://sourceforge.net/projects/cx-freeze/
|
2007-06-27 04:16:16 +02:00
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
If you have installed cx_Freeze at c:\cx_Freeze-3.0.3. Use the following
|
|
|
|
command lines to convert MyBuild.py to a Windows executable.
|
2007-06-27 04:16:16 +02:00
|
|
|
|
2007-09-03 08:11:35 +02:00
|
|
|
set PYTHONPATH=<buildtools>\BaseTools\Source\Python
|
2008-05-15 18:14:56 +02:00
|
|
|
c:\cx_Freeze-3.0.3\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8 --install-dir=.\mybuild MyBuild.py
|
2007-06-27 04:16:16 +02:00
|
|
|
|
2008-05-15 18:14:56 +02:00
|
|
|
The generated .exe files are put in "mybuild" subdirectory.
|
2007-06-25 13:16:31 +02:00
|
|
|
|