You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 6.0KB

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