Local configuration and rmk setup¶ ↑
Rmk build setup¶ ↑
When rmk starts for generation of Ninja files (-g
switch), it will try to read the following files in this order
rmk/tools/*.rb
rmk/config/{HOST,localhost,default}/init.rb
rmk/config/{HOST,localhost,default}/packages/*.rb
rmk/config/{HOST,localhost,default}/tools/*.rb
~/.rmk/config/{HOST,localhost,default}/init.rb
~/.rmk/config/{HOST,localhost,default}/packages/*.rb
~/.rmk/config/{HOST,localhost,default}/tools/*.rb
-
rmkis the installation directory. -
rmkexamines the first existing directory in{HOST,localhost,default}and ignores the remaining directories. -
HOSTis the host name, and~/is theHOMEdirectory. -
Note that the
rmkrepository's git configuration ignores anylocalhost/directory. We recommend a separate repository for local configuration(s) and have a symbolic linklocalhostorHOST. -
Files that are read later may “patch” the configuration that was read earlier.
-
You can always use Ruby
loadandrequireorRmk.import_filesto read additional files.
Next, rmk proceeds by reading
PROJDIR/project-name/RMakefile.spawn
PROJDIR/project-name/RMakefile.proj
PROJDIR/project-name/{.../}RMakefile.priv
PROJDIR/project-name/{.../}RMakefile
Project setup¶ ↑
RMakefile.spawn¶ ↑
-
This file is optional. In constrast to other files, it does not contain Ruby code! Instead it contains a list of directories.
-
Directories are listed in lines. Empty lines and lines starting with
#are ignored. -
For each directory
dir,rmkchanges todirand executes thermkcommand (with the given options). -
Explicit spawning is not recursive: The option
-no-explicit-spawnis added when executingrmkin an other directory to prevent this. -
If
RMakefile.spawnbut noRMakefileexists, thenrmkexits after all directories are processed. -
One possible application for
RMakefile.spawnis to easily triggerrmkfrom within "data directories" of a project (e.g., compile sources in another directory from a directory of OpenGL shaders, which don't require compiling).
RMakefile.proj¶ ↑
-
This file defines the project root as the parent directory of its directory.
-
Nested projects have one single
RMakefile.projin the “top” project. -
RMakefile.projmay be empty then it defines the project root. -
RMakefile.projmay also contain project-global settings: Every nested project will include this file.RMakefile.projis the first project configuration file that is read and evaluated byrmk. -
If
rmkdoes not findRMakefile.projin any path toward the root directory/, the parent of the current directory is assumed to be the project root. Althoughrmkwill issue only a warning, we suggest to not treatRMakefile.projoptional.
RMakefile.priv¶ ↑
-
This file is optional:
RMakefile.privtypically contains local settings that is not under revision control. -
If
RMakefile.privexists then it is read and evaluated afterRMakefile.proj. -
If the project contains sub-projects there may be multiple
RMakefile.privfiles, one per sub-directory. They are evaluated "top-down" from the project root directory. -
RMakefile.privis supposed to store project settings. We recommend to have no more than oneRMakefile.priv(in the same directory asRMakefile.proj) for a project with sub-projects.
RMakefile¶ ↑
-
This file defines your project or sub-project.
-
It contains specifications of used tools and packages. In addition, it specifies use of other projects (i.e., project libraries).
-
This is the most important file.
Remarks¶ ↑
-
For building (no
-gswitch),rmkacts only as a "wrapper" that starts the Ninja. For this, configuration ofrmkand its tools and packages is not required and will not be not performed! -
Use the verbose option
-v3to see which files are read. -
You can always place Ruby code in any configuration file to trace execution. Output via
RMK.loggerevaluates level of verbosity. Besides that,Rmk.dump(available_packages)stores package information to a YAML file for inspection.