diff options
Diffstat (limited to 'koch.nim')
-rwxr-xr-x | koch.nim | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/koch.nim b/koch.nim index 16efbb5ac..bb9d84d8e 100755 --- a/koch.nim +++ b/koch.nim @@ -41,7 +41,7 @@ proc tryExec(cmd: string): bool = result = execShellCmd(cmd) == 0 proc csource(args: string) = - exec("nimrod cc $# -r tools/niminst --var:version=$# csource rod/nimrod $2" % + exec("nimrod cc $1 -r tools/niminst --var:version=$2 csource rod/nimrod $1" % [args, NimrodVersion]) proc zip(args: string) = @@ -75,22 +75,8 @@ proc nim(args: string) = exec(compileNimCmd(args)) # -------------- boot --------------------------------------------------------- -proc writePlatdefC = - const - PlatdefCTmpl = """ - /* Generated by boot.nim */ - char* nimOS(void) { return "$#"; } - char* nimCPU(void) { return "$#"; } - """ - var f: TFile - if open(f, "build/platdef.c", fmWrite): - write(f, PlatdefcTmpl % [system.hostOS, system.hostCPU]) - close(f) - else: - quit("Cannot write 'build/platdef.c'\n") - const - bootOptions = "" # "--compile:build/platdef.c" + bootOptions = "" # options to pass to the bootstrap process proc findStartNimrod: string = const buildScript = "build.sh" @@ -118,10 +104,9 @@ proc findStartNimrod: string = proc bootIteration(args: string): bool = var nimrod1 = "rod" / "nimrod1".exe - if not ExistsFile("rod" / "nimrod".exe): - quit("no binary has been created! Failed! Try with --forcebuild") moveFile nimrod1, "rod" / "nimrod".exe exec "rod" / "nimrod1 cc $# $# rod/nimrod.nim" % [bootOptions, args] + # Nimrod does not produce an executable again if nothing changed. That's ok: result = sameFileContent("rod" / "nimrod".exe, nimrod1) if result: moveFile "bin" / "nimrod".exe, "rod" / "nimrod".exe @@ -129,7 +114,6 @@ proc bootIteration(args: string): bool = removeFile nimrod1 proc boot(args: string) = - #writePlatdefC() echo "iteration: 1" exec findStartNimrod() & " cc $# $# rod" / "nimrod.nim" % [bootOptions, args] echo "iteration: 2" |