-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.preninja
82 lines (77 loc) · 2.03 KB
/
build.preninja
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
rules:
map:
k-ldc:
in: .d
out: -k.o
cmd: ldc2 $k-dflags $dflags $dnosse --of $out $in -c
k-clang:
in: .c
out: .o
cmd: clang $k-cflags $cflags $cnosse -o $out $in -c -Iinc
u-ldc:
in: .d
out: -u.o
cmd: ldc2 $dflags $dnosse --betterC --of $out $in -c --cache=build/ucache --makedeps=$depfile
u-ldc-betterc:
in: .d
out: -u.o
cmd: ldc2 $dflags $dnosse --betterC --of $out $in -c --cache=build/ucache
nasm:
in: .s
out: .o
cmd: nasm -gdwarf -felf64 -o $out $in
reduce:
k-ld: ld.lld $in -o $out -T src/kernel.ld -error-limit=0
ld: ld.lld $in -o $out -T src/userland.ld -error-limit=0
prelink: ld.lld -r $in -o $out
xorriso: sh tools/makeiso.sh $out $in
env:
k-dflags: -code-model=kernel --cache=build/kcache --betterC
dflags: -I src/shim -I src --relocation-model=static --gdwarf -mtriple=x86_64-elf -I build/rsc
dnosse: -mattr=-sse,-sse2,-sse3,-ssse3 --enable-color=true
k-cflags: -mcmodel=kernel -Iscalable-font2
cflags: -ggdb -target x86_64
cnosse: -mno-sse -mno-sse2 -mno-sse3 -mno-avx -mno-mmx
actions:
$libxk:
prelink:
_: build/libxk.o
u-ldc-betterc: src/libxk/*.d
$libxtrix:
prelink:
_: build/libxtrix.o
# u-ldc: assets/object.d
u-ldc-betterc: src/libxtrix/*.d
u-ldc-betterc: src/libxtrix/libc/*.d
xorriso:
_: xtrix.iso
noop: limine.cfg
noop: assets/console.sfn
ld:
_: build/init.elf
noop: $libxtrix
noop: $libsrpc
noop: $libxk
u-ldc: src/progs/init/*.d
ld:
_: build/hello.elf
noop: $libxtrix
noop: $libxk
u-ldc: src/progs/hello/*.d
ld:
_: build/discoveryd.elf
noop: $libxtrix
noop: $libsrpc
noop: $libxk
u-ldc: src/progs/discoveryd/*.d
k-ld:
_: build/kernel.elf
k-ldc: src/libxk/*.d
k-ldc: src/xtrm/*.d
k-ldc: src/xtrm/*/*.d
k-clang: src/xtrm/ssfn.c
nasm: src/xtrixasm/*.s
features:
clean: yes
reconf: reconf
run: sh tools/qemu.sh