1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-09-27 12:57:41 +00:00
millfork/doc/api/command-line.md

76 lines
3.5 KiB
Markdown
Raw Normal View History

2018-01-04 00:15:04 +00:00
# Command-line options
## General options
* `--version` Display the version number and quit.
* `--help` Displays help the command line option.
* `--` End of the options, all the following parameters will be treated as input files, even if they look like options.
## I/O options
2018-01-23 12:37:03 +00:00
* `-o <file>` Output filename, without extension. Extension will be added automatically, `.prg` for Commodore, `.a2` for Apple and `.xex` for Atari.
2018-01-04 00:15:04 +00:00
* `-s` Generate also the assembly output. It is not compatible with any assembler, but it serves purely informational purpose. The file has the same nam as the output file and the extension is `.asm`.
2018-01-30 16:43:18 +00:00
* `-g` Generate also the label file. The label file contains labels with their addresses, with duplicates removed. It can be loaded into the monitor of the Vice emulator for debugging purposes. The file has the same nam as the output file and the extension is `.lbl`.
2018-01-04 00:15:04 +00:00
* `-I <dir>;<dir>` The include directories. The current working directory is also an include directory. Those directories are searched for modules and platform definitions.
* `-t <platform>` Target platform. It is loaded from an `.ini` file found in any of the include directories. See also [this document](target-platforms.md).
* `-r <program>` Run given program after successful compilation. Useful for automatically launching emulators without any external scripting.
## Verbosity options
2018-01-31 21:25:06 +00:00
* `-q` Suppress all messages except for errors.
2018-01-04 00:15:04 +00:00
* `-v`, `-vv`, `-vvv` Increase verbosity, various levels.
## Code generation options
2018-01-30 16:38:32 +00:00
* `-fcmos-ops`, `-fno-cmos-ops` Whether should emit CMOS opcodes.
`.ini` equivalent: `emit_cmos`. Default: yes if targeting 65C02, no otherwise.
2018-01-04 00:15:04 +00:00
2018-01-30 16:38:32 +00:00
* `-fillegals`, `-fno-illegals` Whether should emit illegal (undocumented) NMOS opcodes.
`.ini` equivalent: `emit_illegals`. Default: no.
2018-01-04 00:15:04 +00:00
2018-01-30 16:38:32 +00:00
* `-fjmp-fix`, `-fno-jmp-fix` Whether should prevent indirect JMP bug on page boundary.
`.ini` equivalent: `prevent_jmp_indirect_bug`. Default: no if targeting 65C02, yes otherwise.
2018-01-04 00:15:04 +00:00
2018-01-30 16:38:32 +00:00
* `-fdecimal-mode`, `-fno-decimal-mode` Whether decimal mode should be available.
`.ini` equivalent: `decimal_mode`. Default: no if targeting Ricoh, yes otherwise.
2018-01-04 00:15:04 +00:00
2018-01-30 16:38:32 +00:00
* `-fvariable-overlap`, `-fno-variable-overlap` Whether variables should overlap if their scopes do not intersect.
Default: yes.
2018-01-08 00:18:04 +00:00
2018-01-30 16:38:32 +00:00
* `-fbounds-checking`, `-fnobounds-checking` Whether should insert bounds checking on array access.
Default: no.
* `-fcompact-dispatch-params`, `-fnocompact-dispatch-params`
Whether parameter values in return dispatch statements may overlap other objects.
This may cause problems if the parameter table is stored next to a hardware register that has side effects when reading.
`.ini` equivalent: `compact_dispatch_params`. Default: yes.
2018-01-04 00:15:04 +00:00
## Optimization options
* `-O0` Disable all optimizations.
* `-O`, `-O2`, `-O3` Optimize code, various levels.
* `-O9` Optimize code using superoptimizer (experimental). Computationally expensive, decent results.
* `--inline` Inline functions automatically (experimental). See the [documentation about inlining](../abi/inlining.md). Computationally easy, can give decent gains.
* `--detailed-flow` Use detailed flow analysis (experimental). Very computationally expensive and not that great.
* `--dangerous-optimizations` Use dangerous optimizations (experimental). Dangerous optimizations are more likely to result in broken code.
## Warning options
* `-Wall` Enable extra warnings.
* `-Wfatal` Treat warnings as errors.