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 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. PARSEROM := ./util/parserom.pl
  36. FIXROM := ./util/fixrom.pl
  37. SYMCHECK := ./util/symcheck.pl
  38. SORTOBJDUMP := ./util/sortobjdump.pl
  39. PADIMG := ./util/padimg.pl
  40. LICENCE := ./util/licence.pl
  41. NRV2B := ./util/nrv2b
  42. ZBIN := ./util/zbin
  43. ELF2EFI32 := ./util/elf2efi32
  44. ELF2EFI64 := ./util/elf2efi64
  45. EFIROM := ./util/efirom
  46. ICCFIX := ./util/iccfix
  47. EINFO := ./util/einfo
  48. GENKEYMAP := ./util/genkeymap.pl
  49. DOXYGEN := doxygen
  50. BINUTILS_DIR := /usr
  51. BFD_DIR := $(BINUTILS_DIR)
  52. ZLIB_DIR := /usr
  53. ###############################################################################
  54. #
  55. # SRCDIRS lists all directories containing source files.
  56. #
  57. SRCDIRS :=
  58. SRCDIRS += libgcc
  59. SRCDIRS += core
  60. SRCDIRS += net net/tcp net/udp net/infiniband net/80211
  61. SRCDIRS += image
  62. SRCDIRS += drivers/bus
  63. SRCDIRS += drivers/net
  64. SRCDIRS += drivers/net/e1000
  65. SRCDIRS += drivers/net/e1000e
  66. SRCDIRS += drivers/net/igb
  67. SRCDIRS += drivers/net/igbvf
  68. SRCDIRS += drivers/net/phantom
  69. SRCDIRS += drivers/net/rtl818x
  70. SRCDIRS += drivers/net/ath
  71. SRCDIRS += drivers/net/ath/ath5k
  72. SRCDIRS += drivers/net/ath/ath9k
  73. SRCDIRS += drivers/net/vxge
  74. SRCDIRS += drivers/net/efi
  75. SRCDIRS += drivers/net/tg3
  76. SRCDIRS += drivers/block
  77. SRCDIRS += drivers/nvs
  78. SRCDIRS += drivers/bitbash
  79. SRCDIRS += drivers/infiniband
  80. SRCDIRS += interface/pxe interface/efi interface/smbios
  81. SRCDIRS += interface/bofm
  82. SRCDIRS += tests
  83. SRCDIRS += crypto crypto/axtls crypto/matrixssl
  84. SRCDIRS += hci hci/commands hci/tui
  85. SRCDIRS += hci/mucurses hci/mucurses/widgets
  86. SRCDIRS += hci/keymap
  87. SRCDIRS += usr
  88. SRCDIRS += config
  89. # NON_AUTO_SRCS lists files that are excluded from the normal
  90. # automatic build system.
  91. #
  92. NON_AUTO_SRCS :=
  93. NON_AUTO_SRCS += drivers/net/prism2.c
  94. # INCDIRS lists the include path
  95. #
  96. INCDIRS :=
  97. INCDIRS += include .
  98. ###############################################################################
  99. #
  100. # Default build target: build the most common targets and print out a
  101. # helpfully suggestive message
  102. #
  103. ALL := bin/blib.a bin/ipxe.dsk bin/ipxe.lkrn bin/ipxe.iso \
  104. bin/ipxe.usb bin/undionly.kpxe bin/rtl8139.rom
  105. all : $(ALL)
  106. @$(ECHO) '==========================================================='
  107. @$(ECHO)
  108. @$(ECHO) 'To create a bootable floppy, type'
  109. @$(ECHO) ' cat bin/ipxe.dsk > /dev/fd0'
  110. @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
  111. @$(ECHO) 'data already on the disk.'
  112. @$(ECHO)
  113. @$(ECHO) 'To create a bootable USB key, type'
  114. @$(ECHO) ' cat bin/ipxe.usb > /dev/sdX'
  115. @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
  116. @$(ECHO) 'disk on your system. This will erase any data already on'
  117. @$(ECHO) 'the USB key.'
  118. @$(ECHO)
  119. @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
  120. @$(ECHO) 'bin/ipxe.iso to a blank CD-ROM.'
  121. @$(ECHO)
  122. @$(ECHO) 'These images contain drivers for all supported cards. You'
  123. @$(ECHO) 'can build more customised images, and ROM images, using'
  124. @$(ECHO) ' make bin/<rom-name>.<output-format>'
  125. @$(ECHO)
  126. @$(ECHO) '==========================================================='
  127. ###############################################################################
  128. #
  129. # Comprehensive build target: build a selection of cross-platform
  130. # targets to expose potential build errors that show up only on
  131. # certain platforms
  132. #
  133. everything :
  134. $(Q)$(MAKE) --no-print-directory $(ALL) \
  135. bin-i386-efi/ipxe.efi bin-i386-efi/ipxe.efidrv \
  136. bin-i386-efi/ipxe.efirom \
  137. bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe.efidrv \
  138. bin-x86_64-efi/ipxe.efirom \
  139. bin-i386-linux/tap.linux bin-x86_64-linux/tap.linux
  140. ###############################################################################
  141. #
  142. # Build targets that do nothing but might be tried by users
  143. #
  144. configure :
  145. @$(ECHO) "No configuration needed."
  146. install :
  147. @$(ECHO) "No installation required."
  148. ###############################################################################
  149. #
  150. # Version number calculations
  151. #
  152. VERSION_MAJOR = 1
  153. VERSION_MINOR = 0
  154. VERSION_PATCH = 0
  155. EXTRAVERSION = +
  156. MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
  157. VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
  158. CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) \
  159. -DVERSION_MINOR=$(VERSION_MINOR) \
  160. -DVERSION_PATCH=$(VERSION_PATCH) \
  161. -DVERSION=\"$(VERSION)\"
  162. IDENT = '$(@F) $(VERSION) (GPL) ipxe.org'
  163. version :
  164. @$(ECHO) $(VERSION)
  165. ###############################################################################
  166. #
  167. # Drag in the bulk of the build system
  168. #
  169. MAKEDEPS += Makefile.housekeeping
  170. include Makefile.housekeeping