]> git.lizzy.rs Git - plan9front.git/blob - sys/src/boot/pc/mkfile
audiohda: fix syntax error
[plan9front.git] / sys / src / boot / pc / mkfile
1 objtype=386
2 </$objtype/mkfile
3 BIN=/386
4
5 TARG=9bootiso 9bootpxe 9bootfat 9boothyb mbr pbs
6
7 HFILES=mem.h fns.h x16.h
8
9 all: 9bootiso 9bootpxe 9bootfat 9boothyb mbr pbs
10         
11 clean:V:
12         rm -rf $TARG *.$O test.* tmp
13
14 liso.$O: l.s
15         $AS -DISO -o $target l.s
16
17 lpxe.$O: l.s
18         $AS -DPXE -o $target l.s
19
20 lfat.$O: l.s
21         $AS -DFAT -o $target l.s
22
23 lhyb.$O: l.s
24         $AS -DFAT -o $target l.s
25
26 hyb.$O: iso.c
27         $CC $CFLAGS -DFAT -o $target iso.c
28
29 %.$O:   %.s
30         $AS $stem.s
31
32 %.$O:   %.c
33         $CC $CFLAGS $stem.c
34
35 %.$O:   $HFILES
36
37 mbr:    mbr.$O
38         $LD -o $target -H3 -T0x0600 -l $prereq
39         ls -l $target
40
41 pbs:    pbs.$O
42         $LD -o $target -H3 -T0x0800 -l $prereq
43         ls -l $target
44
45 9boot&: l%.$O %.$O sub.$O apm.$O e820.$O a20.$O uart.$O
46         $LD -o $target -H3 -T0x7c00 -l $prereq
47         ls -l $target
48
49 install:V:
50         for (i in $TARG)
51                 mk $MKFLAGS $i.install
52
53 %.install:V:    $BIN/%
54         
55
56 $BIN/%: %
57         cp $stem $BIN/$stem
58
59 test.iso: 9bootiso 9boothyb 9bootfat mbr pbs
60         rm -fr tmp $target
61         mkdir tmp
62         mkdir tmp/386
63         mkdir tmp/cfg
64         cp 9bootiso tmp/386
65         cp /386/9pc tmp/386
66         cp /sys/lib/dist/cfg/plan9.ini tmp/cfg/plan9.ini
67         echo wait >>tmp/cfg/plan9.ini
68         disk/mk9660 -B 386/9bootiso -p <{echo +} -s tmp $target
69         @{rfork n
70                 bind 9boothyb 9bootfat
71                 dd -if /dev/zero -bs 512 -count 4096 >> $target
72                 disk/partfs -m /n/partfs $target
73                 disk=/n/partfs/sdXX
74                 disk/mbr -m mbr $disk/data
75                 @{echo a p1 '$-1' '$'
76                         echo t p1 FAT16
77                         echo A p1
78                         echo w
79                         echo q} | disk/fdisk -b $disk/data
80                 disk/format -b pbs -d -r 1 $disk/dos 9bootfat
81         }
82         rm -fr tmp
83
84 test.dsk: 9bootfat mbr pbs test.iso
85         rm -fr tmp $target
86         mkdir tmp
87         cp test.iso 9bootfat tmp
88         mkdir tmp/386
89         cp /386/9pc tmp/386
90         echo 'bootfile=/386/9pc' >tmp/plan9.ini
91         dd -if /dev/zero -of $target -bs 512 -count 32768
92         disk/partfs -m /n/$target $target
93         disk=/n/$target/sdXX
94         disk/mbr -m mbr $disk/data
95         disk/fdisk -baw $disk/data
96         disk/prep -bw -a 9fat $disk/plan9
97         disk/format -b pbs -d -r 2 $disk/9fat
98         s=$target.dos
99         m=/n/$target.9fat
100         rm -f /srv/$s
101         dossrv -f $disk/9fat $s
102         mount -c /srv/$s $m
103         @{cd tmp; tar c .} | @{cd $m; tar xv}
104         unmount $m
105         rm -f /srv/$s
106         unmount /n/$target
107         rm -fr tmp