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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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/ath5k
  69. SRCDIRS += drivers/net/vxge
  70. SRCDIRS += drivers/net/efi
  71. SRCDIRS += drivers/block
  72. SRCDIRS += drivers/nvs
  73. SRCDIRS += drivers/bitbash
  74. SRCDIRS += drivers/infiniband
  75. SRCDIRS += interface/pxe interface/efi interface/smbios
  76. SRCDIRS += interface/bofm
  77. SRCDIRS += tests
  78. SRCDIRS += crypto crypto/axtls crypto/matrixssl
  79. SRCDIRS += hci hci/commands hci/tui
  80. SRCDIRS += hci/mucurses hci/mucurses/widgets
  81. SRCDIRS += hci/keymap
  82. SRCDIRS += usr
  83. SRCDIRS += config
  84. # NON_AUTO_SRCS lists files that are excluded from the normal
  85. # automatic build system.
  86. #
  87. NON_AUTO_SRCS :=
  88. NON_AUTO_SRCS += drivers/net/prism2.c
  89. # INCDIRS lists the include path
  90. #
  91. INCDIRS :=
  92. INCDIRS += include .
  93. ###############################################################################
  94. #
  95. # Default build target: build the most common targets and print out a
  96. # helpfully suggestive message
  97. #
  98. ALL := bin/blib.a bin/ipxe.dsk bin/ipxe.lkrn bin/ipxe.iso \
  99. bin/ipxe.usb bin/undionly.kpxe bin/rtl8139.rom
  100. all : $(ALL)
  101. @$(ECHO) '==========================================================='
  102. @$(ECHO)
  103. @$(ECHO) 'To create a bootable floppy, type'
  104. @$(ECHO) ' cat bin/ipxe.dsk > /dev/fd0'
  105. @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
  106. @$(ECHO) 'data already on the disk.'
  107. @$(ECHO)
  108. @$(ECHO) 'To create a bootable USB key, type'
  109. @$(ECHO) ' cat bin/ipxe.usb > /dev/sdX'
  110. @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
  111. @$(ECHO) 'disk on your system. This will erase any data already on'
  112. @$(ECHO) 'the USB key.'
  113. @$(ECHO)
  114. @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
  115. @$(ECHO) 'bin/ipxe.iso to a blank CD-ROM.'
  116. @$(ECHO)
  117. @$(ECHO) 'These images contain drivers for all supported cards. You'
  118. @$(ECHO) 'can build more customised images, and ROM images, using'
  119. @$(ECHO) ' make bin/<rom-name>.<output-format>'
  120. @$(ECHO)
  121. @$(ECHO) '==========================================================='
  122. ###############################################################################
  123. #
  124. # Comprehensive build target: build a selection of cross-platform
  125. # targets to expose potential build errors that show up only on
  126. # certain platforms
  127. #
  128. everything :
  129. $(Q)$(MAKE) --no-print-directory $(ALL) \
  130. bin-i386-efi/ipxe.efi bin-i386-efi/ipxe.efidrv \
  131. bin-i386-efi/ipxe.efirom \
  132. bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe.efidrv \
  133. bin-x86_64-efi/ipxe.efirom \
  134. bin-i386-linux/tap.linux bin-x86_64-linux/tap.linux
  135. ###############################################################################
  136. #
  137. # Build targets that do nothing but might be tried by users
  138. #
  139. configure :
  140. @$(ECHO) "No configuration needed."
  141. install :
  142. @$(ECHO) "No installation required."
  143. ###############################################################################
  144. #
  145. # Version number calculations
  146. #
  147. VERSION_MAJOR = 1
  148. VERSION_MINOR = 0
  149. VERSION_PATCH = 0
  150. EXTRAVERSION = +
  151. MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
  152. VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
  153. CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) \
  154. -DVERSION_MINOR=$(VERSION_MINOR) \
  155. -DVERSION_PATCH=$(VERSION_PATCH) \
  156. -DVERSION=\"$(VERSION)\"
  157. IDENT = '$(@F) $(VERSION) (GPL) ipxe.org'
  158. version :
  159. @$(ECHO) $(VERSION)
  160. ###############################################################################
  161. #
  162. # Drag in the bulk of the build system
  163. #
  164. MAKEDEPS += Makefile.housekeeping
  165. include Makefile.housekeeping