-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.ninja
86 lines (78 loc) · 6.12 KB
/
build.ninja
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
rule format
pool = console
command = find $directory -type f -name '*.cpp' | xargs clang-format -i && find $directory -type f -name '*.hpp' | xargs clang-format -i
rule run
pool = console
command = qemu-system-i386 -m 500M -drive file=drive,format=raw -boot d -drive if=none,id=usbstick,file=virtdrive -usb -device usb-ehci,id=ehci -device usb-storage,bus=ehci.0,drive=usbstick,pcap=usb.dat -audiodev driver=pa,id=pa1 -device es1370,audiodev=pa1 -netdev user,id=net0 -device pcnet,netdev=net0 -object filter-dump,id=f1,netdev=net0,file=net.dat -serial mon:stdio -d cpu_reset --enable-kvm -display sdl,gl=on
rule disk
pool = console
command = cd Base/root && tar cf ../../hdd.tar * && cd ../../ && objcopy -O elf32-i386 -B i386 -I binary hdd.tar hdd.o && ./fuse
rule bootloader
pool = console
command = cd Bootloader && ./build.py && cd ..
rule cpp
command = i686-elf-g++ -O3 -mno-red-zone -nostdlib -nostartfiles -fno-builtin -ffreestanding -fno-delete-null-pointer-checks -ILibraries -fno-builtin -fno-use-cxa-atexit -fno-rtti -fno-exceptions -fno-leading-underscore -Wno-sign-compare -Wno-unused-variable -Wno-unused-function -Wall -Wpedantic -Wno-write-strings -fno-omit-frame-pointer -Wno-address-of-packed-member -c $in -o $out
rule asm
command = as --32 $in -o $out
rule link
command = ld -melf_i386 -T Arch/i386/linker.ld -o $out $in ./Libraries/libc.a ./Libraries/libdisplay.a ./Libraries/libsound.a
rule chain
pool = console
command = objcopy -R .note -R .comment -S -O binary ./.out/kernel.bin ./kernel.bin && cat bootloader.bin kernel.bin > boot.bin && ./align.py boot.bin 512 && cat boot.bin virtdrive > drive
build Kernel/kernel.o: cpp ./Kernel/kernel.cpp
build Kernel/syscalls.o: cpp ./Kernel/syscalls.cpp
build Kernel/panic.o: cpp ./Kernel/panic.cpp
build Kernel/Locks/mutex.o: cpp ./Kernel/Locks/mutex.cpp
build Kernel/pipe.o: cpp ./Kernel/pipe.cpp
build Kernel/Tasks/tty.o: cpp ./Kernel/Tasks/tty.cpp
build Kernel/Tasks/multitasking.o: cpp ./Kernel/Tasks/multitasking.cpp
build Kernel/Hardware/Drivers/mouse.o: cpp ./Kernel/Hardware/Drivers/mouse.cpp
build Kernel/Hardware/Drivers/keyboard.o: cpp ./Kernel/Hardware/Drivers/keyboard.cpp
build Kernel/Hardware/Drivers/vga.o: cpp ./Kernel/Hardware/Drivers/vga.cpp
build Kernel/Hardware/Drivers/vesa.o: cpp ./Kernel/Hardware/Drivers/vesa.cpp
build Kernel/Hardware/Drivers/am79c973.o: cpp ./Kernel/Hardware/Drivers/am79c973.cpp
build Kernel/Hardware/Drivers/rtl8139.o: cpp ./Kernel/Hardware/Drivers/rtl8139.cpp
build Kernel/Hardware/Drivers/pcs.o: cpp ./Kernel/Hardware/Drivers/pcs.cpp
build Kernel/Hardware/Drivers/sb16.o: cpp ./Kernel/Hardware/Drivers/sb16.cpp
build Kernel/Hardware/Drivers/cmos.o: cpp ./Kernel/Hardware/Drivers/cmos.cpp
build Kernel/Hardware/Drivers/ata.o: cpp ./Kernel/Hardware/Drivers/ata.cpp
build Kernel/Hardware/Drivers/es1370.o: cpp ./Kernel/Hardware/Drivers/es1370.cpp
build Kernel/Hardware/Drivers/ac97.o: cpp ./Kernel/Hardware/Drivers/ac97.cpp
build Kernel/Hardware/Drivers/virtual.o: cpp ./Kernel/Hardware/Drivers/virtual.cpp
build Kernel/Hardware/Drivers/USB/usb.o: cpp ./Kernel/Hardware/Drivers/USB/usb.cpp
build Kernel/Hardware/Drivers/USB/scsi.o: cpp ./Kernel/Hardware/Drivers/USB/scsi.cpp
build Kernel/Hardware/Drivers/USB/ehci.o: cpp ./Kernel/Hardware/Drivers/USB/ehci.cpp
build Kernel/Hardware/port.o: cpp ./Kernel/Hardware/port.cpp
build Kernel/Hardware/audio.o: cpp ./Kernel/Hardware/audio.cpp
build Kernel/Hardware/storage.o: cpp ./Kernel/Hardware/storage.cpp
build Kernel/Hardware/interrupts.o: cpp ./Kernel/Hardware/interrupts.cpp
build Kernel/Hardware/cpuid.o: cpp ./Kernel/Hardware/cpuid.cpp
build Kernel/Hardware/pci.o: cpp ./Kernel/Hardware/pci.cpp
build Kernel/Mem/paging.o: cpp ./Kernel/Mem/paging.cpp
build Kernel/Mem/mm.o: cpp ./Kernel/Mem/mm.cpp
build Kernel/Mem/pmm.o: cpp ./Kernel/Mem/pmm.cpp
build Kernel/Net/ethernet.o: cpp ./Kernel/Net/ethernet.cpp
build Kernel/Net/arp.o: cpp ./Kernel/Net/arp.cpp
build Kernel/Net/ipv4.o: cpp ./Kernel/Net/ipv4.cpp
build Kernel/Net/icmp.o: cpp ./Kernel/Net/icmp.cpp
build Kernel/Net/udp.o: cpp ./Kernel/Net/udp.cpp
build Kernel/Net/tcp.o: cpp ./Kernel/Net/tcp.cpp
build Kernel/Net/dns.o: cpp ./Kernel/Net/dns.cpp
build Kernel/Net/dhcp.o: cpp ./Kernel/Net/dhcp.cpp
build Kernel/GDT/gdt.o: cpp ./Kernel/GDT/gdt.cpp
build Kernel/GDT/gdt_helper.o: asm ./Kernel/GDT/gdt_helper.S
build Kernel/Exec/loader.o: cpp ./Kernel/Exec/loader.cpp
build Kernel/Exec/elf.o: cpp ./Kernel/Exec/elf.cpp
build Kernel/Filesystem/tar.o: cpp ./Kernel/Filesystem/tar.cpp
build Kernel/Filesystem/husky.o: cpp ./Kernel/Filesystem/husky.cpp
build Kernel/Filesystem/vfs.o: cpp ./Kernel/Filesystem/vfs.cpp
build Kernel/Hardware/interruptstubs.o: asm ./Kernel/Hardware/interruptstubs.S
build Kernel/Hardware/power.o: asm ./Kernel/Hardware/power.S
build Arch/i386/Boot/boot.o: asm ./Arch/i386/Boot/boot.S
build ./.out/kernel.bin: link Kernel/kernel.o Kernel/Tasks/multitasking.o Kernel/syscalls.o Kernel/Tasks/tty.o Kernel/panic.o Kernel/Locks/mutex.o Kernel/pipe.o Kernel/Hardware/port.o Kernel/Hardware/audio.o Kernel/Hardware/storage.o Kernel/Hardware/Drivers/mouse.o Kernel/Hardware/Drivers/keyboard.o Kernel/Hardware/Drivers/vga.o Kernel/Hardware/Drivers/vesa.o Kernel/Hardware/Drivers/am79c973.o Kernel/Hardware/Drivers/rtl8139.o Kernel/Hardware/Drivers/pcs.o Kernel/Hardware/Drivers/sb16.o Kernel/Hardware/Drivers/cmos.o Kernel/Hardware/Drivers/ata.o Kernel/Hardware/Drivers/es1370.o Kernel/Hardware/Drivers/ac97.o Kernel/Hardware/Drivers/virtual.o Kernel/Hardware/Drivers/USB/ehci.o Kernel/Hardware/Drivers/USB/usb.o Kernel/Hardware/Drivers/USB/scsi.o Kernel/Hardware/interrupts.o Kernel/Hardware/pci.o Kernel/Hardware/cpuid.o Kernel/Mem/paging.o Kernel/Mem/mm.o Kernel/Mem/pmm.o Kernel/Net/ethernet.o Kernel/Net/ipv4.o Kernel/Net/icmp.o Kernel/Net/udp.o Kernel/Net/tcp.o Kernel/Net/dns.o Kernel/Net/dhcp.o Kernel/Net/arp.o Kernel/GDT/gdt.o Kernel/GDT/gdt_helper.o Kernel/Exec/loader.o Kernel/Exec/elf.o Kernel/Filesystem/tar.o Kernel/Filesystem/husky.o Kernel/Filesystem/vfs.o Kernel/Hardware/interruptstubs.o Kernel/Hardware/power.o Arch/i386/Boot/boot.o
build disk: disk
build format: format
build bootloader: bootloader
build chain: chain
build run: run
default ./.out/kernel.bin