blob: 3e6f6f96d068a25d47240ab947768bbf1846eef5 [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)
qhuang8caf30462010-03-31 16:25:38 +000032010-03-31
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.
qhuang8caf30462010-03-31 16:25:38 +00008Copyright (c) 2007 - 2010, Intel Corporation All rights reserved.
vanjeffe4d8dbc2007-06-25 11:16:31 +00009
qhuang8caf30462010-03-31 16:25:38 +000010EDK II packages can be checked out from the following SVN address:
11http://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2
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:
qhuang8caf30462010-03-31 16:25:38 +000020 http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=Step-by-step_instructions
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
lhauch1f4c44a2008-05-15 16:14:56 +000048The default tool chain (named MYTOOLS) is pre-configured to use VS2005 for IA32
49and X64 target architectures and the DDK for IPF target architectures. To use a
50different 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
55tool chain tag name: build -t VS2003 ... , for example. Using this method will
56require that you always use the build command's -t option.
57
58
59Next, go to the module directory and begin to build. This example is for the
60HelloWorld application.
61
vanjeffe4d8dbc2007-06-25 11:16:31 +000062 c:\MyWork\edk2\> cd MdeModulePkg\Application\HelloWorld
63 c:\MyWork\edk2\> build
64
lhauch1f4c44a2008-05-15 16:14:56 +000065If you want to build the a module in another package (for example,
66MdePkg\Library\BaseLib\BaseLib.inf), please edit the file,
67%WORKSPACE%\Conf\Target.txt, first.
vanjeffe4d8dbc2007-06-25 11:16:31 +000068
lhauch1f4c44a2008-05-15 16:14:56 +000069Change the following line
vanjeffe4d8dbc2007-06-25 11:16:31 +000070 ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
71to
72 ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
73
lhauch1f4c44a2008-05-15 16:14:56 +000074Then go to MdePkg\Library\BaseLib directory and type build:
vanjeffe4d8dbc2007-06-25 11:16:31 +000075 c:\MyWork\edk2\> cd MdePkg\Library\BaseLib
76 c:\MyWork\edk2\> build
77
lhauch1f4c44a2008-05-15 16:14:56 +000078If you want build a platform, ACTIVE_PLATFORM must be set to your desired
79platform dsc file, go to directory which must be not a module's directory, and
80run "build" command.
jwang3611dd6c32007-06-27 02:16:16 +000081
lhauch1f4c44a2008-05-15 16:14:56 +000082Instead of changing Target.txt, you can specify platform, module and/or
83architecture on command line.
jwang36183bc302007-07-19 01:43:29 +000084For example, if you want to build NT32 platform, you can just type
85
lhauch1f4c44a2008-05-15 16:14:56 +000086 c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32
jwang36183bc302007-07-19 01:43:29 +000087
88and if you want to build HelloWorld module, you can just type
89
lhauch1f4c44a2008-05-15 16:14:56 +000090 c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32 -m MdeModulePkg\Application\HelloWorld\HelloWorld.inf
jwang36183bc302007-07-19 01:43:29 +000091
lhauch1f4c44a2008-05-15 16:14:56 +000092Other helpful command line options of build tool include "-v" and "-d".
93The "-v" option is used to turn on the verbose build, which provide more
94information during the build. "-d <debug level 0-9>" option is used to
jwang36183bc302007-07-19 01:43:29 +000095turn on the debug information which is helpful debugging build tools.
96
lhauch1f4c44a2008-05-15 16:14:56 +000097For more information on build options, please try "build -h" on command line.
98
99Note:
100 The Windows style help option "/?" is not a valid option for the build
101 command.
jwang36183bc302007-07-19 01:43:29 +0000102
103
104-------------------------------------------------------------------------------
105Supported build targets
106-----------------------
107
jwang360c71bc32007-09-03 06:11:35 +0000108all - Build whole platform or module. It can be ignored.
109genc - Generate AutoGen.c, AutoGen.h and <ModuleName>.depex files only.
110genmake - Generate makefiles in addition to files generated by "genc" target.
jwang36183bc302007-07-19 01:43:29 +0000111clean - Clean intermediate files
lhauch1f4c44a2008-05-15 16:14:56 +0000112cleanall - Clean all generated files and directories during build, except the
113 generated Makefile files (top level and module makefiles)
jwang36183bc302007-07-19 01:43:29 +0000114cleanlib - Clean all generated files and directories during library build
jwang360c71bc32007-09-03 06:11:35 +0000115run - Launch NT32 shell (only valid for NT32 platform)
jwang36183bc302007-07-19 01:43:29 +0000116
jwang3611dd6c32007-06-27 02:16:16 +0000117-------------------------------------------------------------------------------
118Tools in Python
119---------------
120
121* Run buld tool written in Python from source
lhauch1f4c44a2008-05-15 16:14:56 +0000122 The build tool written in Python can be executed from its source directly as
123 long as you have the Python interpreter (version 2.5) installed. The source
124 of Python code is locating at:
jwang3611dd6c32007-06-27 02:16:16 +0000125
qhuang8caf30462010-03-31 16:25:38 +0000126 http://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools
jwang3611dd6c32007-06-27 02:16:16 +0000127
lhauch1f4c44a2008-05-15 16:14:56 +0000128 where:
jwang3611dd6c32007-06-27 02:16:16 +0000129
lhauch1f4c44a2008-05-15 16:14:56 +0000130 build/build.py - The entry tool of build tools
jwang3611dd6c32007-06-27 02:16:16 +0000131
lhauch1f4c44a2008-05-15 16:14:56 +0000132 "build.py" steps:
133 1. Run "edksetup.bat"
134 2. set PYTHONPATH to the local directory of above source
135 (BaseTools/Source/Python)
136 3. Set ACTIVE_PLATFORM in WORKSPACE\Conf
137 4. Go to platform or module directory
138 5. Run "<python_interpreter.exe> <python_source_dir>/build/build.py" or
139 "<python_source_dir>/build/build.py" directly.
jwang3611dd6c32007-06-27 02:16:16 +0000140
jwang3611dd6c32007-06-27 02:16:16 +0000141* Convert Python source to exe file
lhauch1f4c44a2008-05-15 16:14:56 +0000142 The tools written in Python can be coverted into executable program which can
143 be executed without Python interpreter. One of the conversion tools is called
144 cx_Freeze, available at:
jwang3611dd6c32007-06-27 02:16:16 +0000145
lhauch1f4c44a2008-05-15 16:14:56 +0000146 http://sourceforge.net/projects/cx-freeze/
jwang3611dd6c32007-06-27 02:16:16 +0000147
lhauch1f4c44a2008-05-15 16:14:56 +0000148 If you have installed cx_Freeze at c:\cx_Freeze-3.0.3. Use the following
149 command lines to convert MyBuild.py to a Windows executable.
jwang3611dd6c32007-06-27 02:16:16 +0000150
jwang360c71bc32007-09-03 06:11:35 +0000151 set PYTHONPATH=<buildtools>\BaseTools\Source\Python
lhauch1f4c44a2008-05-15 16:14:56 +0000152 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 +0000153
lhauch1f4c44a2008-05-15 16:14:56 +0000154 The generated .exe files are put in "mybuild" subdirectory.
vanjeffe4d8dbc2007-06-25 11:16:31 +0000155