I am using a Makefile script for compiling Nim programs. However, RSDuck
suggested the replacement of Makefile with nimscript. I confess that I didn't
know anything about the very existence of nimscript, and I want to thank RSDuck
for drawing my attention to it. However, in nimscript, I encountered the same
kind of problem that I found in macros: The lack of simple examples. Anyway,
here is the script I wrote:
#!/usr/local/bin/nim
mode = ScriptMode.Silent
# Options: Silent, Verbose, Whatif
let
app=paramStr(2)
src= app & ".nim"
exe= app & ".x"
let C= "nim c --hints:off --nimcache:xx -d:danger -o:"
exec C & exe & " " & src
mvFile exe, "./bin/" & exe
# Usage: ./build.nims iterfib
Run
I would appreciate feedback about the above script from members of this forum.
The main issues are: (1) I failed in turning hints off; (2) I would like to
print a usage message, whenever user forgets the name of the application.