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