blob: 693e3b8ba1383ca85b1e982b6d99d6ef27d1067c [file] [log] [blame]
vanjeffe4d8dbc2007-06-25 11:16:31 +00001Intel(R) Platform Innovation Framework for EFI
jcarseya64823f2008-09-25 23:13:48 +00002EFI Development Kit II (EDK II)
vanjeffe4d8dbc2007-06-25 11:16:31 +00003Root Package 1.00
jcarseya64823f2008-09-25 23:13:48 +000042008-05-22
vanjeffe4d8dbc2007-06-25 11:16:31 +00005
6Intel is a trademark or registered trademark of Intel Corporation or its
7subsidiaries in the United States and other countries.
8* Other names and brands may be claimed as the property of others.
lhauch1f4c44a2008-05-15 16:14:56 +00009Copyright (c) 2007 - 2008, Intel Corporation All rights reserved.
vanjeffe4d8dbc2007-06-25 11:16:31 +000010
jcarseya64823f2008-09-25 23:13:48 +000011EDK II packages are in the development phase. They consist of:
vanjeffe4d8dbc2007-06-25 11:16:31 +000012
qhuang8f91b9b32007-07-02 06:10:56 +000013 BuildNotes2.txt - The build notes for this package
qhuang8f91b9b32007-07-02 06:10:56 +000014 BaseTools - Build -specific tools that are designed to help the
15 developer create and modify drivers and libraries
jcarseya64823f2008-09-25 23:13:48 +000016 DuetPkg - UEFI 2.1.PI 1.0 boot image creation platform
lhauch1f4c44a2008-05-15 16:14:56 +000017 EdkShellBinPkg - Binaries of full shell, minimum shell and commands
jcarseya64823f2008-09-25 23:13:48 +000018 FatBinPkg - Binaries built from the FatPkg
19 IntelFrameworkPkg - Tiano/Framework Includes and Libraries
20 IntelFrameworkModulePKg - Tiano/Framework Includes and Libraries
21 MdeModulePkg - UEFI 2.1/PI 1.0 compliant modules
22 MdePkg - Industry-standard headers and libraries
23 Nt32Pkg - UEFI 2.1/PI 1.0 emulation environment for Windows
24 OptionRomPkg - UEFI 2.1 peripheral drivers
25 UnixPkg - UEFI 2.1/PI 1.0 emulation environment for Unix
lhauch1f4c44a2008-05-15 16:14:56 +000026
vanjeffe4d8dbc2007-06-25 11:16:31 +000027
28-------------------------------------------------------------------------------
lhauch1f4c44a2008-05-15 16:14:56 +000029The most recent version of the setup instructions is available on the EDK II
30web-site:
31 https://edk2.tianocore.org/installation.html
32
33
34-------------------------------------------------------------------------------
35Quick Start (Windows Development Platform)
vanjeffe4d8dbc2007-06-25 11:16:31 +000036-----------
37
lhauch1f4c44a2008-05-15 16:14:56 +000038In a command prompt window, change to the top-level directory of the EDK II
39source.
vanjeffe4d8dbc2007-06-25 11:16:31 +000040
lhauch1f4c44a2008-05-15 16:14:56 +000041Note:
42 The first time the edksetup script is executed, it creates three files in the
43 %WORKSPACE%\Conf directory. The files: tools_def.txt, target.txt and
44 build_rule.txt, are only created if they do not exist, if they exist, they
45 are not touched.
46
47First, set up your project workspace. If you have previously initialized this
48WORKSPACE, and a newer version of the *.template files in
49WORKSPACE\BaseTools\Conf exists, remove the *.txt files in the WORKSPACE\Conf
50directory prior to running the edksetup script.
51
52For the reference build of the Nt32 Platform emulation environment, use the
53edksetup.bat option: --nt32. For building other platforms or modules, this
54option is not required, as Visual Studio standard includes, libraries and/or
55dlls are not required for normal development.
lhauch8014e7c2008-02-22 16:31:23 +000056
57 c:\MyWork\edk2\> edksetup --nt32
vanjeffe4d8dbc2007-06-25 11:16:31 +000058
lhauch1f4c44a2008-05-15 16:14:56 +000059The default tool chain (named MYTOOLS) is pre-configured to use VS2005 for IA32
60and X64 target architectures and the DDK for IPF target architectures. To use a
61different tool chain, either modify the tools_def.txt file's MYTOOLS entries,
62or modify the %WORKSPACE%\Conf\target.txt file's TOOL_CHAIN_TAG. The pre-defined
63tags are listed near the top of the %WORKSPACE%\Conf\tools_def.txt file, below
64the Supported Tool Chains comment.
65Alternatively, you may use the build command's -t option to specify a different
66tool chain tag name: build -t VS2003 ... , for example. Using this method will
67require that you always use the build command's -t option.
68
69
70Next, go to the module directory and begin to build. This example is for the
71HelloWorld application.
72
vanjeffe4d8dbc2007-06-25 11:16:31 +000073 c:\MyWork\edk2\> cd MdeModulePkg\Application\HelloWorld
74 c:\MyWork\edk2\> build
75
lhauch1f4c44a2008-05-15 16:14:56 +000076If you want to build the a module in another package (for example,
77MdePkg\Library\BaseLib\BaseLib.inf), please edit the file,
78%WORKSPACE%\Conf\Target.txt, first.
vanjeffe4d8dbc2007-06-25 11:16:31 +000079
lhauch1f4c44a2008-05-15 16:14:56 +000080Change the following line
vanjeffe4d8dbc2007-06-25 11:16:31 +000081 ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
82to
83 ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
84
lhauch1f4c44a2008-05-15 16:14:56 +000085Then go to MdePkg\Library\BaseLib directory and type build:
vanjeffe4d8dbc2007-06-25 11:16:31 +000086 c:\MyWork\edk2\> cd MdePkg\Library\BaseLib
87 c:\MyWork\edk2\> build
88
lhauch1f4c44a2008-05-15 16:14:56 +000089If you want build a platform, ACTIVE_PLATFORM must be set to your desired
90platform dsc file, go to directory which must be not a module's directory, and
91run "build" command.
jwang3611dd6c32007-06-27 02:16:16 +000092
lhauch1f4c44a2008-05-15 16:14:56 +000093Instead of changing Target.txt, you can specify platform, module and/or
94architecture on command line.
jwang36183bc302007-07-19 01:43:29 +000095For example, if you want to build NT32 platform, you can just type
96
lhauch1f4c44a2008-05-15 16:14:56 +000097 c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32
jwang36183bc302007-07-19 01:43:29 +000098
99and if you want to build HelloWorld module, you can just type
100
lhauch1f4c44a2008-05-15 16:14:56 +0000101 c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32 -m MdeModulePkg\Application\HelloWorld\HelloWorld.inf
jwang36183bc302007-07-19 01:43:29 +0000102
lhauch1f4c44a2008-05-15 16:14:56 +0000103Other helpful command line options of build tool include "-v" and "-d".
104The "-v" option is used to turn on the verbose build, which provide more
105information during the build. "-d <debug level 0-9>" option is used to
jwang36183bc302007-07-19 01:43:29 +0000106turn on the debug information which is helpful debugging build tools.
107
lhauch1f4c44a2008-05-15 16:14:56 +0000108For more information on build options, please try "build -h" on command line.
109
110Note:
111 The Windows style help option "/?" is not a valid option for the build
112 command.
jwang36183bc302007-07-19 01:43:29 +0000113
114
115-------------------------------------------------------------------------------
116Supported build targets
117-----------------------
118
jwang360c71bc32007-09-03 06:11:35 +0000119all - Build whole platform or module. It can be ignored.
120genc - Generate AutoGen.c, AutoGen.h and <ModuleName>.depex files only.
121genmake - Generate makefiles in addition to files generated by "genc" target.
jwang36183bc302007-07-19 01:43:29 +0000122clean - Clean intermediate files
lhauch1f4c44a2008-05-15 16:14:56 +0000123cleanall - Clean all generated files and directories during build, except the
124 generated Makefile files (top level and module makefiles)
jwang36183bc302007-07-19 01:43:29 +0000125cleanlib - Clean all generated files and directories during library build
jwang360c71bc32007-09-03 06:11:35 +0000126run - Launch NT32 shell (only valid for NT32 platform)
jwang36183bc302007-07-19 01:43:29 +0000127
jwang3611dd6c32007-06-27 02:16:16 +0000128-------------------------------------------------------------------------------
129Tools in Python
130---------------
131
132* Run buld tool written in Python from source
lhauch1f4c44a2008-05-15 16:14:56 +0000133 The build tool written in Python can be executed from its source directly as
134 long as you have the Python interpreter (version 2.5) installed. The source
135 of Python code is locating at:
jwang3611dd6c32007-06-27 02:16:16 +0000136
lhauch1f4c44a2008-05-15 16:14:56 +0000137 https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools/Source/Python
jwang3611dd6c32007-06-27 02:16:16 +0000138
lhauch1f4c44a2008-05-15 16:14:56 +0000139 where:
jwang3611dd6c32007-06-27 02:16:16 +0000140
lhauch1f4c44a2008-05-15 16:14:56 +0000141 build/build.py - The entry tool of build tools
jwang3611dd6c32007-06-27 02:16:16 +0000142
lhauch1f4c44a2008-05-15 16:14:56 +0000143 "build.py" steps:
144 1. Run "edksetup.bat"
145 2. set PYTHONPATH to the local directory of above source
146 (BaseTools/Source/Python)
147 3. Set ACTIVE_PLATFORM in WORKSPACE\Conf
148 4. Go to platform or module directory
149 5. Run "<python_interpreter.exe> <python_source_dir>/build/build.py" or
150 "<python_source_dir>/build/build.py" directly.
jwang3611dd6c32007-06-27 02:16:16 +0000151
jwang3611dd6c32007-06-27 02:16:16 +0000152* Convert Python source to exe file
lhauch1f4c44a2008-05-15 16:14:56 +0000153 The tools written in Python can be coverted into executable program which can
154 be executed without Python interpreter. One of the conversion tools is called
155 cx_Freeze, available at:
jwang3611dd6c32007-06-27 02:16:16 +0000156
lhauch1f4c44a2008-05-15 16:14:56 +0000157 http://sourceforge.net/projects/cx-freeze/
jwang3611dd6c32007-06-27 02:16:16 +0000158
lhauch1f4c44a2008-05-15 16:14:56 +0000159 If you have installed cx_Freeze at c:\cx_Freeze-3.0.3. Use the following
160 command lines to convert MyBuild.py to a Windows executable.
jwang3611dd6c32007-06-27 02:16:16 +0000161
jwang360c71bc32007-09-03 06:11:35 +0000162 set PYTHONPATH=<buildtools>\BaseTools\Source\Python
lhauch1f4c44a2008-05-15 16:14:56 +0000163 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
jwang3611dd6c32007-06-27 02:16:16 +0000164
lhauch1f4c44a2008-05-15 16:14:56 +0000165 The generated .exe files are put in "mybuild" subdirectory.
vanjeffe4d8dbc2007-06-25 11:16:31 +0000166