Move Nim compiler settings to a separate configuration file.

This commit is contained in:
neviyn 2017-10-21 18:46:59 +01:00
parent c3ca04dd5a
commit defc7d8787
4 changed files with 12 additions and 2 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ nimcache/
isodir/ isodir/
myos.iso myos.iso
*.o *.o
myos.bin

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
rm -r isodir rm -r isodir
mkdir -p isodir/boot/grub mkdir -p isodir/boot/grub
cp kernel isodir/boot/kernel cp myos.bin isodir/boot/kernel
cp grub.cfg isodir/boot/grub/grub.cfg cp grub.cfg isodir/boot/grub/grub.cfg
grub-mkrescue -o myos.iso isodir grub-mkrescue -o myos.iso isodir

View File

@ -1,7 +1,7 @@
all: kernel all: kernel
kernel: bootloader kernel: bootloader
nim cc --cc:clang --clang.linkerexe=clang --gc:none --deadCodeElim:on -d:StandaloneHeapSize=4096 --cpu:i386 --os:standalone --passC:"-ffreestanding -nostdlib --target=i686-pc-none-elf -march=i686" --passL:"-target i386 -nostdlib -T linker.ld boot.o" kernel.nim nim cc kernel.nim
bootloader: bootloader:
nasm -felf32 boot.s -o boot.o nasm -felf32 boot.s -o boot.o

9
nim.cfg Normal file
View File

@ -0,0 +1,9 @@
--cc:clang
--clang.linkerexe=clang
--gc:none
--deadCodeElim:on
--cpu:i386
--os:standalone
--passC:"-ffreestanding -nostdlib --target=i686-pc-none-elf -march=i686"
--passL:"-target i386 -nostdlib -T linker.ld boot.o"
-o:myos.bin