build.ck 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*++
  2. Copyright (c) 2014 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. Architecture Support
  9. Abstract:
  10. This module contains architecure-specific UEFI core support functions.
  11. Author:
  12. Evan Green 27-Mar-2014
  13. Environment:
  14. Firmware
  15. --*/
  16. from menv import mconfig, kernelLibrary;
  17. function build() {
  18. var arch = mconfig.arch;
  19. var armSources;
  20. var armv6Sources;
  21. var armv7Sources;
  22. var entries;
  23. var includes;
  24. var lib;
  25. var sources;
  26. var sourcesConfig;
  27. var x64Sources;
  28. var x86Sources;
  29. x64Sources = [
  30. "x64/archsup.S",
  31. "x64/ioport.S",
  32. "x86/archlib.c",
  33. "x86/regacces.c"
  34. ];
  35. x86Sources = [
  36. "x86/archlib.c",
  37. "x86/archsup.S",
  38. "x86/ioport.S",
  39. "x86/regacces.c"
  40. ];
  41. armSources = [
  42. "armv7/archlib.c",
  43. "armv7/regacces.c"
  44. ];
  45. armv7Sources = armSources + [
  46. "armv7/archsup.S"
  47. ];
  48. armv6Sources = armSources + [
  49. "armv6/archsup.S"
  50. ];
  51. if (arch == "armv7") {
  52. sources = armv7Sources;
  53. } else if (arch == "armv6") {
  54. sources = armv6Sources;
  55. } else if (arch == "x86") {
  56. sources = x86Sources;
  57. } else if (arch == "x64") {
  58. sources = x64Sources;
  59. } else {
  60. Core.raise(ValueError("Unknown Architecture"));
  61. }
  62. includes = [
  63. "$S/uefi/include",
  64. "$S/uefi/core"
  65. ];
  66. sourcesConfig = {
  67. "CFLAGS": ["-fshort-wchar"],
  68. };
  69. lib = {
  70. "label": "uefiarch",
  71. "inputs": sources,
  72. "sources_config": sourcesConfig,
  73. "includes": includes
  74. };
  75. entries = kernelLibrary(lib);
  76. return entries;
  77. }