[bnxt] Add driver support for Broadcom NetXtreme-E Adapters
[ipxe.git] / src / Makefile
1 ###############################################################################
2 #
3 # Initialise various variables
4 #
5
6 CLEANUP :=
7 CFLAGS :=
8 ASFLAGS :=
9 LDFLAGS :=
10 HOST_CFLAGS :=
11 MAKEDEPS := Makefile
12 CROSS_COMPILE ?= $(CROSS)
13
14 ###############################################################################
15 #
16 # Locations of tools
17 #
18 HOST_CC := gcc
19 RM := rm -f
20 TOUCH := touch
21 MKDIR := mkdir
22 CP := cp
23 ECHO := echo
24 PRINTF := printf
25 PERL := perl
26 TRUE := true
27 CC := $(CROSS_COMPILE)gcc
28 CPP := $(CC) -E
29 AS := $(CROSS_COMPILE)as
30 LD := $(CROSS_COMPILE)ld
31 SIZE := $(CROSS_COMPILE)size
32 AR := $(CROSS_COMPILE)ar
33 RANLIB := $(CROSS_COMPILE)ranlib
34 OBJCOPY := $(CROSS_COMPILE)objcopy
35 NM := $(CROSS_COMPILE)nm
36 OBJDUMP := $(CROSS_COMPILE)objdump
37 OPENSSL := openssl
38 CSPLIT := csplit
39 PARSEROM := ./util/parserom.pl
40 FIXROM := ./util/fixrom.pl
41 SYMCHECK := ./util/symcheck.pl
42 SORTOBJDUMP := ./util/sortobjdump.pl
43 PADIMG := ./util/padimg.pl
44 LICENCE := ./util/licence.pl
45 NRV2B := ./util/nrv2b
46 ZBIN := ./util/zbin
47 ELF2EFI32 := ./util/elf2efi32
48 ELF2EFI64 := ./util/elf2efi64
49 EFIROM := ./util/efirom
50 EFIFATBIN := ./util/efifatbin
51 ICCFIX := ./util/iccfix
52 EINFO := ./util/einfo
53 GENKEYMAP := ./util/genkeymap.pl
54 DOXYGEN := doxygen
55 LCAB := lcab
56 QEMUIMG := qemu-img
57
58 ###############################################################################
59 #
60 # SRCDIRS lists all directories containing source files.
61 #
62 SRCDIRS :=
63 SRCDIRS += libgcc
64 SRCDIRS += core
65 SRCDIRS += net net/tcp net/udp net/infiniband
66 SRCDIRS += image
67 SRCDIRS += drivers/bus
68 SRCDIRS += drivers/net
69 SRCDIRS += drivers/net/e1000
70 SRCDIRS += drivers/net/e1000e
71 SRCDIRS += drivers/net/igb
72 SRCDIRS += drivers/net/igbvf
73 SRCDIRS += drivers/net/phantom
74 SRCDIRS += drivers/net/vxge
75 SRCDIRS += drivers/net/efi
76 SRCDIRS += drivers/net/tg3
77 SRCDIRS += drivers/net/bnxt
78 SRCDIRS += drivers/net/sfc
79 SRCDIRS += drivers/block
80 SRCDIRS += drivers/nvs
81 SRCDIRS += drivers/bitbash
82 SRCDIRS += drivers/infiniband
83 SRCDIRS += drivers/infiniband/mlx_utils_flexboot/src
84 SRCDIRS += drivers/infiniband/mlx_utils/src/public
85 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_reg_access
86 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_nvconfig
87 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_vmac
88 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_blink_leds
89 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_link_speed
90 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_mtu
91 SRCDIRS += drivers/infiniband/mlx_nodnic/src
92 SRCDIRS += drivers/usb
93 SRCDIRS += interface/pxe interface/efi interface/smbios
94 SRCDIRS += interface/bofm
95 SRCDIRS += interface/xen
96 SRCDIRS += interface/hyperv
97 SRCDIRS += tests
98 SRCDIRS += crypto crypto/mishmash
99 SRCDIRS += hci hci/commands hci/tui
100 SRCDIRS += hci/mucurses hci/mucurses/widgets
101 SRCDIRS += hci/keymap
102 SRCDIRS += usr
103 SRCDIRS += config
104
105 # These directories contain code that is not eligible for UEFI Secure
106 # Boot signing.
107 #
108 SRCDIRS_INSEC += net/oncrpc
109 SRCDIRS_INSEC += net/80211
110 SRCDIRS_INSEC += drivers/net/rtl818x
111 SRCDIRS_INSEC += drivers/net/ath
112 SRCDIRS_INSEC += drivers/net/ath/ath5k
113 SRCDIRS_INSEC += drivers/net/ath/ath9k
114
115 # NON_AUTO_SRCS lists files that are excluded from the normal
116 # automatic build system.
117 #
118 NON_AUTO_SRCS :=
119 NON_AUTO_SRCS += core/version.c
120 NON_AUTO_SRCS += drivers/net/prism2.c
121
122 # INCDIRS lists the include path
123 #
124 INCDIRS :=
125 INCDIRS += include .
126
127 ###############################################################################
128 #
129 # Default build target: build the most common targets and print out a
130 # helpfully suggestive message
131 #
132 ALL := bin/blib.a bin/ipxe.dsk bin/ipxe.lkrn bin/ipxe.iso \
133 bin/ipxe.usb bin/ipxe.pxe bin/undionly.kpxe bin/rtl8139.rom \
134 bin/8086100e.mrom bin/80861209.rom bin/10500940.rom \
135 bin/10222000.rom bin/10ec8139.rom bin/1af41000.rom \
136 bin/8086100f.mrom bin/808610d3.mrom bin/15ad07b0.rom
137
138 all : $(ALL)
139 @$(ECHO) '==========================================================='
140 @$(ECHO)
141 @$(ECHO) 'To create a bootable floppy, type'
142 @$(ECHO) ' cat bin/ipxe.dsk > /dev/fd0'
143 @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
144 @$(ECHO) 'data already on the disk.'
145 @$(ECHO)
146 @$(ECHO) 'To create a bootable USB key, type'
147 @$(ECHO) ' cat bin/ipxe.usb > /dev/sdX'
148 @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
149 @$(ECHO) 'disk on your system. This will erase any data already on'
150 @$(ECHO) 'the USB key.'
151 @$(ECHO)
152 @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
153 @$(ECHO) 'bin/ipxe.iso to a blank CD-ROM.'
154 @$(ECHO)
155 @$(ECHO) 'These images contain drivers for all supported cards. You'
156 @$(ECHO) 'can build more customised images, and ROM images, using'
157 @$(ECHO) ' make bin/<rom-name>.<output-format>'
158 @$(ECHO)
159 @$(ECHO) '==========================================================='
160
161 ###############################################################################
162 #
163 # Comprehensive build target: build a selection of cross-platform
164 # targets to expose potential build errors that show up only on
165 # certain platforms
166 #
167 everything :
168 $(Q)$(MAKE) --no-print-directory $(ALL) \
169 bin/3c509.rom bin/intel.rom bin/intel.mrom \
170 bin-x86_64-pcbios/8086100e.mrom bin-x86_64-pcbios/intel.rom \
171 bin-x86_64-pcbios/ipxe.usb bin-x86_64-pcbios/ipxe.pxe \
172 bin-x86_64-pcbios/undionly.kpxe \
173 bin-i386-efi/ipxe.efi bin-i386-efi/ipxe.efidrv \
174 bin-i386-efi/ipxe.efirom \
175 bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe.efidrv \
176 bin-x86_64-efi/ipxe.efirom \
177 bin-i386-linux/tap.linux bin-x86_64-linux/tap.linux \
178 bin-i386-linux/tests.linux bin-x86_64-linux/tests.linux
179
180 ###############################################################################
181 #
182 # VMware build target: all ROMs used with VMware
183 #
184 vmware : bin/8086100f.mrom bin/808610d3.mrom bin/10222000.rom bin/15ad07b0.rom
185 @$(ECHO) '==========================================================='
186 @$(ECHO)
187 @$(ECHO) 'Available ROMs:'
188 @$(ECHO) ' bin/8086100f.mrom -- intel/e1000'
189 @$(ECHO) ' bin/808610d3.mrom -- intel/e1000e'
190 @$(ECHO) ' bin/10222000.rom -- vlance/pcnet32'
191 @$(ECHO) ' bin/15ad07b0.rom -- vmxnet3'
192 @$(ECHO)
193 @$(ECHO) 'For more information, see http://ipxe.org/howto/vmware'
194 @$(ECHO)
195 @$(ECHO) '==========================================================='
196
197 ###############################################################################
198 #
199 # Build targets that do nothing but might be tried by users
200 #
201 configure :
202 @$(ECHO) "No configuration needed."
203
204 install :
205 @$(ECHO) "No installation required."
206
207 ###############################################################################
208 #
209 # Version number calculations
210 #
211 ifneq ($(wildcard ../.git),)
212 VERSIONS := $(shell git describe --tags --always --long --abbrev=1 --match "v*")
213 VERSION_TUPLE := $(subst ., ,$(subst -, ,$(patsubst v%,%,$(VERSIONS))))
214 VERSION_MAJOR := $(word 1,$(VERSION_TUPLE))
215 VERSION_MINOR := $(word 2,$(VERSION_TUPLE))
216 VERSION_PATCH := $(word 3,$(VERSION_TUPLE))
217 ifeq ($(word 4,$(VERSION_TUPLE)),0)
218 EXTRAVERSION :=
219 else
220 EXTRAVERSION := +
221 endif
222 GITVERSION = $(word 5,$(VERSION_TUPLE))
223 else
224 VERSION_MAJOR = 1
225 VERSION_MINOR = 0
226 VERSION_PATCH = 0
227 EXTRAVERSION = +
228 endif
229 MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
230 VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
231 ifneq ($(GITVERSION),)
232 VERSION += ($(GITVERSION))
233 endif
234 version :
235 @$(ECHO) "$(VERSION)"
236
237 ###############################################################################
238 #
239 # Predefined build shortcuts (for e.g. bin/ipxe.iso)
240
241 # All drivers (excluding USB)
242 #
243 DRIVERS_ipxe = $(DRIVERS_net) $(DRIVERS_infiniband) \
244 $(DRIVERS_xen) $(DRIVERS_hyperv)
245
246 # Raspberry Pi
247 #
248 DRIVERS_rpi = smsc95xx lan78xx
249
250 ###############################################################################
251 #
252 # Drag in the bulk of the build system
253 #
254
255 MAKEDEPS += Makefile.housekeeping
256 include Makefile.housekeeping