]> git.proxmox.com Git - mirror_edk2.git/blob - BuildNotes2.txt
1. enable /GL optimization building on OpensslLib.
[mirror_edk2.git] / BuildNotes2.txt
1 Intel(R) Platform Innovation Framework for EFI
2 EFI Development Kit II (EDK II)
3 2010-03-31
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.
8 Copyright (c) 2007 - 2010, Intel Corporation All rights reserved.
9
10 EDK II packages can be checked out from the following SVN address:
11 http://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2
12
13 The detailed introduction of these packages can be found in each package
14 description file. (The *.dec file under the package directory)
15
16
17 -------------------------------------------------------------------------------
18 The most recent version of the setup instructions is available on the EDK II
19 web-site:
20 http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=Step-by-step_instructions
21
22
23 -------------------------------------------------------------------------------
24 Quick Start (Windows Development Platform)
25 -----------
26
27 In a command prompt window, change to the top-level directory of the EDK II
28 source.
29
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.
45
46 c:\MyWork\edk2\> edksetup --nt32
47
48 The default tool chain (named MYTOOLS) is pre-configured to use VS2005 for IA32
49 and X64 target architectures and the DDK for IPF target architectures. To use a
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
55 tool chain tag name: build -t VS2003 ... , for example. Using this method will
56 require that you always use the build command's -t option.
57
58
59 Next, go to the module directory and begin to build. This example is for the
60 HelloWorld application.
61
62 c:\MyWork\edk2\> cd MdeModulePkg\Application\HelloWorld
63 c:\MyWork\edk2\> build
64
65 If you want to build the a module in another package (for example,
66 MdePkg\Library\BaseLib\BaseLib.inf), please edit the file,
67 %WORKSPACE%\Conf\Target.txt, first.
68
69 Change the following line
70 ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
71 to
72 ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
73
74 Then go to MdePkg\Library\BaseLib directory and type build:
75 c:\MyWork\edk2\> cd MdePkg\Library\BaseLib
76 c:\MyWork\edk2\> build
77
78 If you want build a platform, ACTIVE_PLATFORM must be set to your desired
79 platform dsc file, go to directory which must be not a module's directory, and
80 run "build" command.
81
82 Instead of changing Target.txt, you can specify platform, module and/or
83 architecture on command line.
84 For example, if you want to build NT32 platform, you can just type
85
86 c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32
87
88 and if you want to build HelloWorld module, you can just type
89
90 c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32 -m MdeModulePkg\Application\HelloWorld\HelloWorld.inf
91
92 Other helpful command line options of build tool include "-v" and "-d".
93 The "-v" option is used to turn on the verbose build, which provide more
94 information during the build. "-d <debug level 0-9>" option is used to
95 turn on the debug information which is helpful debugging build tools.
96
97 For more information on build options, please try "build -h" on command line.
98
99 Note:
100 The Windows style help option "/?" is not a valid option for the build
101 command.
102
103
104 -------------------------------------------------------------------------------
105 Supported build targets
106 -----------------------
107
108 all - Build whole platform or module. It can be ignored.
109 genc - Generate AutoGen.c, AutoGen.h and <ModuleName>.depex files only.
110 genmake - Generate makefiles in addition to files generated by "genc" target.
111 clean - Clean intermediate files
112 cleanall - Clean all generated files and directories during build, except the
113 generated Makefile files (top level and module makefiles)
114 cleanlib - Clean all generated files and directories during library build
115 run - Launch NT32 shell (only valid for NT32 platform)
116
117 -------------------------------------------------------------------------------
118 Tools in Python
119 ---------------
120
121 * Run buld tool written in Python from source
122 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:
125
126 http://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools
127
128 where:
129
130 build/build.py - The entry tool of build tools
131
132 "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.
140
141 * Convert Python source to exe file
142 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:
145
146 http://sourceforge.net/projects/cx-freeze/
147
148 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.
150
151 set PYTHONPATH=<buildtools>\BaseTools\Source\Python
152 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
153
154 The generated .exe files are put in "mybuild" subdirectory.
155