]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/omap/mkfile
kernel: introduce devswap #ΒΆ to serve /dev/swap and handle swapfile encryption
[plan9front.git] / sys / src / 9 / omap / mkfile
1 CONF=beagle
2 CONFLIST=beagle
3
4 # allegedly u-boot uses the bottom 3MB (up to 0x300000) so avoid that,
5 # and leave 64K for plan9.ini.  loadaddr must match KTZERO in mem.h.
6 # 0xc0310000 has worked, 0x80310000 should work but doesn't yet.
7 loadaddr=0xc0310000
8
9 objtype=arm
10 </$objtype/mkfile
11 p=9
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         mul64fract.$O\
26         rebootcmd.$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         segment.$O\
36         sysfile.$O\
37         sysproc.$O\
38         taslock.$O\
39         tod.$O\
40         xalloc.$O\
41         random.$O\
42
43 OBJ=\
44         l.$O\
45         lexception.$O\
46         lproc.$O\
47         arch.$O\
48         clock.$O\
49         fpi.$O\
50         fpiarm.$O\
51         fpimem.$O\
52         main.$O\
53         mmu.$O\
54         trap.$O\
55         syscall.$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/libsec.a\
67         /$objtype/lib/libmp.a\
68         /$objtype/lib/libc.a\
69
70 9:V: $p$CONF s$p$CONF
71
72 $p$CONF:DQ:     $CONF.c $OBJ $LIB mkfile
73         $CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
74         echo '# linking raw kernel'
75         $LD -o $target -H0 -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
76
77 s$p$CONF:DQ:    $CONF.$O $OBJ $LIB
78         echo '# linking kernel with symbols'
79 #       $LD -o $target -R4096 -T$loadaddr -l -a $OBJ $CONF.$O $LIB >$target.list
80         $LD -o $target -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
81         size $target
82
83 $p$CONF.gz:D:   $p$CONF
84         gzip -9 <$p$CONF >$target
85
86 $OBJ: $HFILES
87
88 install:V: /$objtype/$p$CONF
89
90 /$objtype/$p$CONF:D: $p$CONF s$p$CONF
91         { cp -x $p$CONF s$p$CONF /$objtype } &
92         wait
93         touch $target
94
95 <../boot/bootmkfile
96 <../port/portmkfile
97 <|../port/mkbootrules $CONF
98
99 CFLAGS= -I. -I../port $CFLAGS   # hack to compile private sysproc.c (e.g.)
100
101 arch.$O clock.$O fpiarm.$O main.$O mmu.$O screen.$O sdscsi.$O syscall.$O \
102         trap.$O: /$objtype/include/ureg.h
103
104 archomap.$O devether.$0 ether9221.$O: etherif.h ../port/netif.h
105 archomap.$O devflash.$O flashbeagle.$O flashigep.$O: ../port/flashif.h
106 ecc.$O flashbeagle.$O flashigep.$O: ../port/nandecc.h io.h
107 fpi.$O fpiarm.$O fpimem.$O: fpi.h
108 l.$O lexception.$O lproc.$O mmu.$O: arm.s arm.h mem.h
109 l.$O rebootcode.$O: cache.v7.s
110 main.$O: errstr.h init.h reboot.h
111 devdss.$O devmouse.$O mouse.$O screen.$O: screen.h
112 devusb.$O: ../port/usb.h
113 usbehci.$O usbohci.$O usbuhci.$O: ../port/usb.h usbehci.h
114
115 init.h:D:       ../port/initcode.c init9.s
116         $CC ../port/initcode.c
117         $AS init9.s
118         $LD -l -R1 -s -o init.out init9.$O initcode.$O /$objtype/lib/libc.a
119         {echo 'uchar initcode[]={'
120          xd -1x <init.out |
121                 sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
122          echo '};'} > init.h
123
124 reboot.h:D:     rebootcode.s cache.v7.s arm.s arm.h mem.h
125         $AS rebootcode.s
126         # -lc is only for memmove.  -T arg is PADDR(REBOOTADDR)
127 #       $LD -l -a -s -T0x100 -R4 -o reboot.out rebootcode.$O -lc >reboot.list
128         $LD -l -s -T0x100 -R4 -o reboot.out rebootcode.$O -lc
129         {echo 'uchar rebootcode[]={'
130          xd -1x reboot.out |
131                 sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
132          echo '};'} > reboot.h
133 errstr.h:D:     ../port/mkerrstr ../port/error.h
134         rc ../port/mkerrstr > errstr.h