vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 1 | Intel(R) Platform Innovation Framework for EFI
|
jcarsey | a64823f | 2008-09-25 23:13:48 +0000 | [diff] [blame] | 2 | EFI Development Kit II (EDK II)
|
lgao4 | e5b317d | 2011-12-14 06:15:48 +0000 | [diff] [blame] | 3 | 2011-12-14
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 4 |
|
| 5 | Intel is a trademark or registered trademark of Intel Corporation or its
|
| 6 | subsidiaries in the United States and other countries.
|
| 7 | * Other names and brands may be claimed as the property of others.
|
lgao4 | e5b317d | 2011-12-14 06:15:48 +0000 | [diff] [blame] | 8 | Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 9 |
|
qhuang8 | caf3046 | 2010-03-31 16:25:38 +0000 | [diff] [blame] | 10 | EDK II packages can be checked out from the following SVN address:
|
| 11 | http://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 12 |
|
qhuang8 | caf3046 | 2010-03-31 16:25:38 +0000 | [diff] [blame] | 13 | The detailed introduction of these packages can be found in each package
|
| 14 | description file. (The *.dec file under the package directory)
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 15 |
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 16 |
|
| 17 | -------------------------------------------------------------------------------
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 18 | The most recent version of the setup instructions is available on the EDK II
|
| 19 | web-site:
|
qhuang8 | caf3046 | 2010-03-31 16:25:38 +0000 | [diff] [blame] | 20 | http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=Step-by-step_instructions
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 21 |
|
| 22 |
|
| 23 | -------------------------------------------------------------------------------
|
| 24 | Quick Start (Windows Development Platform)
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 25 | -----------
|
| 26 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 27 | In a command prompt window, change to the top-level directory of the EDK II
|
| 28 | source.
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 29 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 30 | Note:
|
| 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 |
|
| 36 | First, set up your project workspace. If you have previously initialized this
|
| 37 | WORKSPACE, and a newer version of the *.template files in
|
| 38 | WORKSPACE\BaseTools\Conf exists, remove the *.txt files in the WORKSPACE\Conf
|
| 39 | directory prior to running the edksetup script.
|
| 40 |
|
| 41 | For the reference build of the Nt32 Platform emulation environment, use the
|
| 42 | edksetup.bat option: --nt32. For building other platforms or modules, this
|
| 43 | option is not required, as Visual Studio standard includes, libraries and/or
|
| 44 | dlls are not required for normal development.
|
lhauch | 8014e7c | 2008-02-22 16:31:23 +0000 | [diff] [blame] | 45 |
|
| 46 | c:\MyWork\edk2\> edksetup --nt32
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 47 |
|
lgao4 | e5b317d | 2011-12-14 06:15:48 +0000 | [diff] [blame] | 48 | The default tool chain (named MYTOOLS) is pre-configured to use VS2008 for IA32
|
| 49 | and X64 target architectures and DDK3790 for IPF target architectures. To use a
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 50 | different tool chain, either modify the tools_def.txt file's MYTOOLS entries,
|
| 51 | or modify the %WORKSPACE%\Conf\target.txt file's TOOL_CHAIN_TAG. The pre-defined
|
| 52 | tags are listed near the top of the %WORKSPACE%\Conf\tools_def.txt file, below
|
| 53 | the Supported Tool Chains comment.
|
| 54 | Alternatively, you may use the build command's -t option to specify a different
|
lgao4 | e5b317d | 2011-12-14 06:15:48 +0000 | [diff] [blame] | 55 | tool chain tag name: build -t VS2008 ... , for example. Using this method will
|
| 56 | require that you always use the build command's -t option. If you use 64-bit
|
| 57 | windows OS, you should use tool chain tag name with x86, such as VS2008x86.
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 58 |
|
| 59 |
|
| 60 | Next, go to the module directory and begin to build. This example is for the
|
| 61 | HelloWorld application.
|
| 62 |
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 63 | c:\MyWork\edk2\> cd MdeModulePkg\Application\HelloWorld
|
| 64 | c:\MyWork\edk2\> build
|
| 65 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 66 | If you want to build the a module in another package (for example,
|
| 67 | MdePkg\Library\BaseLib\BaseLib.inf), please edit the file,
|
| 68 | %WORKSPACE%\Conf\Target.txt, first.
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 69 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 70 | Change the following line
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 71 | ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
|
| 72 | to
|
| 73 | ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
|
| 74 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 75 | Then go to MdePkg\Library\BaseLib directory and type build:
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 76 | c:\MyWork\edk2\> cd MdePkg\Library\BaseLib
|
| 77 | c:\MyWork\edk2\> build
|
| 78 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 79 | If you want build a platform, ACTIVE_PLATFORM must be set to your desired
|
| 80 | platform dsc file, go to directory which must be not a module's directory, and
|
| 81 | run "build" command.
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 82 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 83 | Instead of changing Target.txt, you can specify platform, module and/or
|
| 84 | architecture on command line.
|
jwang36 | 183bc30 | 2007-07-19 01:43:29 +0000 | [diff] [blame] | 85 | For example, if you want to build NT32 platform, you can just type
|
| 86 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 87 | c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32
|
jwang36 | 183bc30 | 2007-07-19 01:43:29 +0000 | [diff] [blame] | 88 |
|
| 89 | and if you want to build HelloWorld module, you can just type
|
| 90 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 91 | c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32 -m MdeModulePkg\Application\HelloWorld\HelloWorld.inf
|
jwang36 | 183bc30 | 2007-07-19 01:43:29 +0000 | [diff] [blame] | 92 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 93 | Other helpful command line options of build tool include "-v" and "-d".
|
| 94 | The "-v" option is used to turn on the verbose build, which provide more
|
| 95 | information during the build. "-d <debug level 0-9>" option is used to
|
jwang36 | 183bc30 | 2007-07-19 01:43:29 +0000 | [diff] [blame] | 96 | turn on the debug information which is helpful debugging build tools.
|
| 97 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 98 | For more information on build options, please try "build -h" on command line.
|
| 99 |
|
| 100 | Note:
|
| 101 | The Windows style help option "/?" is not a valid option for the build
|
| 102 | command.
|
jwang36 | 183bc30 | 2007-07-19 01:43:29 +0000 | [diff] [blame] | 103 |
|
| 104 |
|
| 105 | -------------------------------------------------------------------------------
|
| 106 | Supported build targets
|
| 107 | -----------------------
|
| 108 |
|
jwang36 | 0c71bc3 | 2007-09-03 06:11:35 +0000 | [diff] [blame] | 109 | all - Build whole platform or module. It can be ignored.
|
| 110 | genc - Generate AutoGen.c, AutoGen.h and <ModuleName>.depex files only.
|
| 111 | genmake - Generate makefiles in addition to files generated by "genc" target.
|
jwang36 | 183bc30 | 2007-07-19 01:43:29 +0000 | [diff] [blame] | 112 | clean - Clean intermediate files
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 113 | cleanall - Clean all generated files and directories during build, except the
|
| 114 | generated Makefile files (top level and module makefiles)
|
jwang36 | 183bc30 | 2007-07-19 01:43:29 +0000 | [diff] [blame] | 115 | cleanlib - Clean all generated files and directories during library build
|
jwang36 | 0c71bc3 | 2007-09-03 06:11:35 +0000 | [diff] [blame] | 116 | run - Launch NT32 shell (only valid for NT32 platform)
|
jwang36 | 183bc30 | 2007-07-19 01:43:29 +0000 | [diff] [blame] | 117 |
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 118 | -------------------------------------------------------------------------------
|
| 119 | Tools in Python
|
| 120 | ---------------
|
| 121 |
|
| 122 | * Run buld tool written in Python from source
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 123 | The build tool written in Python can be executed from its source directly as
|
lgao4 | e5b317d | 2011-12-14 06:15:48 +0000 | [diff] [blame] | 124 | long as you have the Python interpreter (version 2.5.4) installed. The source
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 125 | of Python code is locating at:
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 126 |
|
qhuang8 | caf3046 | 2010-03-31 16:25:38 +0000 | [diff] [blame] | 127 | http://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 128 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 129 | where:
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 130 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 131 | build/build.py - The entry tool of build tools
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 132 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 133 | "build.py" steps:
|
| 134 | 1. Run "edksetup.bat"
|
| 135 | 2. set PYTHONPATH to the local directory of above source
|
| 136 | (BaseTools/Source/Python)
|
| 137 | 3. Set ACTIVE_PLATFORM in WORKSPACE\Conf
|
| 138 | 4. Go to platform or module directory
|
| 139 | 5. Run "<python_interpreter.exe> <python_source_dir>/build/build.py" or
|
| 140 | "<python_source_dir>/build/build.py" directly.
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 141 |
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 142 | * Convert Python source to exe file
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 143 | The tools written in Python can be coverted into executable program which can
|
| 144 | be executed without Python interpreter. One of the conversion tools is called
|
| 145 | cx_Freeze, available at:
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 146 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 147 | http://sourceforge.net/projects/cx-freeze/
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 148 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 149 | If you have installed cx_Freeze at c:\cx_Freeze-3.0.3. Use the following
|
| 150 | command lines to convert MyBuild.py to a Windows executable.
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 151 |
|
jwang36 | 0c71bc3 | 2007-09-03 06:11:35 +0000 | [diff] [blame] | 152 | set PYTHONPATH=<buildtools>\BaseTools\Source\Python
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 153 | 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
|
jwang36 | 11dd6c3 | 2007-06-27 02:16:16 +0000 | [diff] [blame] | 154 |
|
lhauch | 1f4c44a | 2008-05-15 16:14:56 +0000 | [diff] [blame] | 155 | The generated .exe files are put in "mybuild" subdirectory.
|
vanjeff | e4d8dbc | 2007-06-25 11:16:31 +0000 | [diff] [blame] | 156 |
|