-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
84 lines (67 loc) · 2.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
BASEURL=http://ipxe.example.com
# ============================================================================
# Desired end results:
#
# See http://etherboot.org/wiki/romburning/vbox
# Default for Most Guest VM OS Choices
all:: 10222000.rom
# Intel PRO/1000 MT Desktop (82540EM) Default for Windows Vista/Windows 7 VMs
all:: 8086100e.rom
# The full featured 'second stage' version that doesn't fit into the ROM
all:: menuloader.pxe
# ============================================================================
ipxe-full:
@echo Downloading the iPXE sources
git clone git://git.ipxe.org/ipxe.git $@
-@rm -f ipxe-full/src/config/local/general.h
-@rm -f ipxe-full/src/config/local/console.h
ipxe-full/src/config/local/general.h: general-full.h ipxe-full
cp $< $@
ipxe-full/src/config/local/console.h: console-full.h ipxe-full
cp $< $@
clean::
-@[ -d ipxe-full ] && cd ipxe-full/src && make clean
-@rm -f ipxe-full/src/config/local/general.h
-@rm -f ipxe-rom/src/config/local/console.h
ipxe-rom: ipxe-full
@echo Downloading the iPXE sources
@cp -a $< $@
-@rm -f ipxe-rom/src/config/local/general.h
clean::
-@[ -d ipxe-rom ] && cd ipxe-rom/src && make clean
ipxe-rom/src/config/local/general.h: general-rom.h ipxe-rom
cp $< $@
clean::
-@rm -f ipxe-rom/src/config/local/general.h
.PRECIOUS:script-%.ipxe
script-%.ipxe:script-%.ipxe.in Makefile
cat $< | sed 's@##BASEURL##@${BASEURL}@g' > $@
clean::
-@rm -f script-*.ipxe
%.rom: script-rom.ipxe ipxe-rom Makefile ipxe-rom/src/config/local/general.h
@echo Building $@
@( \
cd ipxe-rom/src ;\
make -j4 bin/$@ EMBED=../../$< ;\
cp bin/$@ ../..;\
)
@( \
if [ $$(wc -c "$@" | cut -f 1 -d ' ') -gt 57344 ] ; \
then \
echo "The size of the ROM is larger than 0xE000 (=57344) bytes and so it WILL NOT LOAD" ; \
exit -1;\
else \
echo "The $@ ROM fits." ; \
fi \
)
clean::
rm -f *.rom *.iso
menuloader.pxe: script-full.ipxe ipxe-full Makefile ipxe-full/src/config/local/general.h ipxe-full/src/config/local/console.h
@echo Building $@
@( \
cd ipxe-full/src ;\
make -j4 bin/ipxe.pxe EMBED=../../$< ;\
cp bin/ipxe.pxe ../../$@;\
)
clean::
rm -f menuloader.pxe