1 ###############################################################################
3 # Initialise various variables
13 ###############################################################################
26 CC := $(CROSS_COMPILE)gcc
28 AS := $(CROSS_COMPILE)as
29 LD := $(CROSS_COMPILE)ld
30 SIZE := $(CROSS_COMPILE)size
31 AR := $(CROSS_COMPILE)ar
32 RANLIB := $(CROSS_COMPILE)ranlib
33 OBJCOPY := $(CROSS_COMPILE)objcopy
34 NM := $(CROSS_COMPILE)nm
35 OBJDUMP := $(CROSS_COMPILE)objdump
38 PARSEROM := ./util/parserom.pl
39 FIXROM := ./util/fixrom.pl
40 SYMCHECK := ./util/symcheck.pl
41 SORTOBJDUMP := ./util/sortobjdump.pl
42 PADIMG := ./util/padimg.pl
43 LICENCE := ./util/licence.pl
46 ELF2EFI32 := ./util/elf2efi32
47 ELF2EFI64 := ./util/elf2efi64
48 EFIROM := ./util/efirom
49 EFIFATBIN := ./util/efifatbin
50 ICCFIX := ./util/iccfix
52 GENKEYMAP := ./util/genkeymap.pl
56 BFD_DIR := $(BINUTILS_DIR)
59 ###############################################################################
61 # SRCDIRS lists all directories containing source files.
66 SRCDIRS += net net/oncrpc net/tcp net/udp net/infiniband net/80211
68 SRCDIRS += drivers/bus
69 SRCDIRS += drivers/net
70 SRCDIRS += drivers/net/e1000
71 SRCDIRS += drivers/net/e1000e
72 SRCDIRS += drivers/net/igb
73 SRCDIRS += drivers/net/igbvf
74 SRCDIRS += drivers/net/phantom
75 SRCDIRS += drivers/net/rtl818x
76 SRCDIRS += drivers/net/ath
77 SRCDIRS += drivers/net/ath/ath5k
78 SRCDIRS += drivers/net/ath/ath9k
79 SRCDIRS += drivers/net/vxge
80 SRCDIRS += drivers/net/efi
81 SRCDIRS += drivers/net/tg3
82 SRCDIRS += drivers/block
83 SRCDIRS += drivers/nvs
84 SRCDIRS += drivers/bitbash
85 SRCDIRS += drivers/infiniband
86 SRCDIRS += interface/pxe interface/efi interface/smbios
87 SRCDIRS += interface/bofm
88 SRCDIRS += interface/xen
90 SRCDIRS += crypto crypto/axtls crypto/matrixssl
91 SRCDIRS += hci hci/commands hci/tui
92 SRCDIRS += hci/mucurses hci/mucurses/widgets
97 # NON_AUTO_SRCS lists files that are excluded from the normal
98 # automatic build system.
101 NON_AUTO_SRCS += core/version.c
102 NON_AUTO_SRCS += drivers/net/prism2.c
104 # INCDIRS lists the include path
109 ###############################################################################
111 # Default build target: build the most common targets and print out a
112 # helpfully suggestive message
114 ALL := bin/blib.a bin/ipxe.dsk bin/ipxe.lkrn bin/ipxe.iso \
115 bin/ipxe.usb bin/ipxe.pxe bin/undionly.kpxe bin/rtl8139.rom \
116 bin/8086100e.mrom bin/80861209.rom bin/10500940.rom \
117 bin/10222000.rom bin/10ec8139.rom bin/1af41000.rom \
118 bin/8086100f.mrom bin/808610d3.mrom bin/15ad07b0.rom
121 @$(ECHO) '==========================================================='
123 @$(ECHO) 'To create a bootable floppy, type'
124 @$(ECHO) ' cat bin/ipxe.dsk > /dev/fd0'
125 @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
126 @$(ECHO) 'data already on the disk.'
128 @$(ECHO) 'To create a bootable USB key, type'
129 @$(ECHO) ' cat bin/ipxe.usb > /dev/sdX'
130 @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
131 @$(ECHO) 'disk on your system. This will erase any data already on'
132 @$(ECHO) 'the USB key.'
134 @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
135 @$(ECHO) 'bin/ipxe.iso to a blank CD-ROM.'
137 @$(ECHO) 'These images contain drivers for all supported cards. You'
138 @$(ECHO) 'can build more customised images, and ROM images, using'
139 @$(ECHO) ' make bin/<rom-name>.<output-format>'
141 @$(ECHO) '==========================================================='
143 ###############################################################################
145 # Comprehensive build target: build a selection of cross-platform
146 # targets to expose potential build errors that show up only on
150 $(Q)$(MAKE) --no-print-directory $(ALL) \
151 bin/3c509.rom bin/intel.rom bin/intel.mrom \
152 bin-i386-efi/ipxe.efi bin-i386-efi/ipxe.efidrv \
153 bin-i386-efi/ipxe.efirom \
154 bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe.efidrv \
155 bin-x86_64-efi/ipxe.efirom \
156 bin-i386-linux/tap.linux bin-x86_64-linux/tap.linux \
157 bin-i386-linux/tests.linux bin-x86_64-linux/tests.linux
159 ###############################################################################
161 # VMware build target: all ROMs used with VMware
163 vmware : bin/8086100f.mrom bin/808610d3.mrom bin/10222000.rom bin/15ad07b0.rom
164 @$(ECHO) '==========================================================='
166 @$(ECHO) 'Available ROMs:'
167 @$(ECHO) ' bin/8086100f.mrom -- intel/e1000'
168 @$(ECHO) ' bin/808610d3.mrom -- intel/e1000e'
169 @$(ECHO) ' bin/10222000.rom -- vlance/pcnet32'
170 @$(ECHO) ' bin/15ad07b0.rom -- vmxnet3'
172 @$(ECHO) 'For more information, see http://ipxe.org/howto/vmware'
174 @$(ECHO) '==========================================================='
176 ###############################################################################
178 # Build targets that do nothing but might be tried by users
181 @$(ECHO) "No configuration needed."
184 @$(ECHO) "No installation required."
186 ###############################################################################
188 # Version number calculations
194 MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
195 VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
196 ifneq ($(wildcard ../.git),)
197 GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
198 VERSION += ($(GITVERSION))
201 @$(ECHO) "$(VERSION)"
203 ###############################################################################
205 # Drag in the bulk of the build system
208 MAKEDEPS += Makefile.housekeeping
209 include Makefile.housekeeping