koch: 'git' command
This commit is contained in:
parent
c9d5c82683
commit
61ddcf62b5
2 changed files with 21 additions and 4 deletions
14
koch.nim
14
koch.nim
|
|
@ -33,11 +33,12 @@ Possible Commands:
|
||||||
csource [options] builds the C sources for installation
|
csource [options] builds the C sources for installation
|
||||||
zip builds the installation ZIP package
|
zip builds the installation ZIP package
|
||||||
inno [options] builds the Inno Setup installer
|
inno [options] builds the Inno Setup installer
|
||||||
|
git removes and adds generated C files to git
|
||||||
Boot options:
|
Boot options:
|
||||||
-d:release produce a release version of the compiler
|
-d:release produce a release version of the compiler
|
||||||
-d:tinyc include the Tiny C backend (not supported on Windows)
|
-d:tinyc include the Tiny C backend (not supported on Windows)
|
||||||
-d:useGnuReadline use the GNU readline library for interactive mode
|
-d:useGnuReadline use the GNU readline library for interactive mode
|
||||||
(not supported on Windows)
|
(not needed on Windows)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
proc exe(f: string): string = return addFileExt(f, ExeExt)
|
proc exe(f: string): string = return addFileExt(f, ExeExt)
|
||||||
|
|
@ -75,6 +76,17 @@ proc web(args: string) =
|
||||||
exec("nimrod cc -r tools/nimweb.nim web/nimrod --putenv:nimrodversion=$#" %
|
exec("nimrod cc -r tools/nimweb.nim web/nimrod --putenv:nimrodversion=$#" %
|
||||||
NimrodVersion)
|
NimrodVersion)
|
||||||
|
|
||||||
|
proc gitAux(dir: string) =
|
||||||
|
for kind, path in walkDir(dir):
|
||||||
|
if kind == pcDir:
|
||||||
|
var cfiles = path / "*.c"
|
||||||
|
exec("git rm " & cfiles)
|
||||||
|
exec("git add " & cfiles)
|
||||||
|
gitAux(path)
|
||||||
|
|
||||||
|
proc git =
|
||||||
|
gitAux("build")
|
||||||
|
|
||||||
# -------------- nim ----------------------------------------------------------
|
# -------------- nim ----------------------------------------------------------
|
||||||
|
|
||||||
proc compileNimCmd(args: string): string =
|
proc compileNimCmd(args: string): string =
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,11 @@ proc genLiteral(p: BProc, v: PNode): PRope =
|
||||||
|
|
||||||
proc bitSetToWord(s: TBitSet, size: int): BiggestInt =
|
proc bitSetToWord(s: TBitSet, size: int): BiggestInt =
|
||||||
result = 0
|
result = 0
|
||||||
|
when true:
|
||||||
|
for j in countup(0, size - 1):
|
||||||
|
if j < len(s): result = result or `shl`(Ze64(s[j]), j * 8)
|
||||||
|
else:
|
||||||
|
# not needed, too complex thinking:
|
||||||
if CPU[platform.hostCPU].endian == CPU[targetCPU].endian:
|
if CPU[platform.hostCPU].endian == CPU[targetCPU].endian:
|
||||||
for j in countup(0, size - 1):
|
for j in countup(0, size - 1):
|
||||||
if j < len(s): result = result or `shl`(Ze64(s[j]), j * 8)
|
if j < len(s): result = result or `shl`(Ze64(s[j]), j * 8)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue