您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Makefile 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. ###############################################################################
  2. #
  3. # Initialise various variables
  4. #
  5. CLEANUP :=
  6. CFLAGS :=
  7. ASFLAGS :=
  8. LDFLAGS :=
  9. HOST_CFLAGS :=
  10. MAKEDEPS := Makefile
  11. CROSS_COMPILE ?= $(CROSS)
  12. ###############################################################################
  13. #
  14. # Locations of tools
  15. #
  16. HOST_CC := gcc
  17. RM := rm -f
  18. TOUCH := touch
  19. MKDIR := mkdir
  20. CP := cp
  21. ECHO := echo
  22. PRINTF := printf
  23. PERL := perl
  24. TRUE := true
  25. CC := $(CROSS_COMPILE)gcc
  26. CPP := $(CC) -E
  27. AS := $(CROSS_COMPILE)as
  28. LD := $(CROSS_COMPILE)ld
  29. SIZE := $(CROSS_COMPILE)size
  30. AR := $(CROSS_COMPILE)ar
  31. RANLIB := $(CROSS_COMPILE)ranlib
  32. OBJCOPY := $(CROSS_COMPILE)objcopy
  33. NM := $(CROSS_COMPILE)nm
  34. OBJDUMP := $(CROSS_COMPILE)objdump
  35. OPENSSL := openssl
  36. CSPLIT := csplit
  37. PARSEROM := ./util/parserom.pl
  38. FIXROM := ./util/fixrom.pl
  39. SYMCHECK := ./util/symcheck.pl
  40. SORTOBJDUMP := ./util/sortobjdump.pl
  41. PADIMG := ./util/padimg.pl
  42. LICENCE := ./util/licence.pl
  43. NRV2B := ./util/nrv2b
  44. ZBIN := ./util/zbin
  45. ELF2EFI32 := ./util/elf2efi32
  46. ELF2EFI64 := ./util/elf2efi64
  47. EFIROM := ./util/efirom
  48. EFIFATBIN := ./util/efifatbin
  49. ICCFIX := ./util/iccfix
  50. EINFO := ./util/einfo
  51. GENKEYMAP := ./util/genkeymap.pl
  52. DOXYGEN := doxygen
  53. LCAB := lcab
  54. QEMUIMG := qemu-img
  55. ###############################################################################
  56. #
  57. # SRCDIRS lists all directories containing source files.
  58. #
  59. SRCDIRS :=
  60. SRCDIRS += libgcc
  61. SRCDIRS += core
  62. SRCDIRS += net net/oncrpc net/tcp net/udp net/infiniband net/80211
  63. SRCDIRS += image
  64. SRCDIRS += drivers/bus
  65. SRCDIRS += drivers/net
  66. SRCDIRS += drivers/net/e1000
  67. SRCDIRS += drivers/net/e1000e
  68. SRCDIRS += drivers/net/igb
  69. SRCDIRS += drivers/net/igbvf
  70. SRCDIRS += drivers/net/phantom
  71. SRCDIRS += drivers/net/rtl818x
  72. SRCDIRS += drivers/net/ath
  73. SRCDIRS += drivers/net/ath/ath5k
  74. SRCDIRS += drivers/net/ath/ath9k
  75. SRCDIRS += drivers/net/vxge
  76. SRCDIRS += drivers/net/efi
  77. SRCDIRS += drivers/net/tg3
  78. SRCDIRS += drivers/net/sfc
  79. SRCDIRS += drivers/block
  80. SRCDIRS += drivers/nvs
  81. SRCDIRS += drivers/bitbash
  82. SRCDIRS += drivers/infiniband
  83. SRCDIRS += drivers/infiniband/mlx_utils_flexboot/src
  84. SRCDIRS += drivers/infiniband/mlx_utils/src/public
  85. SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_reg_access
  86. SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_nvconfig
  87. SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_vmac
  88. SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_blink_leds
  89. SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_link_speed
  90. SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_mtu
  91. SRCDIRS += drivers/infiniband/mlx_nodnic/src
  92. SRCDIRS += drivers/usb
  93. SRCDIRS += interface/pxe interface/efi interface/smbios
  94. SRCDIRS += interface/bofm
  95. SRCDIRS += interface/xen
  96. SRCDIRS += interface/hyperv
  97. SRCDIRS += tests
  98. SRCDIRS += crypto crypto/mishmash
  99. SRCDIRS += hci hci/commands hci/tui
  100. SRCDIRS += hci/mucurses hci/mucurses/widgets
  101. SRCDIRS += hci/keymap
  102. SRCDIRS += usr
  103. SRCDIRS += config
  104. # NON_AUTO_SRCS lists files that are excluded from the normal
  105. # automatic build system.
  106. #
  107. NON_AUTO_SRCS :=
  108. NON_AUTO_SRCS += core/version.c
  109. NON_AUTO_SRCS += drivers/net/prism2.c
  110. # INCDIRS lists the include path
  111. #
  112. INCDIRS :=
  113. INCDIRS += include .
  114. ###############################################################################
  115. #
  116. # Default build target: build the most common targets and print out a
  117. # helpfully suggestive message
  118. #
  119. ALL := bin/blib.a bin/ipxe.dsk bin/ipxe.lkrn bin/ipxe.iso \
  120. bin/ipxe.usb bin/ipxe.pxe bin/undionly.kpxe bin/rtl8139.rom \
  121. bin/8086100e.mrom bin/80861209.rom bin/10500940.rom \
  122. bin/10222000.rom bin/10ec8139.rom bin/1af41000.rom \
  123. bin/8086100f.mrom bin/808610d3.mrom bin/15ad07b0.rom
  124. all : $(ALL)
  125. @$(ECHO) '==========================================================='
  126. @$(ECHO)
  127. @$(ECHO) 'To create a bootable floppy, type'
  128. @$(ECHO) ' cat bin/ipxe.dsk > /dev/fd0'
  129. @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
  130. @$(ECHO) 'data already on the disk.'
  131. @$(ECHO)
  132. @$(ECHO) 'To create a bootable USB key, type'
  133. @$(ECHO) ' cat bin/ipxe.usb > /dev/sdX'
  134. @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
  135. @$(ECHO) 'disk on your system. This will erase any data already on'
  136. @$(ECHO) 'the USB key.'
  137. @$(ECHO)
  138. @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
  139. @$(ECHO) 'bin/ipxe.iso to a blank CD-ROM.'
  140. @$(ECHO)
  141. @$(ECHO) 'These images contain drivers for all supported cards. You'
  142. @$(ECHO) 'can build more customised images, and ROM images, using'
  143. @$(ECHO) ' make bin/<rom-name>.<output-format>'
  144. @$(ECHO)
  145. @$(ECHO) '==========================================================='
  146. ###############################################################################
  147. #
  148. # Comprehensive build target: build a selection of cross-platform
  149. # targets to expose potential build errors that show up only on
  150. # certain platforms
  151. #
  152. everything :
  153. $(Q)$(MAKE) --no-print-directory $(ALL) \
  154. bin/3c509.rom bin/intel.rom bin/intel.mrom \
  155. bin-x86_64-pcbios/8086100e.mrom bin-x86_64-pcbios/intel.rom \
  156. bin-x86_64-pcbios/ipxe.usb bin-x86_64-pcbios/ipxe.pxe \
  157. bin-x86_64-pcbios/undionly.kpxe \
  158. bin-i386-efi/ipxe.efi bin-i386-efi/ipxe.efidrv \
  159. bin-i386-efi/ipxe.efirom \
  160. bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe.efidrv \
  161. bin-x86_64-efi/ipxe.efirom \
  162. bin-i386-linux/tap.linux bin-x86_64-linux/tap.linux \
  163. bin-i386-linux/tests.linux bin-x86_64-linux/tests.linux
  164. ###############################################################################
  165. #
  166. # VMware build target: all ROMs used with VMware
  167. #
  168. vmware : bin/8086100f.mrom bin/808610d3.mrom bin/10222000.rom bin/15ad07b0.rom
  169. @$(ECHO) '==========================================================='
  170. @$(ECHO)
  171. @$(ECHO) 'Available ROMs:'
  172. @$(ECHO) ' bin/8086100f.mrom -- intel/e1000'
  173. @$(ECHO) ' bin/808610d3.mrom -- intel/e1000e'
  174. @$(ECHO) ' bin/10222000.rom -- vlance/pcnet32'
  175. @$(ECHO) ' bin/15ad07b0.rom -- vmxnet3'
  176. @$(ECHO)
  177. @$(ECHO) 'For more information, see http://ipxe.org/howto/vmware'
  178. @$(ECHO)
  179. @$(ECHO) '==========================================================='
  180. ###############################################################################
  181. #
  182. # Build targets that do nothing but might be tried by users
  183. #
  184. configure :
  185. @$(ECHO) "No configuration needed."
  186. install :
  187. @$(ECHO) "No installation required."
  188. ###############################################################################
  189. #
  190. # Version number calculations
  191. #
  192. VERSION_MAJOR = 1
  193. VERSION_MINOR = 0
  194. VERSION_PATCH = 0
  195. EXTRAVERSION = +
  196. MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
  197. VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
  198. ifneq ($(wildcard ../.git),)
  199. GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
  200. VERSION += ($(GITVERSION))
  201. endif
  202. version :
  203. @$(ECHO) "$(VERSION)"
  204. ###############################################################################
  205. #
  206. # Drag in the bulk of the build system
  207. #
  208. MAKEDEPS += Makefile.housekeeping
  209. include Makefile.housekeeping