nitg --- compiles Nit programs.
-# SYNOPSYS
+# SYNOPSIS
nitg [*options*] FILE...
To show only `missing-doc` warnings in standard"
- $ nitg -q -w missing-doc standard
+ $ nitg -q -w missing-doc standard
To show all warnings and advices, except `missing-doc`:
- $ nitg -W -w no-missing-doc standard
+ $ nitg -W -w no-missing-doc standard
To show important warnings except `useless-type-test`, but not advice except `missing-doc`:
- $ nitg -w missing-doc -w no-useless-type-test standard
+ $ nitg -w missing-doc -w no-useless-type-test standard
`-q`, `--quiet`
: Do not show warnings.
This option is mainly used to produce C files distributable then compilable on system that do not have a Nit compiler (e.g. embedded system).
In this case, it is suggested to also use the options `--dir`, `--compile-dir` and `--semi-global`.
- $ nitg examples/hello_world.nit --no-cc --dir hello --compile-dir hello --semi-global
+ $ nitg examples/hello_world.nit --no-cc --dir hello --compile-dir hello --semi-global
Will produce a `hello` directory that contains the required C files to finish the compilation.
Only the C files required for the program are generated.
A last usage is to develop programs as product lines with a main basic module (vanilla) and specific distinct features as flavor modules, then to combine them at compile-time.
- $ nitg prog_vanilla.nit -m feature_chocolate.nit -m feature_cherry.nit
+ $ nitg prog_vanilla.nit -m feature_chocolate.nit -m feature_cherry.nit
`-D`, `--define`
: Define a specific property.
The argument of the `-D` option is "{name}={value}".
For Bool, the argument can also be just "{name}", in this case, the value is considered to be `true`.
- $ nitg foo.nit -D prefix=/opt/foo -D port=8080 -D with_ssl
+ $ nitg foo.nit -D prefix=/opt/foo -D port=8080 -D with_ssl
`--release`
: Compile in release mode and finalize application.
`--make-flags`
: Additional options to the `make` command.
- $ nitg foo.nit --make-flags 'CC=clang' --make-flags 'CFLAGS="-O0 -g"'
+ $ nitg foo.nit --make-flags 'CC=clang' --make-flags 'CFLAGS="-O0 -g"'
`--typing-test-metrics`
: Enable static and dynamic count of all type tests.