[fdt] Add ability to parse a MAC address from a flattened device tree
[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/sfc
78 SRCDIRS += drivers/block
79 SRCDIRS += drivers/nvs
80 SRCDIRS += drivers/bitbash
81 SRCDIRS += drivers/infiniband
82 SRCDIRS += drivers/infiniband/mlx_utils_flexboot/src
83 SRCDIRS += drivers/infiniband/mlx_utils/src/public
84 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_reg_access
85 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_nvconfig
86 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_vmac
87 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_blink_leds
88 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_link_speed
89 SRCDIRS += drivers/infiniband/mlx_utils/mlx_lib/mlx_mtu
90 SRCDIRS += drivers/infiniband/mlx_nodnic/src
91 SRCDIRS += drivers/usb
92 SRCDIRS += interface/pxe interface/efi interface/smbios
93 SRCDIRS += interface/bofm
94 SRCDIRS += interface/xen
95 SRCDIRS += interface/hyperv
96 SRCDIRS += tests
97 SRCDIRS += crypto crypto/mishmash
98 SRCDIRS += hci hci/commands hci/tui
99 SRCDIRS += hci/mucurses hci/mucurses/widgets
100 SRCDIRS += hci/keymap
101 SRCDIRS += usr
102 SRCDIRS += config
103
104 # These directories contain code that is not eligible for UEFI Secure
105 # Boot signing.
106 #
107 SRCDIRS_INSEC += net/oncrpc
108 SRCDIRS_INSEC += net/80211
109 SRCDIRS_INSEC += drivers/net/rtl818x
110 SRCDIRS_INSEC += drivers/net/ath
111 SRCDIRS_INSEC += drivers/net/ath/ath5k
112 SRCDIRS_INSEC += drivers/net/ath/ath9k
113
114 # NON_AUTO_SRCS lists files that are excluded from the normal
115 # automatic build system.
116 #
117 NON_AUTO_SRCS :=
118 NON_AUTO_SRCS += core/version.c
119 NON_AUTO_SRCS += drivers/net/prism2.c
120
121 # INCDIRS lists the include path
122 #
123 INCDIRS :=
124 INCDIRS += include .
125
126 ###############################################################################
127 #
128 # Default build target: build the most common targets and print out a
129 # helpfully suggestive message
130 #
131 ALL := bin/blib.a bin/ipxe.dsk bin/ipxe.lkrn bin/ipxe.iso \
132 bin/ipxe.usb bin/ipxe.pxe bin/undionly.kpxe bin/rtl8139.rom \
133 bin/8086100e.mrom bin/80861209.rom bin/10500940.rom \
134 bin/10222000.rom bin/10ec8139.rom bin/1af41000.rom \
135 bin/8086100f.mrom bin/808610d3.mrom bin/15ad07b0.rom
136
137 all : $(ALL)
138 @$(ECHO) '==========================================================='
139 @$(ECHO)
140 @$(ECHO) 'To create a bootable floppy, type'
141 @$(ECHO) ' cat bin/ipxe.dsk > /dev/fd0'
142 @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
143 @$(ECHO) 'data already on the disk.'
144 @$(ECHO)
145 @$(ECHO) 'To create a bootable USB key, type'
146 @$(ECHO) ' cat bin/ipxe.usb > /dev/sdX'
147 @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
148 @$(ECHO) 'disk on your system. This will erase any data already on'
149 @$(ECHO) 'the USB key.'
150 @$(ECHO)
151 @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
152 @$(ECHO) 'bin/ipxe.iso to a blank CD-ROM.'
153 @$(ECHO)
154 @$(ECHO) 'These images contain drivers for all supported cards. You'
155 @$(ECHO) 'can build more customised images, and ROM images, using'
156 @$(ECHO) ' make bin/<rom-name>.<output-format>'
157 @$(ECHO)
158 @$(ECHO) '==========================================================='
159
160 ###############################################################################
161 #
162 # Comprehensive build target: build a selection of cross-platform
163 # targets to expose potential build errors that show up only on
164 # certain platforms
165 #
166 everything :
167 $(Q)$(MAKE) --no-print-directory $(ALL) \
168 bin/3c509.rom bin/intel.rom bin/intel.mrom \
169 bin-x86_64-pcbios/8086100e.mrom bin-x86_64-pcbios/intel.rom \
170 bin-x86_64-pcbios/ipxe.usb bin-x86_64-pcbios/ipxe.pxe \
171 bin-x86_64-pcbios/undionly.kpxe \
172 bin-i386-efi/ipxe.efi bin-i386-efi/ipxe.efidrv \
173 bin-i386-efi/ipxe.efirom \
174 bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe.efidrv \
175 bin-x86_64-efi/ipxe.efirom \
176 bin-i386-linux/tap.linux bin-x86_64-linux/tap.linux \
177 bin-i386-linux/tests.linux bin-x86_64-linux/tests.linux
178
179 ###############################################################################
180 #
181 # VMware build target: all ROMs used with VMware
182 #
183 vmware : bin/8086100f.mrom bin/808610d3.mrom bin/10222000.rom bin/15ad07b0.rom
184 @$(ECHO) '==========================================================='
185 @$(ECHO)
186 @$(ECHO) 'Available ROMs:'
187 @$(ECHO) ' bin/8086100f.mrom -- intel/e1000'
188 @$(ECHO) ' bin/808610d3.mrom -- intel/e1000e'
189 @$(ECHO) ' bin/10222000.rom -- vlance/pcnet32'
190 @$(ECHO) ' bin/15ad07b0.rom -- vmxnet3'
191 @$(ECHO)
192 @$(ECHO) 'For more information, see http://ipxe.org/howto/vmware'
193 @$(ECHO)
194 @$(ECHO) '==========================================================='
195
196 ###############################################################################
197 #
198 # Build targets that do nothing but might be tried by users
199 #
200 configure :
201 @$(ECHO) "No configuration needed."
202
203 install :
204 @$(ECHO) "No installation required."
205
206 ###############################################################################
207 #
208 # Version number calculations
209 #
210 VERSION_MAJOR = 1
211 VERSION_MINOR = 0
212 VERSION_PATCH = 0
213 EXTRAVERSION = +
214 MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
215 VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
216 ifneq ($(wildcard ../.git),)
217 GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
218 VERSION += ($(GITVERSION))
219 endif
220 version :
221 @$(ECHO) "$(VERSION)"
222
223 ###############################################################################
224 #
225 # Drag in the bulk of the build system
226 #
227
228 MAKEDEPS += Makefile.housekeeping
229 include Makefile.housekeeping