]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/pc/mkfile
boot(8): replace bzfs with paqfs
[plan9front.git] / sys / src / 9 / pc / mkfile
1 CONF=pcf
2 CONFLIST=pcf pccpuf
3 CRAPLIST=pc pccpu pccd pcflop
4 EXTRACOPIES=
5 #EXTRACOPIES=lookout boundary   # copy to these servers on install
6
7 objtype=386
8 </$objtype/mkfile
9 p=9
10
11 # must match mem.h
12 APBOOTSTRAP=0xF0003000
13 KTZERO=0xF0100020
14
15 DEVS=`{rc ../port/mkdevlist $CONF}
16
17 PORT=\
18         alarm.$O\
19         alloc.$O\
20         allocb.$O\
21         auth.$O\
22         cache.$O\
23         chan.$O\
24         dev.$O\
25         edf.$O\
26         fault.$O\
27         page.$O\
28         parse.$O\
29         pgrp.$O\
30         portclock.$O\
31         print.$O\
32         proc.$O\
33         qio.$O\
34         qlock.$O\
35         rdb.$O\
36         rebootcmd.$O\
37         segment.$O\
38         swap.$O\
39         sysfile.$O\
40         sysproc.$O\
41         taslock.$O\
42         tod.$O\
43         xalloc.$O\
44
45 OBJ=\
46         l.$O\
47         plan9l.$O\
48         cga.$O\
49         i8253.$O\
50         i8259.$O\
51         main.$O\
52         memory.$O\
53         mmu.$O\
54         random.$O\
55         syscallfmt.$O\
56         trap.$O\
57         $CONF.root.$O\
58         $CONF.rootc.$O\
59         $DEVS\
60         $PORT\
61
62 LIB=\
63         /$objtype/lib/libmemlayer.a\
64         /$objtype/lib/libmemdraw.a\
65         /$objtype/lib/libdraw.a\
66         /$objtype/lib/libip.a\
67         /$objtype/lib/libc.a\
68         /$objtype/lib/libsec.a\
69         /$objtype/lib/libmp.a\
70
71 ETHER=`{echo devether.c ether*.c | sed 's/\.c/.'$O'/g'}
72 VGA=`{echo devvga.c screen.c vga*.c | sed 's/\.c/.'$O'/g'}
73 SDEV=`{echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
74
75 $p$CONF:        $CONF.c $OBJ $LIB
76         $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
77         $LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
78         size $target
79
80 # don't strip the gzipped kernels -- too frustrating when that's all you have!
81 $p%.gz:D:       $p%
82         gzip -9 <$p$stem >$p$stem.gz
83
84
85 # pcflop and pccd need all the space they can get
86 9pcflop.gz:D: 9pcflop
87         strip -o /fd/1 9pcflop | gzip -9 >9pcflop.gz
88
89 9pccd.gz:D: 9pccd
90         strip -o /fd/1 9pccd | gzip -9 >9pccd.gz
91
92
93 install:V:      $p$CONF
94         cp $p$CONF /$objtype/
95         for(i in $EXTRACOPIES)
96                 import $i / /n/$i && cp $p$CONF $p$CONF.gz /n/$i/$objtype/
97
98 <../boot/bootmkfile
99 <../port/portmkfile
100 <|../port/mkbootrules $CONF
101
102 $ETHER:                         etherif.h ../port/netif.h
103 ether8003.$O ether8390.$O:      ether8390.h
104 $VGA mouse.$O:                  screen.h /sys/include/memdraw.h
105 devfloppy.$O:                   floppy.h
106 archmp.$O mp.$O:                apbootstrap.h
107 apic.$O archmp.$O mp.$O:        mp.h
108 $SDEV:                          ../port/sd.h
109 sd53c8xx.$O:                    sd53c8xx.i
110 sdiahci.$O:                     ahci.h
111 devaoe.$O sdaoe.$O:             ../port/aoe.h
112 main.$O:                        init.h reboot.h
113 wavelan.$O:                     wavelan.c ../pc/wavelan.c ../pc/wavelan.h
114 etherwavelan.$O:                etherwavelan.c ../pc/wavelan.h
115 devusb.$O usbuhci.$O usbohci.$O usbehci.$O: ../port/usb.h
116 trap.$O:                        /sys/include/tos.h
117 uartaxp.$O:                     uartaxp.i
118 etherm10g.$O:                   etherm10g2k.i etherm10g4k.i
119
120 init.h:D:               ../port/initcode.c init9.c
121         $CC ../port/initcode.c
122         $CC init9.c
123         $LD -l -R1 -s -o init.out init9.$O initcode.$O /386/lib/libc.a
124         {echo 'uchar initcode[]={'
125          xd -1x <init.out |
126                 sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
127          echo '};'} > init.h
128
129 reboot.h:D:     rebootcode.s
130         $AS rebootcode.s
131         $LD -l -s -T0x11000 -R4 -o reboot.out rebootcode.$O
132         {echo 'uchar rebootcode[]={'
133          xd -1x reboot.out |
134                 sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
135          echo '};'} > reboot.h
136
137 apbootstrap.h:  apbootstrap.s mem.h
138         $AS $prereq
139         $LD -o apbootstrap.out -T$APBOOTSTRAP -R4 -l -s apbootstrap.$O
140         {echo 'uchar apbootstrap[]={'
141          xd -1x apbootstrap.out |
142                 sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
143          echo '};'} > $target
144
145 sd53c8xx.i:     sd53c8xx.n
146         aux/na $prereq > $target
147
148 uartaxp.i:      a100p.cp
149         {echo 'static uchar uartaxpcp[] = {'
150          xd -1x $prereq |
151                 sed -e 's/^[0-9a-f]+ //' -e '/^$/d' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
152          echo '};'
153         } > $target
154
155 etherm10g%.i:   etherm10g%.fw
156         {echo 'static char fw'^$stem^'[] = {'
157          xd -1x $prereq |
158                 sed -e 's/^[0-9a-f]+ //' -e '/^$/d' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
159          echo '};'
160         } > $target
161
162 acid:V:
163         8c -a -w -I. i8253.c>acid
164
165 %.checkether:VQ:
166         for (i in ether*.c){
167                 x=`{echo $i | sed 's/\.c//'}
168                 if(! ~ $x ether8390 && ! grep -s '^     '^$x^'([        ]|$)' $stem)
169                         echo $x not included in $stem
170         }
171         exit 0
172
173 %.checkvga:VQ:
174         for (i in vga*.c){
175                 x=`{echo $i | sed 's/\.c//'}
176                 if(! ~ $x vga vgax vgasavage && ! grep -s '^    '^$x^'([        ]|$)' $stem)
177                         echo $x not included in $stem
178         }
179         exit 0
180
181 checkdist:VQ:
182         for(i in pcdisk pcflop)
183         for(j in checkvga checkether)
184                 mk $i.$j
185
186 %.clean:V:
187         rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h init.h