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