forked from inferno-os/inferno-os
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprofile
More file actions
90 lines (83 loc) · 1.63 KB
/
Copy pathprofile
File metadata and controls
90 lines (83 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
load arg
load std
autoload=(std)
fn awk {
os awk $*
}
fn 9c {
load arg
args := $*
flags=''
(arg
I+ {flags = $flags -I ^ `{file2root $arg}}
D+ {flags = $flags -$opt ^ $arg}
'*' {echo unknown option $opt}
- $args
)
cwd=`{echo $emuroot ^ `pwd}
cc='gcc'
cflags=(
-m32
-O2
-c
-Wall
-Wno-parentheses
-Wno-missing-braces
-Wno-switch
-Wno-comment
-Wno-sign-compare
-Wno-unknown-pragmas
-fno-omit-frame-pointer
-I$cwd
-I$emuroot/sys/Linux/386/include
-I$emuroot/sys/include
-I$emuroot/sys/libinterp
-I$emuroot/sys/emu/port)
file=$1
ofile = `{basename $file .c}
ofile = `{basename $ofile .S}
ofile = `{echo $emuroot ^ `{cleanname -d `pwd $ofile^.o}}
file=`{cleanname -d `pwd $file}
file=`{echo $emuroot ^ $file}
# echo $cc -o $ofile $cflags $flags $file
os `{echo $cc -o $ofile $cflags $flags $file}
}
fn 9l {
ld=$cc
ldflags=( -m32 )
# syslibs=( -lm -lX11 -lXext)
args = $*
echo os $ld $ldflags `{file2root $args} $syslibs
os `{echo $ld $ldflags `{file2root $args} $syslibs }
}
fn file2root {
args = $*
for (i in $args) {
(if {~ $i '-*' } { # exclude libraries
echo $i
}
{! ~ $i '*.*'} { # and their arguments (names w/o dots -- i.e. -framework CoreFoundation, etc)
echo $i
}
{
i = `{cleanname -d `pwd $i}
echo $emuroot ^ $i
})
}
}
fn 9ar {
ar=ar
cwd=`{echo $emuroot ^ `pwd }
arflags=(-r)
file=$1
file=`{cleanname -d `pwd $file}
file=`{echo $emuroot ^ $file }
args = ${tl $*}
# echo os $ar $arflags $file `{file2root $args}
os `{echo $ar $arflags $file `{file2root $args}}
}
fn svn {
args = ${tl $*}
os svn $1 `{file2root $args}
}
bind /sys/Linux/mkconfig /sys/mkconfig