-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.magenta
39 lines (36 loc) · 895 Bytes
/
build.magenta
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
main:
set CC i686-elf-gcc
set LD ld
set qemu qemu-system-x86_64
set flags -std=gnu99 -m32 -ffreestanding -c -I ..\src\.
set aflags -felf32
set AC nasm
jump build
end
build:
mkdir bin
cd bin
exec (AC) (aflags) ..\src\kernel_loader.asm -o kernel_loader.o
exec (AC) (aflags) ..\src\Drivers\gdt.asm -o gdt_t.o
exec (CC) (flags) ..\src\*.c
exec (CC) (flags) ..\src\Drivers\*.c
exec (CC) (flags) ..\src\System\*.c
exec (CC) (flags) ..\src\Timer\*.c
exec (CC) (flags) ..\src\Graphics\*.c
exec (CC) (flags) ..\src\Mego-Runtime\*.c
exec (CC) (flags) ..\src\Util\*.c
exec (CC) (flags) ..\src\FS\*.c
exec (LD) -T..\linker.ld *.o ..\ramdisk\ramdisk.img -o kernel.pe
exec objcopy -Felf32-i386 kernel.pe kernel.elf
jump run
pause
end
run:
exec (qemu) -kernel kernel.elf
end
build_fs:
cd app32
exec build.bat
cd ..\
exec ramdisk.bat
end