Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_tlsv12/sys/src/9/port/mkrootc – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
rfork e
4
n=`{echo $#*^'%3' | hoc}
5
if(! ~ $n 0){
6
	echo 'usage: mkrootc [name cname file]...' >[1=2]
7
	exit usage
8
}
9
 
10
tmp=mkroot.$pid.out
11
fn sigexit {
12
	rm -f $tmp
13
}
14
 
15
allcname=()
16
allname=()
17
while(! ~ $#* 0){
18
	name=$1
19
	cname=$2
20
	file=$3
21
	shift
22
	shift 
23
	shift
24
	allname=($allname $name)
25
	allcname=($allcname $cname)
26
}
27
 
28
echo '
29
#include "u.h"
30
#include "../port/lib.h"
31
#include "mem.h"
32
#include "dat.h"
33
#include "fns.h"
34
#include "io.h"
35
#include "../port/error.h"
36
'
37
 
38
for(i in $allcname){
39
	echo 'extern uchar '$i'code[];'
40
	echo 'extern ulong '$i'len;'
41
}
42
 
43
echo '
44
void bootlinks(void){
45
'
46
x=($allname)
47
for(i in $allcname){
48
	name=$x(1)
49
	*=($x); shift; x=($*)
50
	echo '	addbootfile("'$name'", '$i'code, '$i'len);'
51
}
52
echo '
53
}
54
'