Removed duplication of output filename in nakefile.

This commit is contained in:
neviyn 2017-11-17 00:53:53 +00:00
parent f07b29d826
commit b60b2b1f8f

View File

@ -2,14 +2,14 @@ import nake
import os
const
standardOptions = """--skipCfg --forceBuild --cc:clang --deadCodeElim:on --gc:regions --boundChecks:on --path:"kernel/arch/i386" --cpu:i386 --os:standalone --passC:"-ffreestanding -nostdlib --target=i386-pc-none-elf -march=i386" --passL:"-ffreestanding -target i386 -nostdlib" --out:"myos.bin" kernel/kernel.nim"""
standardOptions = """--skipCfg --forceBuild --cc:clang --deadCodeElim:on --gc:regions --boundChecks:on --path:"kernel/arch/i386" --cpu:i386 --os:standalone --passC:"-ffreestanding -nostdlib --target=i386-pc-none-elf -march=i386" --passL:"-ffreestanding -target i386 -nostdlib" kernel/kernel.nim"""
outputFile = "myos.bin"
task "clean", "Removes build files.":
removeFile("boot.o")
removeFile("serial.log")
removeDir("nimcache")
removeFile("myos.bin")
removeFile(outputFile)
echo "Done."
task "bootloader", "Builds the bootloader.":
@ -21,7 +21,7 @@ task "build", "Builds the operating system.":
runTask("clean")
runTask("bootloader")
echo "Compiling and linking."
direShell "nim cc", standardOptions
direShell "nim cc -o", outputFile, standardOptions
runTask("checkMultiboot")
echo "Done."
@ -29,7 +29,7 @@ task "build-release", "Builds the operating system, release mode.":
runTask("clean")
runTask("bootloader")
echo "Compiling and linking (release mode)."
direShell "nim cc --skipCfg -d:release", standardOptions
direShell "nim cc --skipCfg -d:release -o:", outputFile, standardOptions
runTask("checkMultiboot")
echo "Done."
@ -41,7 +41,7 @@ task "checkMultiboot", "Checks the grub multiboot header.":
task "debug", "Runs the operating system using QEMU with debug build and flags.":
runTask("build")
echo "Running in Qemu."
direShell "qemu-system-i386 -kernel myos.bin -serial stdio -no-reboot -d int,cpu-reset"
direShell "qemu-system-i386 -kernel", outputFile ,"-serial stdio -no-reboot -d int,cpu-reset"
task "run", "Runs the operating system using QEMU.":
runTask("build-release")