Subversion Repositories planix.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
CONF=plug
2
CONFLIST=plug plugnv
3
EXTRACOPIES=
4
 
5
# allegedly u-boot uses the bottom 8MB (up to 0x800000)
6
# so avoid that
7
loadaddr=0x60800000
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
	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
	syscallfmt.$O\
39
	sysfile.$O\
40
	sysproc.$O\
41
	taslock.$O\
42
	tod.$O\
43
	xalloc.$O\
44
 
45
OBJ=\
46
	l.$O\
47
	lexception.$O\
48
	lproc.$O\
49
	arch.$O\
50
	cga.$O\
51
	clock.$O\
52
	fpi.$O\
53
	fpiarm.$O\
54
	fpimem.$O\
55
	main.$O\
56
	mmu.$O\
57
	random.$O\
58
	trap.$O\
59
	$CONF.root.$O\
60
	$CONF.rootc.$O\
61
	$DEVS\
62
	$PORT\
63
 
64
# HFILES=
65
 
66
LIB=\
67
	/$objtype/lib/libmemlayer.a\
68
	/$objtype/lib/libmemdraw.a\
69
	/$objtype/lib/libdraw.a\
70
	/$objtype/lib/libip.a\
71
	/$objtype/lib/libsec.a\
72
	/$objtype/lib/libmp.a\
73
	/$objtype/lib/libc.a\
74
 
75
9:V: $p$CONF s$p$CONF
76
 
77
$p$CONF:DQ:	$CONF.c $OBJ $LIB mkfile
78
	$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
79
	echo '# linking raw kernel'
80
#	sleep 1				# avoid relinking later
81
	$LD -o $target -H0 -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
82
 
83
s$p$CONF:DQ:	$CONF.$O $OBJ $LIB
84
	echo '# linking kernel with symbols'
85
#	sleep 1				# avoid relinking later
86
	$LD -o $target -R4096 -T$loadaddr -l $OBJ $CONF.$O $LIB
87
	size $target
88
 
89
$p$CONF.gz:D:	$p$CONF
90
	gzip -9 <$p$CONF >$target
91
 
92
$OBJ: $HFILES
93
 
94
install:V: /$objtype/$p$CONF
95
 
96
install-in-flash:V: /$objtype/$p$CONF paqdisk
97
	plug.flash.cfg
98
	echo erase all >/dev/flash/kernelctl
99
	cp /$objtype/$p$CONF /dev/flash/kernel
100
	echo erase all >/dev/flash/plan9ctl
101
	cp paqdisk /dev/flash/plan9
102
 
103
/$objtype/$p$CONF:D: $p$CONF s$p$CONF
104
	cp -x $p$CONF s$p$CONF /$objtype/ &
105
	for(i in $EXTRACOPIES)
106
		{ 9fs $i && cp $p$CONF s$p$CONF /n/$i/$objtype && echo -n $i... & }
107
	wait
108
	echo
109
	touch $target
110
 
111
paqdisk:
112
	rm -fr armpaq
113
	mkdir armpaq
114
	cd armpaq
115
	disk/mkfs -d . /sys/lib/sysconfig/proto/armpaqproto
116
	mkpaqfs -o ../paqdisk
117
	cd ..
118
 
119
<../boot/bootmkfile
120
<../port/portmkfile
121
<|../port/mkbootrules $CONF
122
 
123
# CFLAGS= -I. -I../port $CFLAGS	# hack to compile private sysproc.c (e.g.)
124
 
125
arch.$O clock.$O fpiarm.$O main.$O mmu.$O screen.$O sdscsi.$O syscall.$O \
126
	trap.$O: /$objtype/include/ureg.h
127
 
128
archkw.$O devether.$O ether1116.$O ethermii.$O: \
129
	etherif.h ethermii.h ../port/netif.h
130
archkw.$O devflash.$O flashkw.$O: ../port/flashif.h
131
fpi.$O fpiarm.$O fpimem.$O: ../port/fpi.h
132
l.$O lexception.$O lproc.$O mmu.$O: arm.s arm.h mem.h
133
main.$O:	errstr.h init.h reboot.h
134
mouse.$O:	screen.h
135
devusb.$O:	../port/usb.h
136
usbehci.$O usbohci.$O usbuhci.$O: ../port/usb.h usbehci.h uncached.h
137
 
138
init.h:D:	../port/initcode.c init9.s
139
	$CC ../port/initcode.c
140
	$AS init9.s
141
	$LD -l -R1 -s -o init.out init9.$O initcode.$O /$objtype/lib/libc.a
142
	{echo 'uchar initcode[]={'
143
	 xd -1x <init.out |
144
		sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
145
	 echo '};'} > init.h
146
 
147
reboot.h:D:	rebootcode.s arm.s arm.h mem.h
148
	$AS rebootcode.s
149
	# -lc is only for memmove.  -T arg is PADDR(REBOOTADDR)
150
	$LD -l -a -s -T0x100 -R4 -o reboot.out rebootcode.$O -lc >reboot.list
151
	{echo 'uchar rebootcode[]={'
152
	 xd -1x reboot.out |
153
		sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
154
	 echo '};'} > reboot.h
155
errstr.h:D:	../port/mkerrstr ../port/error.h
156
	rc ../port/mkerrstr > errstr.h