BuildNotes2.txt 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. Intel(R) Platform Innovation Framework for EFI
  2. EFI Development Kit II (EDK II)
  3. 2011-12-14
  4. Intel is a trademark or registered trademark of Intel Corporation or its
  5. subsidiaries in the United States and other countries.
  6. * Other names and brands may be claimed as the property of others.
  7. Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
  8. EDK II packages can be gathered from the following address:
  9. https://github.com/tianocore/edk2.git
  10. The detailed introduction of these packages can be found in each package
  11. description file. (The *.dec file under the package directory)
  12. -------------------------------------------------------------------------------
  13. The most recent version of the setup instructions is available on the EDK II
  14. web-site:
  15. https://github.com/tianocore/tianocore.github.io/wiki/Getting%20Started%20with%20EDK%20II
  16. -------------------------------------------------------------------------------
  17. Quick Start (Windows Development Platform)
  18. -----------
  19. In a command prompt window, change to the top-level directory of the EDK II
  20. source.
  21. Note:
  22. The first time the edksetup script is executed, it creates three files in the
  23. %WORKSPACE%\Conf directory. The files: tools_def.txt, target.txt and
  24. build_rule.txt, are only created if they do not exist, if they exist, they
  25. are not touched.
  26. First, set up your project workspace. If you have previously initialized this
  27. WORKSPACE, and a newer version of the *.template files in
  28. WORKSPACE\BaseTools\Conf exists, remove the *.txt files in the WORKSPACE\Conf
  29. directory prior to running the edksetup script.
  30. For the reference build of the Nt32 Platform emulation environment, use the
  31. edksetup.bat option: --nt32. For building other platforms or modules, this
  32. option is not required, as Visual Studio standard includes, libraries and/or
  33. dlls are not required for normal development.
  34. c:\MyWork\edk2\> edksetup --nt32
  35. The default tool chain (named MYTOOLS) is pre-configured to use VS2008 for IA32
  36. and X64 target architectures and DDK3790 for IPF target architectures. To use a
  37. different tool chain, either modify the tools_def.txt file's MYTOOLS entries,
  38. or modify the %WORKSPACE%\Conf\target.txt file's TOOL_CHAIN_TAG. The pre-defined
  39. tags are listed near the top of the %WORKSPACE%\Conf\tools_def.txt file, below
  40. the Supported Tool Chains comment.
  41. Alternatively, you may use the build command's -t option to specify a different
  42. tool chain tag name: build -t VS2008 ... , for example. Using this method will
  43. require that you always use the build command's -t option. If you use 64-bit
  44. Windows OS, you should use tool chain tag name with x86, such as VS2008x86.
  45. Next, go to the module directory and begin to build. This example is for the
  46. HelloWorld application.
  47. c:\MyWork\edk2\> cd MdeModulePkg\Application\HelloWorld
  48. c:\MyWork\edk2\> build
  49. If you want to build the a module in another package (for example,
  50. MdePkg\Library\BaseLib\BaseLib.inf), please edit the file
  51. %WORKSPACE%\Conf\Target.txt first.
  52. Change the following line
  53. ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
  54. to
  55. ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
  56. Then go to MdePkg\Library\BaseLib directory and type build:
  57. c:\MyWork\edk2\> cd MdePkg\Library\BaseLib
  58. c:\MyWork\edk2\> build
  59. If you want build a platform, ACTIVE_PLATFORM must be set to your desired
  60. platform dsc file, go to directory which must be not a module's directory, and
  61. run "build" command.
  62. Instead of changing Target.txt, you can specify platform, module and/or
  63. architecture on command line.
  64. For example, if you want to build NT32 platform, you can just type
  65. c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32
  66. and if you want to build HelloWorld module, you can just type
  67. c:\MyWork\edk2\> build -p Nt32Pkg\Nt32Pkg.dsc -a IA32 -m MdeModulePkg\Application\HelloWorld\HelloWorld.inf
  68. Other helpful command line options of build tool include "-v" and "-d".
  69. The "-v" option is used to turn on the verbose build, which provide more
  70. information during the build. "-d <debug level 0-9>" option is used to
  71. turn on the debug information which is helpful debugging build tools.
  72. For more information on build options, please try "build -h" on command line.
  73. Note:
  74. The Windows style help option "/?" is not a valid option for the build
  75. command.
  76. -------------------------------------------------------------------------------
  77. Supported build targets
  78. -----------------------
  79. all - Build whole platform or module. It can be ignored.
  80. genc - Generate AutoGen.c, AutoGen.h and <ModuleName>.depex files only.
  81. genmake - Generate makefiles in addition to files generated by "genc" target.
  82. clean - Clean intermediate files
  83. cleanall - Clean all generated files and directories during build, except the
  84. generated Makefile files (top level and module makefiles)
  85. cleanlib - Clean all generated files and directories during library build
  86. run - Launch NT32 shell (only valid for NT32 platform)
  87. -------------------------------------------------------------------------------
  88. Tools in Python
  89. ---------------
  90. * Run build tool written in Python from source
  91. It can be executed from its source directly as long as you have the Python
  92. interpreter (version 2.5.4) installed. The source code is located at
  93. WORKSPACE/BaseTools.
  94. where:
  95. build/build.py - The entry tool of build tools
  96. "build.py" steps:
  97. 1. Run "edksetup.bat"
  98. 2. set PYTHONPATH to the local directory of above source
  99. (BaseTools/Source/Python)
  100. 3. Set ACTIVE_PLATFORM in WORKSPACE\Conf
  101. 4. Go to platform or module directory
  102. 5. Run "<python_interpreter.exe> <python_source_dir>/build/build.py" or
  103. "<python_source_dir>/build/build.py" directly.
  104. * Convert Python source to exe file
  105. The tools written in Python can be converted into executable program which can
  106. be executed without Python interpreter. One of the conversion tools is called
  107. cx_Freeze, available at:
  108. http://sourceforge.net/projects/cx-freeze/
  109. If you have installed cx_Freeze at c:\cx_Freeze-3.0.3. Use the following
  110. command lines to convert MyBuild.py to a Windows executable.
  111. set PYTHONPATH=<buildtools>\BaseTools\Source\Python
  112. 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
  113. The generated .exe files are put in "mybuild" subdirectory.