]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/pc/mkfile
bcm, bcm64: add support for device tree parameter passing
[plan9front.git] / sys / src / 9 / pc / mkfile
1 CONF=pc
2 CONFLIST=pc pcf pccpuf
3 EXTRACOPIES=
4 #EXTRACOPIES=lookout boundary   # copy to these servers on install
5
6 objtype=386
7 </$objtype/mkfile
8 p=9
9
10 # must match mem.h
11 KTZERO=0xF0100020
12 APBOOTSTRAP=0xF0007000
13 REBOOTADDR=0x11000
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         random.$O\
36         rdb.$O\
37         rebootcmd.$O\
38         segment.$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         bootargs.$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         /$objtype/lib/libdtracy.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:                         ../port/etherif.h ../port/netif.h
106 $AUDIO:                         ../port/audioif.h
107 ether8003.$O ether8390.$O:      ether8390.h
108 etheryuk.$O:                    yukdump.h
109 $VGA mouse.$O:                  screen.h /sys/include/memdraw.h
110 vgavesa.$O:                     /386/include/ureg.h
111 devfloppy.$O:                   floppy.h
112 archmp.$O mp.$O:                apbootstrap.h
113 apic.$O archmp.$O mp.$O:        mp.h
114 squidboy.$O:                    mp.h
115 $SDEV:                          ../port/sd.h
116 sd53c8xx.$O:                    sd53c8xx.i
117 sdiahci.$O:                     ahci.h
118 devaoe.$O sdaoe.$O:             ../port/aoe.h
119 main.$O:                        init.h reboot.h
120 wavelan.$O:                     wavelan.c ../pc/wavelan.c ../pc/wavelan.h
121 etherwavelan.$O:                etherwavelan.c ../pc/wavelan.h
122 devusb.$O usbuhci.$O usbohci.$O usbehci.$O usbehcipc.$O usbxhci.$O: ../port/usb.h
123 usbehci.$O usbehcipc.$O:        usbehci.h
124 trap.$O:                        /sys/include/tos.h
125 uartaxp.$O:                     uartaxp.i
126 ether8169.$O:                   ../port/ethermii.h
127 etherdp83820.$O:                ../port/ethermii.h
128 etherigbe.$O:                   ../port/ethermii.h
129 ethervgbe.$O:                   ../port/ethermii.h
130 ethervt6102.$O:                 ../port/ethermii.h
131 ethervt6105m.$O:                ../port/ethermii.h
132 etherm10g.$O:                   etherm10g2k.i etherm10g4k.i
133 etheriwl.$O:                    ../port/wifi.h
134 etherwpi.$O:                    ../port/wifi.h
135 etherrt2860.$O:                 ../port/wifi.h
136
137 init.h:D:               ../port/initcode.c init9.c
138         $CC ../port/initcode.c
139         $CC init9.c
140         $LD -l -R1 -s -o init.out init9.$O initcode.$O /386/lib/libc.a
141         {echo 'uchar initcode[]={'
142          xd -1x <init.out |
143                 sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
144          echo '};'} > init.h
145
146 reboot.h:D:     rebootcode.s mem.h
147         $AS rebootcode.s
148         $LD -l -s -T$REBOOTADDR -R4 -o reboot.out rebootcode.$O
149         {echo 'uchar rebootcode[]={'
150          xd -1x reboot.out |
151                 sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
152          echo '};'} > reboot.h
153
154 apbootstrap.h:D:        apbootstrap.s mem.h
155         $AS $prereq
156         $LD -o apbootstrap.out -T$APBOOTSTRAP -R4 -l -s apbootstrap.$O
157         {echo 'uchar apbootstrap[]={'
158          xd -1x apbootstrap.out |
159                 sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
160          echo '};'} > $target
161
162 sd53c8xx.i:     sd53c8xx.n
163         aux/na $prereq > $target
164
165 uartaxp.i:      a100p.cp
166         {echo 'static uchar uartaxpcp[] = {'
167          xd -1x $prereq |
168                 sed -e 's/^[0-9a-f]+ //' -e '/^$/d' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
169          echo '};'
170         } > $target
171
172 etherm10g%.i:   etherm10g%.fw
173         {echo 'static char fw'^$stem^'[] = {'
174          xd -1x $prereq |
175                 sed -e 's/^[0-9a-f]+ //' -e '/^$/d' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
176          echo '};'
177         } > $target
178
179 acid:V:
180         8c -a -w -I. i8253.c>acid
181
182 %.checkether:VQ:
183         for (i in ether*.c){
184                 x=`{echo $i | sed 's/\.c//'}
185                 if(! ~ $x ether8390 && ! grep -s '^     '^$x^'([        ]|$)' $stem)
186                         echo $x not included in $stem
187         }
188         exit 0
189
190 %.checkvga:VQ:
191         for (i in vga*.c){
192                 x=`{echo $i | sed 's/\.c//'}
193                 if(! ~ $x vga vgax vgasavage && ! grep -s '^    '^$x^'([        ]|$)' $stem)
194                         echo $x not included in $stem
195         }
196         exit 0
197
198 checkdist:VQ:
199         for(i in pcdisk pcflop)
200         for(j in checkvga checkether)
201                 mk $i.$j
202
203 %.clean:V:
204         rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h init.h