got rid of platdef.c; compiler now always does linking step
This commit is contained in:
parent
8ce705f686
commit
f56816def0
12 changed files with 39 additions and 51 deletions
22
koch.nim
22
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue