xref: /plan9/sys/src/9/omap/mkfile (revision d11907f1310fb3aff37a1c3d604436d4028fd86f)
1CONF=beagle
2CONFLIST=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.
7loadaddr=0xc0310000
8
9objtype=arm
10</$objtype/mkfile
11p=9
12
13DEVS=`{rc ../port/mkdevlist $CONF}
14
15PORT=\
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	latin1.$O\
26	mul64fract.$O\
27	rebootcmd.$O\
28	page.$O\
29	parse.$O\
30	pgrp.$O\
31	portclock.$O\
32	print.$O\
33	proc.$O\
34	qio.$O\
35	qlock.$O\
36	segment.$O\
37	swap.$O\
38	sysfile.$O\
39	sysproc.$O\
40	taslock.$O\
41	tod.$O\
42	xalloc.$O\
43
44OBJ=\
45	l.$O\
46	lexception.$O\
47	lproc.$O\
48	arch.$O\
49	clock.$O\
50	fpi.$O\
51	fpiarm.$O\
52	fpimem.$O\
53	kbd.$O\
54	main.$O\
55	mmu.$O\
56	random.$O\
57	trap.$O\
58	$CONF.root.$O\
59	$CONF.rootc.$O\
60	$DEVS\
61	$PORT\
62
63LIB=\
64	/$objtype/lib/libmemlayer.a\
65	/$objtype/lib/libmemdraw.a\
66	/$objtype/lib/libdraw.a\
67	/$objtype/lib/libip.a\
68	/$objtype/lib/libsec.a\
69	/$objtype/lib/libmp.a\
70	/$objtype/lib/libc.a\
71
729:V: $p$CONF s$p$CONF
73
74$p$CONF:DQ:	$CONF.c $OBJ $LIB mkfile
75	$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
76	echo '# linking raw kernel'
77	$LD -o $target -H0 -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
78
79s$p$CONF:DQ:	$CONF.$O $OBJ $LIB
80	echo '# linking kernel with symbols'
81#	$LD -o $target -R4096 -T$loadaddr -l -a $OBJ $CONF.$O $LIB >$target.list
82	$LD -o $target -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
83	size $target
84
85$p$CONF.gz:D:	$p$CONF
86	gzip -9 <$p$CONF >$target
87
88$OBJ: $HFILES
89
90install:V: /$objtype/$p$CONF
91
92/$objtype/$p$CONF:D: $p$CONF s$p$CONF
93	{ cp -x $p$CONF s$p$CONF /$objtype } &
94	wait
95	touch $target
96
97<../boot/bootmkfile
98<../port/portmkfile
99<|../port/mkbootrules $CONF
100
101CFLAGS= -I. -I../port $CFLAGS	# hack to compile private sysproc.c (e.g.)
102
103arch.$O clock.$O fpiarm.$O main.$O mmu.$O screen.$O sdscsi.$O syscall.$O \
104	trap.$O: /$objtype/include/ureg.h
105
106archomap.$O devether.$0 ether9221.$O: etherif.h ../port/netif.h
107archomap.$O devflash.$O flashbeagle.$O flashigep.$O: ../port/flashif.h
108ecc.$O flashbeagle.$O flashigep.$O: ../port/nandecc.h io.h
109fpi.$O fpiarm.$O fpimem.$O: ../port/fpi.h
110l.$O lexception.$O lproc.$O mmu.$O: arm.s arm.h mem.h
111l.$O rebootcode.$O: cache.v7.s
112main.$O: errstr.h init.h reboot.h
113devdss.$O devmouse.$O mouse.$O screen.$O: screen.h
114devusb.$O: ../port/usb.h
115usbehci.$O usbohci.$O usbuhci.$O: ../port/usb.h usbehci.h uncached.h
116
117init.h:D:	../port/initcode.c init9.s
118	$CC ../port/initcode.c
119	$AS init9.s
120	$LD -l -R1 -s -o init.out init9.$O initcode.$O /$objtype/lib/libc.a
121	{echo 'uchar initcode[]={'
122	 xd -1x <init.out |
123		sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
124	 echo '};'} > init.h
125
126reboot.h:D:	rebootcode.s cache.v7.s arm.s arm.h mem.h
127	$AS rebootcode.s
128	# -lc is only for memmove.  -T arg is PADDR(REBOOTADDR)
129#	$LD -l -a -s -T0x100 -R4 -o reboot.out rebootcode.$O -lc >reboot.list
130	$LD -l -s -T0x100 -R4 -o reboot.out rebootcode.$O -lc
131	{echo 'uchar rebootcode[]={'
132	 xd -1x reboot.out |
133		sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
134	 echo '};'} > reboot.h
135errstr.h:D:	../port/mkerrstr ../port/error.h
136	rc ../port/mkerrstr > errstr.h
137