]> git.lizzy.rs Git - plan9front.git/blob - sys/src/boot/efi/mkfile
merge
[plan9front.git] / sys / src / boot / efi / mkfile
1 TARG=bootia32.efi bootx64.efi efiboot.fat
2 HFILES=fns.h mem.h
3 IMAGEBASE=0x8000
4 CFLAGS=-FTVw
5 PEFLAGS=$CFLAGS '-DIMAGEBASE='$IMAGEBASE
6
7 all:V: $TARG
8
9 install:V: $TARG
10         cp $prereq /386
11
12 bootia32.efi:   pe32.8 efi.8 fs.8 pxe.8 iso.8 sub.8
13         8l -l -H3 -T$IMAGEBASE -o $target $prereq
14
15 pe32.8: pe32.s
16         8a $PEFLAGS pe32.s
17
18 efi.8:  efi.c efi.h
19         8c $CFLAGS efi.c
20
21 fs.8:   fs.c efi.h
22         8c $CFLAGS fs.c
23
24 pxe.8:  pxe.c efi.h
25         8c $CFLAGS pxe.c
26
27 iso.8:  iso.c efi.h
28         8c $CFLAGS iso.c
29
30 sub.8:  sub.c
31         8c $CFLAGS sub.c
32
33 %.8:    $HFILES
34
35
36 bootx64.efi:    pe64.6 efi.6 fs.6 pxe.6 iso.6 sub.6
37         6l -l -s -R1 -T$IMAGEBASE -o bootx64.out $prereq
38         dd -if bootx64.out -bs 1 -iseek 40 >$target
39
40 pe64.6: pe64.s
41         6a $PEFLAGS pe64.s
42
43 efi.6:  efi.c efi.h
44         6c $CFLAGS efi.c
45
46 fs.6:   fs.c efi.h
47         6c $CFLAGS fs.c
48
49 pxe.6:  pxe.c efi.h
50         6c $CFLAGS pxe.c
51
52 iso.6:  iso.c efi.h
53         6c $CFLAGS iso.c
54
55 sub.6:  sub.c
56         6c $CFLAGS sub.c
57
58 %.6:    $HFILES
59
60 efiboot.fat:D:  bootia32.efi bootx64.efi
61         s = $target.$pid
62         rm -f $target
63         dd -if /dev/zero -of $target -bs 1024 -count 1024
64         disk/format -xd -t hard $target
65         dossrv -f $target $s
66         mount -c /srv/$s /n/esp
67         mkdir /n/esp/efi
68         mkdir /n/esp/efi/boot
69         cp bootia32.efi /n/esp/efi/boot
70         cp bootx64.efi /n/esp/efi/boot
71         unmount /n/esp
72         rm /srv/$s
73
74
75 test.iso:D:     efiboot.fat
76         rm -fr tmp
77         mkdir tmp
78         mkdir tmp/cfg
79         mkdir tmp/386
80         cp efiboot.fat tmp/386
81         cp /386/9bootiso tmp/386
82         cp /386/9pc tmp/386
83         echo 'bootfile=/386/9pc' >tmp/cfg/plan9.ini
84         disk/mk9660 -B 386/9bootiso -E 386/efiboot.fat -p <{echo +} -s tmp $target
85         rm -r tmp
86
87 test.fat:D:     bootia32.efi bootx64.efi
88         s = $target.$pid
89         rm -f $target
90         dd -if /dev/zero -of $target -bs 65536 -count 128
91         disk/format -xd -t hard $target
92         dossrv -f $target $s
93         mount -c /srv/$s /n/esp
94         mkdir /n/esp/efi
95         mkdir /n/esp/efi/boot
96         cp bootia32.efi /n/esp/efi/boot
97         cp bootx64.efi /n/esp/efi/boot
98         cp /386/9pc /n/esp
99         echo 'bootfile=9pc' >/n/esp/plan9.ini
100         unmount /n/esp
101         rm /srv/$s
102
103
104 clean:V:
105         rm -f *.[68] *.out $TARG test.*