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

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