VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/Etherboot-src/Makefile.main@ 19223

Last change on this file since 19223 was 1, checked in by vboxsync, 55 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.0 KB
Line 
1#
2# Makefile for Etherboot
3#
4# Most of the time you should edit Config
5#
6# Common options:
7# VERSION_*=v - Set the major and minor version numbers
8#
9# NS8390 options:
10# -DINCLUDE_NE - Include NE1000/NE2000 support
11# -DNE_SCAN=list - Probe for NE base address using list of
12# comma separated hex addresses
13# -DINCLUDE_3C503 - Include 3c503 support
14# -DT503_SHMEM - Use 3c503 shared memory mode (off by default)
15# -DINCLUDE_WD - Include Western Digital/SMC support
16# -DWD_DEFAULT_MEM- Default memory location for WD/SMC cards
17# -DWD_790_PIO - Read/write to WD/SMC 790 cards in PIO mode (default
18# is to use shared memory) Try this if you get "Bogus
19# packet, ignoring" messages, common on ISA/PCI hybrid
20# systems.
21# -DCOMPEX_RL2000_FIX
22#
23# If you have a Compex RL2000 PCI 32-bit (11F6:1401),
24# and the bootrom hangs in "Probing...[NE*000/PCI]",
25# try enabling this fix... it worked for me :).
26# In the first packet write somehow it somehow doesn't
27# get back the expected data so it is stuck in a loop.
28# I didn't bother to investigate what or why because it works
29# when I interrupt the loop if it takes more then COMPEX_RL2000_TRIES.
30# The code will notify if it does a abort.
31# SomniOne - [email protected]
32#
33# 3C509 option:
34# -DINCLUDE_3C509 - Include 3c509 support
35#
36# 3C90X options:
37# -DINCLUDE_3C90X - Include 3c90x support
38#
39# Warning Warning Warning
40# If you use any of the XCVR options below, please do not complain about
41# the behaviour with Linux drivers to the kernel developers. You are
42# on your own if you do this. Please read 3c90x.txt to understand
43# what they do. If you don't understand them, ask for help on the
44# Etherboot mailing list. And please document what you did to the NIC
45# on the NIC so that people after you won't get nasty surprises.
46#
47# -DCFG_3C90X_PRESERVE_XCVR - Reset the transceiver type to the value it
48# had initially just before the loaded code is started.
49# -DCFG_3C90X_XCVR - Hardcode the tranceiver type Etherboot uses.
50# -DCFG_3C90X_BOOTROM_FIX - If you have a 3c905B with buggy ROM
51# interface, setting this option might "fix" it. Use
52# with caution and read the docs in 3c90x.txt!
53#
54# See the documentation file 3c90x.txt for more details.
55#
56# CS89X0 (optional) options:
57# -DINCLUDE_CS89X0- Include CS89x0 support
58# -DCS_SCAN=list - Probe for CS89x0 base address using list of
59# comma separated hex addresses; increasing the
60# address by one (0x300 -> 0x301) will force a
61# more aggressive probing algorithm. This might
62# be neccessary after a soft-reset of the NIC.
63#
64# LANCE options:
65# -DINCLUDE_NE2100- Include NE2100 support
66# -DINCLUDE_NI6510- Include NI6510 support
67#
68# SK_G16 options:
69# -DINCLUDE_SK_G16- Include SK_G16 support
70#
71# I82586 options:
72# -DINCLUDE_3C507 - Include 3c507 support
73# -DINCLUDE_NI5210- Include NI5210 support
74# -DINCLUDE_EXOS205-Include EXOS205 support
75#
76# SMC9000 options:
77# -DINCLUDE_SMC9000 - Include SMC9000 driver
78# -DSMC9000_SCAN=list - List of I/O addresses to probe
79#
80# TIARA (Fujitsu Etherstar) options:
81# -DINCLUDE_TIARA - Include Tiara support
82#
83# NI5010 options:
84# -DINCLUDE_NI5010 - Include NI5010 support
85#
86# TULIP options:
87# -DINCLUDE_TULIP - Include Tulip support
88#
89# RTL8139 options:
90# -DINCLUDE_RTL8139 - Include RTL8139 support
91#
92# SIS900 options:
93# -DINCLUDE_SIS900 - Include SIS900 support
94#
95# NATSEMI options:
96# -DINCLUDE_NATSEMI - Include NATSEMI support
97#
98
99SRCS:=
100BOBJS:=
101
102MAKEROM= $(PERL) ./util/makerom.pl
103VERSION_MAJOR= 5
104VERSION_MINOR= 4
105VERSION_PATCH= 2
106EXTRAVERSION= cvs
107VERSION= $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)$(EXTRAVERSION)
108MM_VERSION= $(VERSION_MAJOR).$(VERSION_MINOR)
109CFLAGS+= -DVERSION_MAJOR=$(VERSION_MAJOR) \
110 -DVERSION_MINOR=$(VERSION_MINOR) \
111 -DVERSION=\"$(VERSION)\" $(OLDGAS) \
112 -I include -I arch/$(ARCH)/include \
113 -DARCH=$(ARCH)
114FILO=filo
115FILO_PROGRAM_NAME = FILO
116FILO_PROGRAM_VERSION = 0.4.1
117FILO_BUILD_INFO = ($(shell whoami)@$(shell hostname)) $(shell LANG=C date)
118
119GCCINCDIR = $(shell $(CC) -print-search-dirs | head -n 1 | cut -d' ' -f2)include
120
121IDENT= '$(@F) $(VERSION) (GPL) etherboot.org'
122
123# Find out if we're using binutils 2.9.1 which uses a different syntax in some
124# places (most prominently in the opcode prefix area).
125OLDGAS:= $(shell $(AS) --version | grep -q '2\.9\.1' && echo -DGAS291)
126
127BUILD_LIBS= $(BLIB)
128BUILD_IMGS= $(IMGS)
129
1303C503FLAGS= -DINCLUDE_3C503 # -DT503_SHMEM
131# Note that the suffix to MAKEROM_ is the (mixed case) basename of the ROM file
132MAKEROM_3c503= -3
1333C507FLAGS= -DINCLUDE_3C507
1343C509FLAGS= -DINCLUDE_3C509
1353C529FLAGS= -DINCLUDE_3C529
1363C595FLAGS= -DINCLUDE_3C595
1373C90XFLAGS= -DINCLUDE_3C90X
138CS89X0FLAGS= -DINCLUDE_CS89X0
139EEPROFLAGS= -DINCLUDE_EEPRO
140EEPRO100FLAGS= -DINCLUDE_EEPRO100
141E1000FLAGS= -DINCLUDE_E1000
142EPIC100FLAGS= -DINCLUDE_EPIC100
143EXOS205FLAGS= -DINCLUDE_EXOS205
144LANCEFLAGS= -DINCLUDE_LANCE # Lance/PCI!
145MYRI10GEFLAGS= -DINCLUDE_MYRI10GE
146NE2100FLAGS= -DINCLUDE_NE2100
147NEFLAGS= -DINCLUDE_NE -DNE_SCAN=0x300,0x280,0x320,0x340,0x380
148NS8390FLAGS= -DINCLUDE_NS8390 # NE2000/PCI!
149NI5010FLAGS= -DINCLUDE_NI5010
150NI5210FLAGS= -DINCLUDE_NI5210
151NI6510FLAGS= -DINCLUDE_NI6510
152RTL8139FLAGS= -DINCLUDE_RTL8139
153SK_G16FLAGS= -DINCLUDE_SK_G16
154SIS900FLAGS= -DINCLUDE_SIS900
155NATSEMIFLAGS= -DINCLUDE_NATSEMI
156SMC9000FLAGS= -DINCLUDE_SMC9000
157SUNDANCEFLAGS= -DINCLUDE_SUNDANCE
158TLANFLAGS= -DINCLUDE_TLAN
159TIARAFLAGS= -DINCLUDE_TIARA
160DEPCAFLAGS= -DINCLUDE_DEPCA # -DDEPCA_MODEL=DEPCA -DDEPCA_RAM_BASE=0xd0000
161TULIPFLAGS= -DINCLUDE_TULIP
162OTULIPFLAGS= -DINCLUDE_OTULIP
163VIA_RHINEFLAGS= -DINCLUDE_VIA_RHINE
164WDFLAGS= -DINCLUDE_WD -DWD_DEFAULT_MEM=0xCC000
165W89C840FLAGS= -DINCLUDE_W89C840
166
167SRCS+= core/serial.c
168
169SRCS+= core/btext.c core/pc_kbd.c
170
171SRCS+= core/main.c core/pci.c core/osloader.c core/nfs.c
172SRCS+= core/misc.c core/config.c core/isa_probe.c core/pci_probe.c
173SRCS+= core/relocate.c core/heap.c
174SRCS+= drivers/disk/floppy.c core/nic.c core/disk.c core/timer.c
175SRCS+= core/proto_eth_slow.c core/proto_fsp.c
176SRCS+= core/proto_slam.c core/proto_tftm.c core/proto_http.c
177SRCS+= core/isapnp.c
178SRCS+= core/pcmcia.c core/i82365.c
179SRCS+= core/pxe_export.c core/dns_resolver.c
180
181FILO_SRCS+= $(FILO)/drivers/ide_x.c
182FILO_SRCS+= $(FILO)/fs/blockdev.c $(FILO)/fs/eltorito.c $(FILO)/fs/fsys_ext2fs.c $(FILO)/fs/fsys_fat.c $(FILO)/fs/fsys_iso9660.c
183FILO_SRCS+= $(FILO)/fs/fsys_reiserfs.c $(FILO)/fs/vfs.c $(FILO)/fs/fsys_jfs.c $(FILO)/fs/fsys_minix.c $(FILO)/fs/fsys_xfs.c
184FILO_SRCS+= $(FILO)/main/elfload.c $(FILO)/main/elfnote.c $(FILO)/main/filo_x.c $(FILO)/main/lib.c $(FILO)/main/linuxbios_x.c
185FILO_SRCS+= $(FILO)/main/pci_x.c $(FILO)/main/malloc_x.c $(FILO)/main/printf_x.c $(FILO)/main/console_x.c
186FILO_SRCS+= $(FILO)/$(ARCH)/context.c $(FILO)/$(ARCH)/linux_load.c $(FILO)/$(ARCH)/segment.c $(FILO)/$(ARCH)/sys_info.c
187FILO_SRCS+= $(FILO)/$(ARCH)/switch.S $(FILO)/usb/debug_x.c $(FILO)/usb/scsi_cmds.c $(FILO)/usb/uhci.c $(FILO)/usb/usb.c
188FILO_SRCS+= $(FILO)/usb/ohci.c $(FILO)/usb/usb_scsi_low.c $(FILO)/usb/usb_x.c
189
190
191BOBJS+= $(BIN)/main.o $(BIN)/osloader.o $(BIN)/nfs.o $(BIN)/misc.o
192BOBJS+= $(BIN)/proto_slam.o $(BIN)/proto_tftm.o $(BIN)/proto_http.o
193BOBJS+= $(BIN)/floppy.o $(BIN)/proto_fsp.o
194BOBJS+= $(BIN)/serial.o $(BIN)/timer.o $(BIN)/relocate.o $(BIN)/heap.o
195BOBJS+= $(BIN)/btext.o $(BIN)/pc_kbd.o
196BOBJS+= $(BIN)/nic.o $(BIN)/disk.o
197BOBJS+= $(BIN)/isapnp.o
198BOBJS+= $(BIN)/pci.o $(BIN)/isa_probe.o $(BIN)/pci_probe.o
199BOBJS+= $(BIN)/vsprintf.o $(BIN)/string.o
200BOBJS+= $(BIN)/pcmcia.o $(BIN)/i82365.o
201BOBJS+= $(BIN)/pxe_export.o $(BIN)/dns_resolver.o
202
203FILO_OBJS+= $(BIN)/ide_x.o $(BIN)/pci_x.o
204FILO_OBJS+= $(BIN)/blockdev.o $(BIN)/eltorito.o $(BIN)/fsys_ext2fs.o $(BIN)/fsys_fat.o $(BIN)/fsys_iso9660.o $(BIN)/fsys_reiserfs.o $(BIN)/vfs.o
205FILO_OBJS+= $(BIN)/fsys_jfs.o $(BIN)/fsys_minix.o $(BIN)/fsys_xfs.o
206FILO_OBJS+= $(BIN)/elfload.o $(BIN)/elfnote.o $(BIN)/filo_x.o $(BIN)/lib.o $(BIN)/linuxbios_x.o $(BIN)/malloc_x.o $(BIN)/printf_x.o $(BIN)/console_x.o
207FILO_OBJS+= $(BIN)/context.o $(BIN)/linux_load.o $(BIN)/segment.o $(BIN)/sys_info.o $(BIN)/switch.o
208FILO_OBJS+= $(BIN)/debug_x.o $(BIN)/scsi_cmds.o $(BIN)/uhci.o $(BIN)/usb.o $(BIN)/ohci.o $(BIN)/usb_scsi_low.o $(BIN)/usb_x.o
209
210BLIB= $(BIN)/bootlib.a
211FILOLIB= $(BIN)/filolib.a
212LIBS= $(BLIB)
213ifdef INCLUDE_FILO
214LIBS+= $(FILOLIB)
215endif
216UTILS+= $(BIN)/nrv2b
217STDDEPS= $(START) $(UTILS)
218# MAKEDEPS is the one target that is depended by all ROMs, so we check gcc here
219# If you are confident that gcc 2.96 works for you, you can remove the lines
220# that check gcc in the toolcheck rule
221MAKEDEPS+= Makefile Makefile.main Config genrules.pl Families
222MAKEDEPS+= $(BIN)/toolcheck
223MAKEDEPS+= arch/$(ARCH)/Makefile arch/$(ARCH)/Config
224
225# Start of targets
226
227.PHONY: noargs
228noargs: $(BIN)/toolcheck
229 @echo '===================================================='
230 @echo 'No target specified. To specify a target, do: '
231 @echo
232 @echo ' $(MAKE) bin/<rom-name>.<output-format> '
233 @echo
234 @echo 'where <output-format> is one of {zdsk, zhd, zrom, iso, liso, zlilo, zpxe, elf, com}'
235 @echo
236 @echo 'or: '
237 @echo
238 @echo ' $(MAKE) all<output-format>s'
239 @echo
240 @echo 'to generate all possible images of format <output-format>'
241 @echo
242 @echo 'For example, '
243 @echo
244 @echo ' make allzroms '
245 @echo
246 @echo 'will generate all possible .zrom (rom burnable) images, and'
247 @echo
248 @echo ' make allzdsks'
249 @echo
250 @echo 'will generate all possible .zdsk (bootable floppy) images, or'
251 @echo
252 @echo '===================================================='
253 @exit 1
254
255$(BIN)/toolcheck: Makefile Config
256 @if $(CC) -v 2>&1 | grep -is 'gcc version 2\.96' > /dev/null; \
257 then \
258 echo 'gcc 2.96 is unsuitable for compiling Etherboot'; \
259 echo 'Use gcc 2.95 or gcc 3.x instead'; \
260 exit 1; \
261 else \
262 touch $(BIN)/toolcheck; \
263 fi; \
264 if [ `perl -e 'use bytes; print chr(255)' | wc -c` = 2 ]; \
265 then \
266 echo 'Your Perl version has a Unicode handling bug'; \
267 echo 'To workaround, execute this before compiling Etherboot:'; \
268 echo 'export LANG=$${LANG%.UTF-8}'; \
269 exit 1; \
270 fi
271
272include arch/$(ARCH)/Makefile
273
274# Common files
275
276$(BLIB): $(BOBJS)
277 $(AR) r $@ $(BOBJS)
278 $(RANLIB) $@
279
280$(FILOLIB): $(FILO_OBJS)
281 $(AR) r $@ $(FILO_OBJS)
282 $(RANLIB) $@
283
284# LinuxBIOS support code
285$(BIN)/linuxbios.o: firmware/linuxbios/linuxbios.c include/etherboot.h include/dev.h firmware/linuxbios/linuxbios_tables.h
286
287# Do not add driver specific dependencies here unless it's something the
288# genrules.pl script *can't* deal with, i.e. if it is not C code.
289
290$(FILO)/config.h: $(FILO)/Config
291 /bin/echo -e '/* GENERATED FILE, DO NOT EDIT */\n' >$@
292 sed -e 's/#.*//' -e '/=/!d' -e 's/\([^[:space:]]*\)[[:space:]]*=[[:space:]]*\(.*\).*/#define \1 \2/' -e 's/^#define \([^ ]*\) 0$$/#undef \1/' $^ >>$@
293
294filo_version: $(FILO)/main/version.h
295
296$(FILO)/main/version.h: FORCE
297 echo '#define PROGRAM_NAME "$(FILO_PROGRAM_NAME)"' > $@
298 echo '#define PROGRAM_VERSION "$(FILO_PROGRAM_VERSION) $(FILO_BUILD_INFO)"' >> $@
299
300FORCE:
301
302
303# Utilities
304
305$(BIN)/lzhuf: util/lzhuf.c
306 $(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -o $@ $<
307
308# Roms file
309# Builds almost silently because this rule is triggered for just about
310# every modification to sources.
311
312$(BIN)/Roms $(BIN)/NIC: genrules.pl Families $(SRCS)
313 @mkdir -p $(@D)
314 @echo Scanning for ROMs and dependencies...
315 @$(PERL) ./genrules.pl Families $(BIN)/NIC $(ARCH) $(SRCS) > $(BIN)/Roms
316
317# Pattern Rules
318
319# general rules for compiling/assembling source files
320$(BIN)/%.o: core/%.c $(MAKEDEPS)
321 $(CC) $(CFLAGS) -o $@ -c $<
322
323$(BIN)/%.s: core/%.c $(MAKEDEPS)
324 $(CC) $(CFLAGS) -S -o $@ -c $<
325
326$(BIN)/%.o: drivers/disk/%.c $(MAKEDEPS)
327 $(CC) $(CFLAGS) -o $@ -c $<
328
329$(BIN)/%.o: drivers/net/%.c $(MAKEDEPS)
330 $(CC) $(CFLAGS) -o $@ -c $<
331
332$(BIN)/%.o: firmware/linuxbios/%.c $(MAKEDEPS)
333 $(CC) $(CFLAGS) -o $@ -c $<
334
335$(BIN)/%.o: $(FILO)/drivers/%.c $(MAKEDEPS) $(FILO)/config.h
336 $(CC) $(CFLAGS) -imacros $(FILO)/config.h -o $@ -c $<
337
338$(BIN)/%.o: $(FILO)/fs/%.c $(MAKEDEPS) $(FILO)/config.h
339 $(CC) $(CFLAGS) -imacros $(FILO)/config.h -o $@ -c $<
340
341$(BIN)/%.o: $(FILO)/$(ARCH)/%.c $(MAKEDEPS) $(FILO)/config.h
342 $(CC) $(CFLAGS) -imacros $(FILO)/config.h -o $@ -c $<
343
344$(BIN)/%.o: $(FILO)/$(ARCH)/%.S $(MAKEDEPS) $(FILO)/config.h
345 $(CPP) $(CFLAGS) -Ui386 -D ASSEMBLY $< | $(AS) $(ASFLAGS) -o $@
346
347$(BIN)/%.o: $(FILO)/main/%.c $(MAKEDEPS) $(FILO)/config.h filo_version
348 $(CC) $(CFLAGS) -imacros $(FILO)/config.h -o $@ -c $<
349
350$(BIN)/%.o: $(FILO)/usb/%.c $(MAKEDEPS) $(FILO)/config.h
351 $(CC) $(CFLAGS) -imacros $(FILO)/config.h -o $@ -c $<
352
353# Rule for the super etherboot image.
354$(BIN)/etherboot.o: $(DOBJS)
355 $(LD) $(LDFLAGS) -r $(DOBJS) -o $@
356
357$(BIN)/etherboot-pci.o: $(PCIOBJS)
358 $(LD) $(LDFLAGS) -r $(PCIOBJS) -o $@
359
360# General rules for generating runtime (rt) files
361$(BIN)/%.rt.o: $(BIN)/%.o $(START) $(BIN)/config.o $(LIBS) $(STDDEPS) $(MAKEDEPS)
362 $(LD) $(LDFLAGS) -r $(START) $(BIN)/config.o $< $(LIBS) -o $@
363
364# Rule for $(BIN)/%.FORMAT.rt is architecture and target-format specific
365
366$(BIN)/%.rt.bin: $(BIN)/%.rt $(MAKEDEPS)
367 $(OBJCOPY) -O binary -R .prefix $< $@
368
369$(BIN)/%.rt1.bin: $(BIN)/%.rt $(MAKEDEPS)
370 $(OBJCOPY) -O binary -j .text.nocompress $< $@
371
372$(BIN)/%.rt2.bin: $(BIN)/%.rt $(MAKEDEPS)
373 $(OBJCOPY) -O binary -R .prefix -R .text.nocompress $< $@
374
375# Rules for generating prefix binary files
376
377# Rule for $(BIN)/%.FORMAT.prf is architecture and target-format specific
378$(BIN)/%.prf.bin: $(BIN)/%.prf $(MAKEDEPS)
379 $(OBJCOPY) -j .prefix -O binary $< $@
380
381# general rule for .z (compressed binary code), may be overridden
382$(BIN)/%.zbin: $(BIN)/%.bin $(BIN)/nrv2b $(MAKEDEPS)
383 $(BIN)/nrv2b e $< $@
384
385# Housekeeping
386
387clean:
388 $(RM) $(BIN)/*
389 $(RM) $(FILO)/config.h $(FILO)/main/version.h
390
391../index.html: ../index.xhtml
392 (cd ..; m4 -P -DHOSTSITE=SOURCEFORGE index.xhtml > index.html)
393
394../index-berlios.html: ../index.xhtml
395 (cd ..; m4 -P -DHOSTSITE=BERLIOS index.xhtml > index-berlios.html)
396
397tarball: ../index.html ../index-berlios.html
398 (echo -n $(VERSION) ''; date -u +'%Y-%m-%d') > ../VERSION
399 (cd ../..; tar cf /tmp/etherboot-$(VERSION).tar --exclude CVS --exclude etherboot-$(VERSION))
400 bzip2 -9 < /tmp/etherboot-$(VERSION).tar > /tmp/etherboot-$(VERSION).tar.bz2
401 gzip -9 < /tmp/etherboot-$(VERSION).tar > /tmp/etherboot-$(VERSION).tar.gz
402
403cvs-tarball: ../index.html ../index-berlios.html
404 (echo -n $(VERSION) ''; date -u +'%Y-%m-%d') > ../VERSION
405 rm -rf /tmp/etherboot-$(VERSION)
406 mkdir /tmp/etherboot-$(VERSION)
407 cp -rP .. /tmp/etherboot-$(VERSION)
408 ( cd /tmp; tar cf /tmp/etherboot-$(VERSION).tar --exclude CVS --exclude "#*" \
409 --exclude "*~" etherboot-$(VERSION) )
410 bzip2 -9 < /tmp/etherboot-$(VERSION).tar > /tmp/etherboot-$(VERSION).tar.bz2
411 gzip -9 < /tmp/etherboot-$(VERSION).tar > /tmp/etherboot-$(VERSION).tar.gz
412 ( cd /tmp; rm -rf /tmp/etherboot-$(VERSION) ; rm /tmp/etherboot-$(VERSION).tar ; \
413 tar -zxf /tmp/etherboot-$(VERSION).tar.gz )
414
415# If static boot info is used, all static values must be supplied
416
417ifneq ($(findstring -DUSE_STATIC_BOOT_INFO, $(CFLAGS)),)
418
419ifeq ($(findstring -DSTATIC_CLIENT_IP, $(CFLAGS)),)
420$(error "-DUSE_STATIC_BOOT_INFO defined, but -DSTATIC_CLIENT_IP not defined!")
421endif
422
423ifeq ($(findstring -DSTATIC_SUBNET_MASK, $(CFLAGS)),)
424$(error "-DUSE_STATIC_BOOT_INFO defined, but -DSTATIC_SUBNET_MASK not defined!")
425endif
426
427ifeq ($(findstring -DSTATIC_SERVER_IP, $(CFLAGS)),)
428$(error "-DUSE_STATIC_BOOT_INFO defined, but -DSTATIC_SERVER_IP not defined!")
429endif
430
431ifeq ($(findstring -DSTATIC_GATEWAY_IP, $(CFLAGS)),)
432$(error "-DUSE_STATIC_BOOT_INFO defined, but -DSTATIC_GATEWAY_IP not defined!")
433endif
434
435ifeq ($(findstring -DSTATIC_BOOTFILE, $(CFLAGS)),)
436$(error "-DUSE_STATIC_BOOT_INFO defined, but -DSTATIC_BOOTFILE not defined!")
437endif
438
439endif
440
441# PXE Support requires TFTP protocol
442ifeq ($(findstring -DDOWNLOAD_PROTO_TFTP, $(CFLAGS)),)
443
444ifneq ($(findstring -DPXE_IMAGE, $(CFLAGS)),)
445$(error "-DPXE_IMAGE support requires TFTP support (-DDOWNLOAD_PROTO_TFTP)")
446endif
447
448ifneq ($(findstring -DPXE_EXPORT, $(CFLAGS)),)
449$(error "-DPXE_EXPORT support requires TFTP support (-DDOWNLOAD_PROTO_TFTP)")
450endif
451
452endif
453
454# Auto-incrementing build serial number. Is auto-incremented for each
455# make run that specifies a final image file (e.g. bin/undi.zpxe) as a
456# target, or a target of the form "all*". Enable via -DBUILD_SERIAL
457# in Config.
458
459ifneq ($(findstring -DBUILD_SERIAL,$(CFLAGS)),)
460
461# If no make goals are specified, it means "make all"
462REALGOALS = $(if $(MAKECMDGOALS),$(MAKECMDGOALS),all)
463
464# Filter to see if there are any targets to trigger an auto-increment
465BUILDGOALS = $(filter all,$(REALGOALS)) $(filter all%,$(REALGOALS)) \
466 $(foreach SUFFIX,$(SUFFIXES),$(filter %.$(SUFFIX),$(REALGOALS)))
467
468ifneq ($(strip $(BUILDGOALS)),)
469# This is an auto-incrementing build. Forcibly rebuild .buildserial.h
470# and mark config.o as depending on it to force its rebuilding.
471bin/config.o : include/.buildserial.h
472.PHONY : include/.buildserial.h
473endif # BUILDGOALS
474
475include/.buildserial.h :
476 @if [ ! -f $@ ]; then echo '#define BUILD_SERIAL_NUM 0' > $@; fi
477 @perl -pi -e 's/(BUILD_SERIAL_NUM)\s+(\d+)/"$${1} ".($${2}+1)/e' $@
478
479buildserial : include/.buildserial.h
480 @perl -n -e '/BUILD_SERIAL_NUM\s+(\d+)/ && ' \
481 -e 'print "Build serial number is $$1\n";' $<
482
483else # -DBUILD_SERIAL
484
485buildserial :
486 @echo Build serial number is disabled. Enable -DBUILD_SERIAL in Config.
487
488endif # -DBUILD_SERIAL
489
490bs : buildserial
491
492version:
493 @echo $(VERSION)
494
495romlimit:
496 @echo $(ROMLIMIT)
497
498sources:
499 @echo $(SRCS)
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette