BUILD 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. load("//sys/src/FLAGS", "LIB_COMPILER_FLAGS")
  2. load("//sys/src/ARCHS", "ARCHS")
  3. [mk_sys(
  4. name="boot%scpuc" % arch,
  5. mode="boot%scpu.c" % arch,
  6. arch=arch,
  7. sysconf="//sys/src/sysconf.json",
  8. ) for arch in ARCHS]
  9. [data_to_c(
  10. name="%scpu" % arch,
  11. bin="bin/boot%scpu" %arch,
  12. prefix= "ramfs_boot%scpu_" % arch,
  13. deps=[
  14. ":boot%scpu" % arch,
  15. ]
  16. ) for arch in ARCHS]
  17. cc_library(
  18. name="libboot",
  19. copts=[
  20. "-g",
  21. "-Wall",
  22. "-Wno-missing-braces",
  23. "-Wno-parentheses",
  24. "-Wno-unknown-pragmas",
  25. "-O0",
  26. "-static",
  27. "-mno-red-zone",
  28. "-ffreestanding",
  29. "-fno-builtin",
  30. "-mcmodel=small"
  31. ],
  32. includes=[
  33. "//sys/include",
  34. "//sys/src/9/boot",
  35. fmt("//%s/include", env("ARCH")),
  36. ],
  37. deps=[
  38. fmt(":boot%scpuc", env("ARCH")),
  39. ],
  40. srcs=[
  41. "aux.c",
  42. "bootauth.c",
  43. "boot.c",
  44. "bootcache.c",
  45. "bootip.c",
  46. fmt("boot%scpu.c", env("ARCH")),
  47. "bootrc.c",
  48. "embed.c",
  49. "local.c",
  50. "paq.c",
  51. "sac.c",
  52. "settime.c"
  53. ]
  54. )
  55. [cc_binary(
  56. name="boot%scpu" % arch,
  57. copts=LIB_COMPILER_FLAGS,
  58. includes=[
  59. "//sys/include",
  60. "//sys/src/9/boot",
  61. "//%s/include" % arch,
  62. ],
  63. srcs=[
  64. "printstub.c",
  65. "boot%scpu.c" % arch,
  66. ],
  67. deps=[
  68. ":libboot",
  69. ":boot%scpuc" % arch,
  70. "//sys/src/libip:libip",
  71. "//sys/src/libauth:libauth",
  72. "//sys/src/libc:libc"
  73. ],
  74. linkopts=[
  75. "-e_main",
  76. "-static"
  77. ]
  78. ) for arch in ARCHS]