blob: 45520536a25cff3561fe3320e81b610ad1716522 [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)
lgao4e5b317d2011-12-14 06:15:48 +000032011-12-14
vanjeffe4d8dbc2007-06-25 11:16:31 +00004
5Intel is a trademark or registered trademark of Intel Corporation or its
6subsidiaries in the United States and other countries.
7* Other names and brands may be claimed as the property of others.
lgao4e5b317d2011-12-14 06:15:48 +00008Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
vanjeffe4d8dbc2007-06-25 11:16:31 +00009
Peter Kirmeier44804142016-03-18 06:21:50 +080010EDK II packages can be gathered from the following address:
11 https://github.com/tianocore/edk2.git
vanjeffe4d8dbc2007-06-25 11:16:31 +000012
qhuang8caf30462010-03-31 16:25:38 +000013The detailed introduction of these packages can be found in each package
14description file. (The *.dec file under the package directory)
lhauch1f4c44a2008-05-15 16:14:56 +000015
vanjeffe4d8dbc2007-06-25 11:16:31 +000016
17-------------------------------------------------------------------------------
lhauch1f4c44a2008-05-15 16:14:56 +000018The most recent version of the setup instructions is available on the EDK II
19web-site:
Peter Kirmeier44804142016-03-18 06:21:50 +080020 https://github.com/tianocore/tianocore.github.io/wiki/Getting%20Started%20with%20EDK%20II
lhauch1f4c44a2008-05-15 16:14:56 +000021
22
23-------------------------------------------------------------------------------
24Quick Start (Windows Development Platform)
vanjeffe4d8dbc2007-06-25 11:16:31 +000025-----------
26
lhauch1f4c44a2008-05-15 16:14:56 +000027In a command prompt window, change to the top-level directory of the EDK II
28source.
vanjeffe4d8dbc2007-06-25 11:16:31 +000029
lhauch1f4c44a2008-05-15 16:14:56 +000030Note:
31 The first time the edksetup script is executed, it creates three files in the
32 %WORKSPACE%\Conf directory. The files: tools_def.txt, target.txt and
33 build_rule.txt, are only created if they do not exist, if they exist, they
34 are not touched.
35
36First, set up your project workspace. If you have previously initialized this
37WORKSPACE, and a newer version of the *.template files in
38WORKSPACE\BaseTools\Conf exists, remove the *.txt files in the WORKSPACE\Conf
39directory prior to running the edksetup script.
40
41For the reference build of the Nt32 Platform emulation environment, use the
42edksetup.bat option: --nt32. For building other platforms or modules, this
43option is not required, as Visual Studio standard includes, libraries and/or
44dlls are not required for normal development.
lhauch8014e7c2008-02-22 16:31:23 +000045
46 c:\MyWork\edk2\> edksetup --nt32
vanjeffe4d8dbc2007-06-25 11:16:31 +000047
lgao4e5b317d2011-12-14 06:15:48 +000048The default tool chain (named MYTOOLS) is pre-configured to use VS2008 for IA32
49and X64 target architectures and DDK3790 for IPF target architectures. To use a
lhauch1f4c44a2008-05-15 16:14:56 +000050different tool chain, either modify the tools_def.txt file's MYTOOLS entries,
51or modify the %WORKSPACE%\Conf\target.txt file's TOOL_CHAIN_TAG. The pre-defined
52tags are listed near the top of the %WORKSPACE%\Conf\tools_def.txt file, below
53the Supported Tool Chains comment.
54Alternatively, you may use the build command's -t option to specify a different
lgao4e5b317d2011-12-14 06:15:48 +000055tool chain tag name: build -t VS2008 ... , for example. Using this method will
56require that you always use the build command's -t option. If you use 64-bit
Peter Kirmeier44804142016-03-18 06:21:50 +080057Windows OS, you should use tool chain tag name with x86, such as VS2008x86.
lhauch1f4c44a2008-05-15 16:14:56 +000058
59
Peter Kirmeier44804142016-03-18 06:21:50 +080060Next, go to the module directory and begin to build. This example is for the
lhauch1f4c44a2008-05-15 16:14:56 +000061HelloWorld application.
62
vanjeffe4d8dbc2007-06-25 11:16:31 +000063 c:\MyWork\edk2\> cd MdeModulePkg\Application\HelloWorld
64 c:\MyWork\edk2\> build
65
lhauch1f4c44a2008-05-15 16:14:56 +000066If you want to build the a module in another package (for example,
Peter Kirmeier44804142016-03-18 06:21:50 +080067MdePkg\Library\BaseLib\BaseLib.inf), please edit the file
68%WORKSPACE%\Conf\Target.txt first.
vanjeffe4d8dbc2007-06-25 11:16:31 +000069
lhauch1f4c44a2008-05-15 16:14:56 +000070Change the following line
vanjeffe4d8dbc2007-06-25 11:16:31 +000071 ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
72to
73 ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
74
lhauch1f4c44a2008-05-15 16:14:56 +000075Then go to MdePkg\Library\BaseLib directory and type build:
vanjeffe4d8dbc2007-06-25 11:16:31 +000076 c:\MyWork\edk2\> cd MdePkg\Library\BaseLib
77 c:\MyWork\edk2\> build
78
lhauch1f4c44a2008-05-15 16:14:56 +000079If you want build a platform, ACTIVE_PLATFORM must be set to your desired
80platform dsc file, go to directory which must be not a module's directory, and
81run "build" command.
jwang3611dd6c32007-06-27 02:16:16 +000082
lhauch1f4c44a2008-05-15 16:14:56 +000083Instead of changing Target.txt, you can specify platform, module and/or
84architecture on command line.
jwang36183bc302007-07-19 01:43:29 +000085For example, if you want to build NT32 platform, you can just type
86
lhauch1f4c44a2008-05-15 16:14:56 +000087 c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32
jwang36183bc302007-07-19 01:43:29 +000088
89and if you want to build HelloWorld module, you can just type
90
lhauch1f4c44a2008-05-15 16:14:56 +000091 c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32 -m MdeModulePkg\Application\HelloWorld\HelloWorld.inf
jwang36183bc302007-07-19 01:43:29 +000092
lhauch1f4c44a2008-05-15 16:14:56 +000093Other helpful command line options of build tool include "-v" and "-d".
94The "-v" option is used to turn on the verbose build, which provide more
95information during the build. "-d <debug level 0-9>" option is used to
jwang36183bc302007-07-19 01:43:29 +000096turn on the debug information which is helpful debugging build tools.
97
lhauch1f4c44a2008-05-15 16:14:56 +000098For more information on build options, please try "build -h" on command line.
99
100Note:
101 The Windows style help option "/?" is not a valid option for the build
102 command.
jwang36183bc302007-07-19 01:43:29 +0000103
104
105-------------------------------------------------------------------------------
106Supported build targets
107-----------------------
108
jwang360c71bc32007-09-03 06:11:35 +0000109all - Build whole platform or module. It can be ignored.
110genc - Generate AutoGen.c, AutoGen.h and <ModuleName>.depex files only.
111genmake - Generate makefiles in addition to files generated by "genc" target.
jwang36183bc302007-07-19 01:43:29 +0000112clean - Clean intermediate files
lhauch1f4c44a2008-05-15 16:14:56 +0000113cleanall - Clean all generated files and directories during build, except the
114 generated Makefile files (top level and module makefiles)
jwang36183bc302007-07-19 01:43:29 +0000115cleanlib - Clean all generated files and directories during library build
jwang360c71bc32007-09-03 06:11:35 +0000116run - Launch NT32 shell (only valid for NT32 platform)
jwang36183bc302007-07-19 01:43:29 +0000117
jwang3611dd6c32007-06-27 02:16:16 +0000118-------------------------------------------------------------------------------
119Tools in Python
120---------------
121
Peter Kirmeier44804142016-03-18 06:21:50 +0800122* Run build tool written in Python from source
123 It can be executed from its source directly as long as you have the Python
124 interpreter (version 2.5.4) installed. The source code is located at
125 WORKSPACE/BaseTools.
jwang3611dd6c32007-06-27 02:16:16 +0000126
lhauch1f4c44a2008-05-15 16:14:56 +0000127 where:
jwang3611dd6c32007-06-27 02:16:16 +0000128
lhauch1f4c44a2008-05-15 16:14:56 +0000129 build/build.py - The entry tool of build tools
jwang3611dd6c32007-06-27 02:16:16 +0000130
lhauch1f4c44a2008-05-15 16:14:56 +0000131 "build.py" steps:
132 1. Run "edksetup.bat"
133 2. set PYTHONPATH to the local directory of above source
134 (BaseTools/Source/Python)
135 3. Set ACTIVE_PLATFORM in WORKSPACE\Conf
136 4. Go to platform or module directory
137 5. Run "<python_interpreter.exe> <python_source_dir>/build/build.py" or
138 "<python_source_dir>/build/build.py" directly.
jwang3611dd6c32007-06-27 02:16:16 +0000139
jwang3611dd6c32007-06-27 02:16:16 +0000140* Convert Python source to exe file
lhauch1f4c44a2008-05-15 16:14:56 +0000141 The tools written in Python can be coverted into executable program which can
142 be executed without Python interpreter. One of the conversion tools is called
143 cx_Freeze, available at:
jwang3611dd6c32007-06-27 02:16:16 +0000144
lhauch1f4c44a2008-05-15 16:14:56 +0000145 http://sourceforge.net/projects/cx-freeze/
jwang3611dd6c32007-06-27 02:16:16 +0000146
lhauch1f4c44a2008-05-15 16:14:56 +0000147 If you have installed cx_Freeze at c:\cx_Freeze-3.0.3. Use the following
148 command lines to convert MyBuild.py to a Windows executable.
jwang3611dd6c32007-06-27 02:16:16 +0000149
jwang360c71bc32007-09-03 06:11:35 +0000150 set PYTHONPATH=<buildtools>\BaseTools\Source\Python
lhauch1f4c44a2008-05-15 16:14:56 +0000151 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 +0000152
lhauch1f4c44a2008-05-15 16:14:56 +0000153 The generated .exe files are put in "mybuild" subdirectory.
vanjeffe4d8dbc2007-06-25 11:16:31 +0000154