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