Options must come before variables and targets, so they can not be overwritten by setting any variables. They can only be overwritten by executing mike with wanted variables exported to system environment beforehand.
mike command accepts the following command-line flags:
--R or --rules —
display available rules, the same as executing the show-rules target
--V or --variables —
display available variables (and what they are set to), the same as executing the show-variables target
Variables are used to control how rules execute, for example a rule can contain a variable EXE_FLAGS which determines command-line arguments passed to raco in order to produce a binary executable.
Any initial variable can be overwritten by changing (exporting) the system environment variables (ie.: export ASD=fgh) or passing the variables as one of the arguments (after options).
Variables overwriting passed as arguments have precedence over environment variables. In fact when overwriting using the environment variable route the exported variables become initial variables.
Example: overwriting with environment
PACKAGE_NAME=asd mike exe
Example: overwriting with arguments
mike PACKAGE_NAME=asd exe
Rules are the functions that define how targets are handled. Target is a command-line argument that triggers a rule execution.
For developers: The rules can also be checked by entering into the "rules.rkt" module and executing (hash-keys rules).
Rules are first gathered and checked if they exist, if they do they are executed in the order specified on the command-line, if they do not exist an exception is raised and the program terminates. Because of this it is impossible to have one target executed with one value of variable and the other with a different value.
Example: PACKAGE_NAME will be "fgh"
mike PACKAGE_NAME=asd show-variables PACKAGE_NAME=fgh
execute: install, setup & test
compile the PWD directory (which is (current-directory) unless overwritten)
run the ENTRYPOINT
install the package
create the doc directory
generate HTML documentation
generate LaTex documentation
generate Markdown documentation
generate documentation in pure text format
execute: docs-html, docs-latex, docs-markdown & docs-text
create a executable in "bin" directory, from ENTRYPOINT
create a source package
remove pkg zip (generated by pkg target) & binary executable
execute: disclean & remove all compiled and doc directories
uninstall the package
execute: remove & clean
remove and install the package again
execute: reinstall & setup
run raco setup
check package dependencies
test locally (without installing the package)
test installed package
display available rules
display available variables (and what they are set to)
execute both show-rules & show-variables
execute: clean, compile, install, setup, check-deps, test, purge
execute: pkg & exe