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