]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/pc64/mkfile
merge
[plan9front.git] / sys / src / 9 / pc64 / mkfile
1 CONF=pc64
2 CONFLIST=pc64 pccpu64
3
4 objtype=amd64
5 </$objtype/mkfile
6 p=9
7
8 KTZERO=0xffffffff80110000
9 APBOOTSTRAP=0xffffffff80003000
10 REBOOTADDR=0x11000
11
12 DEVS=`{rc ../port/mkdevlist $CONF}
13
14 PORT=\
15         alarm.$O\
16         alloc.$O\
17         allocb.$O\
18         auth.$O\
19         cache.$O\
20         chan.$O\
21         dev.$O\
22         edf.$O\
23         fault.$O\
24         page.$O\
25         parse.$O\
26         pgrp.$O\
27         portclock.$O\
28         print.$O\
29         proc.$O\
30         qio.$O\
31         qlock.$O\
32         rdb.$O\
33         rebootcmd.$O\
34         segment.$O\
35         swap.$O\
36         syscallfmt.$O\
37         sysfile.$O\
38         sysproc.$O\
39         taslock.$O\
40         tod.$O\
41         xalloc.$O\
42
43 OBJ=\
44         l.$O\
45         cga.$O\
46         i8253.$O\
47         i8259.$O\
48         main.$O\
49         memory.$O\
50         mmu.$O\
51         trap.$O\
52         pcrandom.$O\
53         $CONF.root.$O\
54         $CONF.rootc.$O\
55         $DEVS\
56         $PORT\
57
58 LIB=\
59         /$objtype/lib/libmemlayer.a\
60         /$objtype/lib/libmemdraw.a\
61         /$objtype/lib/libdraw.a\
62         /$objtype/lib/libip.a\
63         /$objtype/lib/libsec.a\
64         /$objtype/lib/libmp.a\
65         /$objtype/lib/libc.a\
66         /$objtype/lib/libfis.a\
67         /$objtype/lib/libaml.a\
68
69 ETHER=`{cd ../pc; echo devether.c ether*.c | sed 's/\.c/.'$O'/g'}
70 AUDIO=`{cd ../pc; echo devaudio.c audio*.c | sed 's/\.c/.'$O'/g'}
71 VGA=`{cd ../pc; echo devvga.c screen.c vga*.c | sed 's/\.c/.'$O'/g'}
72 SDEV=`{cd ../pc; echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
73
74 $p$CONF:        $CONF.c $OBJ $LIB
75         $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
76         $LD -o $target -T$KTZERO -R4096 -l $OBJ $CONF.$O $LIB
77         size $target
78
79 install:V:      $p$CONF
80         cp $p$CONF /$objtype/
81         for(i in $EXTRACOPIES)
82                 import $i / /n/$i && cp $p$CONF $p$CONF.gz /n/$i/$objtype/
83
84
85 # copies generated by the rule below
86 PCHEADERS=wifi.h uncached.h usbehci.h screen.h etherif.h ethermii.h mp.h io.h ahci.h
87
88 REPCH=`{echo $PCHEADERS | sed 's/\.h//g; s/ /|/g'}
89 ^($REPCH)\.h:R: '../pc/\1.h'
90         cp $prereq .
91
92 REPCC=`{../port/mkfilelist ../pc}
93 ^($REPCC)\.$O:R:        '../pc/\1.c'
94         $CC $CFLAGS -I. -. ../pc/$stem1.c
95
96 <../boot/bootmkfile
97 <../port/portmkfile
98 <|../port/mkbootrules $CONF
99
100 l.$O apbootstrap.$O:            mem.h
101
102 $ETHER:                         etherif.h ../port/netif.h
103 $AUDIO:                         ../port/audioif.h
104 ether8003.$O ether8390.$O:      ether8390.h
105 etheryuk.$O:                    yukdump.h
106 $VGA mouse.$O:                  screen.h /sys/include/memdraw.h
107 vgavesa.$O:                     /386/include/ureg.h
108
109 archmp.$O mp.$O:                apbootstrap.h
110 apic.$O archmp.$O mp.$O:        mp.h
111 squidboy.$O:                    mp.h
112
113 $SDEV:                          ../port/sd.h
114 sdiahci.$O:                     ahci.h
115 devaoe.$O sdaoe.$O:             ../port/aoe.h
116
117 main.$O:                        init.h reboot.h
118
119 devusb.$O usbuhci.$O usbohci.$O usbehci.$O: ../port/usb.h
120 usbehci.$O:                     usbehci.h uncached.h
121 trap.$O:                        /sys/include/tos.h
122 ethermii.$O:                    ethermii.h
123 etheriwl.$O:                    wifi.h
124 etherrt2860.$O:                 wifi.h
125 wifi.$O:                        wifi.h
126
127 init.h:D:               ../port/initcode.c ../pc/init9.c
128         $CC ../port/initcode.c
129         $CC ../pc/init9.c
130         $LD -l -R1 -s -o init.out init9.$O initcode.$O /$objtype/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:       rebootcode.s
137         $AS rebootcode.s
138         $LD -l -R1 -s -o reboot.out -T$REBOOTADDR rebootcode.$O
139         {echo 'uchar rebootcode[]={'
140          dd -if reboot.out -bs 1 -iseek 40 | 
141          xd -1x |
142          sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
143          echo '};'} > $target
144
145 apbootstrap.h:  apbootstrap.s
146         $AS apbootstrap.s
147         $LD -l -R1 -s -o apbootstrap.out -T$APBOOTSTRAP apbootstrap.$O
148         {echo 'uchar apbootstrap[]={'
149          dd -if apbootstrap.out -bs 1 -iseek 40 | 
150          xd -1x |
151          sed -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 acid:V:
158         $CC -a -w main.c>acid
159
160 %.clean:V:
161         rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* apbootstrap.h reboot.h init.h $PCHEADERS