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