]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/pc/mkfile
pc kernel: split mpstartap() and squidboy into separate file... stuff for amd64
[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         syscallfmt.$O\
40         sysfile.$O\
41         sysproc.$O\
42         taslock.$O\
43         tod.$O\
44         xalloc.$O\
45
46 OBJ=\
47         l.$O\
48         cga.$O\
49         i8253.$O\
50         i8259.$O\
51         main.$O\
52         memory.$O\
53         mmu.$O\
54         trap.$O\
55         pcrandom.$O\
56         $CONF.root.$O\
57         $CONF.rootc.$O\
58         $DEVS\
59         $PORT\
60
61 LIB=\
62         /$objtype/lib/libmemlayer.a\
63         /$objtype/lib/libmemdraw.a\
64         /$objtype/lib/libdraw.a\
65         /$objtype/lib/libip.a\
66         /$objtype/lib/libc.a\
67         /$objtype/lib/libsec.a\
68         /$objtype/lib/libmp.a\
69         /$objtype/lib/libfis.a\
70         /$objtype/lib/libaml.a\
71
72 ETHER=`{echo devether.c ether*.c | sed 's/\.c/.'$O'/g'}
73 AUDIO=`{echo devaudio.c audio*.c | sed 's/\.c/.'$O'/g'}
74 VGA=`{echo devvga.c screen.c vga*.c | sed 's/\.c/.'$O'/g'}
75 SDEV=`{echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
76
77 $p$CONF:        $CONF.c $OBJ $LIB
78         $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
79         $LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
80         size $target
81
82 # don't strip the gzipped kernels -- too frustrating when that's all you have!
83 $p%.gz:D:       $p%
84         gzip -9 <$p$stem >$p$stem.gz
85
86
87 # pcflop and pccd need all the space they can get
88 9pcflop.gz:D: 9pcflop
89         strip -o /fd/1 9pcflop | gzip -9 >9pcflop.gz
90
91 9pccd.gz:D: 9pccd
92         strip -o /fd/1 9pccd | gzip -9 >9pccd.gz
93
94
95 install:V:      $p$CONF
96         cp $p$CONF /$objtype/
97         for(i in $EXTRACOPIES)
98                 import $i / /n/$i && cp $p$CONF $p$CONF.gz /n/$i/$objtype/
99
100 <../boot/bootmkfile
101 <../port/portmkfile
102 <|../port/mkbootrules $CONF
103
104 $ETHER:                         etherif.h ../port/netif.h
105 $AUDIO:                         ../port/audioif.h
106 ether8003.$O ether8390.$O:      ether8390.h
107 etheryuk.$O:                    yukdump.h
108 $VGA mouse.$O:                  screen.h /sys/include/memdraw.h
109 vgavesa.$O:                     /386/include/ureg.h
110 devfloppy.$O:                   floppy.h
111 archmp.$O mp.$O:                apbootstrap.h
112 apic.$O archmp.$O mp.$O:        mp.h
113 squidboy.$O:                    mp.h
114 $SDEV:                          ../port/sd.h
115 sd53c8xx.$O:                    sd53c8xx.i
116 sdiahci.$O:                     ahci.h
117 devaoe.$O sdaoe.$O:             ../port/aoe.h
118 main.$O:                        init.h reboot.h
119 wavelan.$O:                     wavelan.c ../pc/wavelan.c ../pc/wavelan.h
120 etherwavelan.$O:                etherwavelan.c ../pc/wavelan.h
121 devusb.$O usbuhci.$O usbohci.$O usbehci.$O: ../port/usb.h
122 trap.$O:                        /sys/include/tos.h
123 uartaxp.$O:                     uartaxp.i
124 etherm10g.$O:                   etherm10g2k.i etherm10g4k.i
125 etheriwl.$O:                    wifi.h
126 etherrt2860.$O:                 wifi.h
127 wifi.$O:                        wifi.h
128
129 init.h:D:               ../port/initcode.c init9.c
130         $CC ../port/initcode.c
131         $CC init9.c
132         $LD -l -R1 -s -o init.out init9.$O initcode.$O /386/lib/libc.a
133         {echo 'uchar initcode[]={'
134          xd -1x <init.out |
135                 sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
136          echo '};'} > init.h
137
138 reboot.h:D:     rebootcode.s
139         $AS rebootcode.s
140         $LD -l -s -T0x11000 -R4 -o reboot.out rebootcode.$O
141         {echo 'uchar rebootcode[]={'
142          xd -1x reboot.out |
143                 sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
144          echo '};'} > reboot.h
145
146 apbootstrap.h:  apbootstrap.s mem.h
147         $AS $prereq
148         $LD -o apbootstrap.out -T$APBOOTSTRAP -R4 -l -s apbootstrap.$O
149         {echo 'uchar apbootstrap[]={'
150          xd -1x apbootstrap.out |
151                 sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
152          echo '};'} > $target
153
154 sd53c8xx.i:     sd53c8xx.n
155         aux/na $prereq > $target
156
157 uartaxp.i:      a100p.cp
158         {echo 'static uchar uartaxpcp[] = {'
159          xd -1x $prereq |
160                 sed -e 's/^[0-9a-f]+ //' -e '/^$/d' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
161          echo '};'
162         } > $target
163
164 etherm10g%.i:   etherm10g%.fw
165         {echo 'static char fw'^$stem^'[] = {'
166          xd -1x $prereq |
167                 sed -e 's/^[0-9a-f]+ //' -e '/^$/d' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
168          echo '};'
169         } > $target
170
171 acid:V:
172         8c -a -w -I. i8253.c>acid
173
174 %.checkether:VQ:
175         for (i in ether*.c){
176                 x=`{echo $i | sed 's/\.c//'}
177                 if(! ~ $x ether8390 && ! grep -s '^     '^$x^'([        ]|$)' $stem)
178                         echo $x not included in $stem
179         }
180         exit 0
181
182 %.checkvga:VQ:
183         for (i in vga*.c){
184                 x=`{echo $i | sed 's/\.c//'}
185                 if(! ~ $x vga vgax vgasavage && ! grep -s '^    '^$x^'([        ]|$)' $stem)
186                         echo $x not included in $stem
187         }
188         exit 0
189
190 checkdist:VQ:
191         for(i in pcdisk pcflop)
192         for(j in checkvga checkether)
193                 mk $i.$j
194
195 %.clean:V:
196         rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h init.h