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

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