DOKK / manpages / debian 12 / omake / omake.1.en
OMAKE(1) General Commands Manual OMAKE(1)

omake, osh - make-like build utility and its shell

omake [OPTION...] [TARGET...]
osh [OPTION...]

OMake constructs projects in a way similar to make(1) in particular GNU-Make. When OMake needs to spawn a shell it uses its own shell, Osh. The shell can also be used standalone either as omake --shell or as osh(1) if the appropriate link has been installed.

OMake is designed for building projects that have source files in several directories. Projects are normally specified using an OMakefile in each of the project directories, and an OMakeroot file in the root directory of the project. The OMakeroot file specifies general build rules, and the OMakefiles specify the build parameters specific to each of the subdirectories. When OMake runs, it walks the configuration tree, evaluating rules from all of the OMakefiles. The project is then built from the entire collection of build rules.

OMake also includes the standalone command-line interpreter osh that can be used as an interactive shell. This shell uses the same syntax, and provides the same features on all platforms that OMake supports, including Win32.

See also the OMake Manual, chapters 11, “Shell commands” and 15, “The Osh shell”.

The options are presented in functionally related sections. Within these the options are sorted alphabetically in case-insensitive order.

Options marked with ‘⟨N⟩’ can be negated by prefixing them with ‘--no’ as, e.g., --no-S or --no--print-status. Note the conserved inner double dash of the latter, though.

Enforce that filenames always expand to their absolute pathnames. ⟨N⟩
Note: This is an experimental option. It may become deprecated.
If the options --print-dependencies or --show-dependencies are given print transitive dependencies. This means that all dependencies will be printed recursively. Otherwise no effect. ⟨N⟩
Recompute static. sections of the included omake files, instead of trusting the cached results. ⟨N⟩
Do not trust the cached dependency information. This will force files to be rescanned for dependency information. ⟨N⟩
Do not trust cached *.omc files. ⟨N⟩
JOB-SPEC is either the maximum number of jobs to run in parallel.
Or, JOB-SPEC specifies servers for remote execution of commands in the form of a colon separated list of SERVER-NAME=NUMBER-OF-JOBS pairs. For example, the option

-j 2:small.host.org=1:large.host.org=4
    
would specify that up to 2 jobs can be executed locally, 1 on the server small.host.org and 4 on large.host.org. Each remote server must use the same filesystem location for the project.
Remote execution is currently an experimental feature. Remote filesystems like NFS do not provide adequate file consistency for this to work.
Do not stop when an error occurs; continue to build as much of the project as possible. This option is implied by -p and -P. ⟨N⟩
Mnemonic: “keep on making”.
Print commands, but do not execute them. ⟨N⟩
Mnemonic: “no operation”.
Keep on polling the filesystem for changes “forever”; implies -k and -p. ⟨N⟩
Watch the filesystem for changes, and continue the build until it succeeds. If this option is specified, OMake will restart the build whenever source files are modified. This option implies -k. ⟨N⟩
Mnemonic: “poll filesystem”.
Collect and print dependency information for the TARGETs on the command line. ⟨N⟩
Ignore the current directory and build the project. ⟨N⟩
Ignore the current directory and build the project from its root directory. When OMake is run in a subdirectory of a project and no explicit targets are given on the command line, it would normally only build files within the current directory and its subdirectories. More precisely: it builds all the .DEFAULT targets in the current directory and its subdirectories. If the -R option is specified, the build is performed as if OMake were run in the project root.
In other words, with the -R option all the relative targets specified on the command line will be taken relative to the project root instead of relative to the current directory. When no targets are given on the command line, all the .DEFAULT targets in the project will be built regardless of the current directory. ⟨N⟩
Mnemonic: “root build”.
Show dependencies (only) if TARGET is built.
Update the OMake database to force all target files of the project are considered up-to-date. ⟨N⟩
Do not trust the dependency cache or cached OMakefiles. This will force the entire project to be rebuilt. ⟨N⟩
--verbose-dependencies
If either one of the options --print-dependencies or --show-dependencies is in effect, print transitive dependencies. That is, print all dependencies recursively. If neither of the above options is specified, this option has no effect. ⟨N⟩
Treat warnings as errors. ⟨N⟩
Warn about undeclared variables. ⟨N⟩

Short output options alias the functionality of some options or combinations thereof. In general, an uppercase character turns the option on, whereas a lowercase character turns the option off. SHORT-OPTION is one of following letters.
0
Equivalent to

-s --output-only-errors --no-progress
    
This option specifies that omake should be as quiet as possible. If any errors occur during the build, the output is delayed until the build terminates. Output from successful commands is discarded.
1
Equivalent to

-S --progress --output-only-errors
    
This is a slightly more relaxed version of “quiet” output. The output from successful commands is discarded. The output from failed commands is printed immediately after the command complete. The output from failed commands is displayed twice: once immediately after the command completes, and again when the build completes. A progress bar is displayed so that you know when the build is active. Include the -p option if you want to turn off the progress bar (for example omake -o 1p).
2
Equivalent to

--progress --output-postpone
    
The is even more relaxed, output from successful commands is printed. This is often useful for deinterleaving the output when using option -j.
Equivalent to --progress.
Equivalent to --no--progress.
Equivalent to -S.
Equivalent to --no-S.
Equivalent to -w.
Equivalent to --no-w.
Equivalent to --print-exit.
Equivalent to --no-print-exit.
The output of the failed commands will be printed after OMake has finished. Off by default, unless -k is enabled (directly or via -p/-P). ⟨N⟩
Relay the output of the rule commands to the OMake output right away. This is the default when no --output-postpone and no --output-only-errors flags are given. ⟨N⟩
Same as --output-postpone, but postponed output will only be printed for commands that fail.
This can be useful in reducing unwanted output so that the user can concentrate on any errors. ⟨N⟩
Postpone printing command output until a rule terminates. Then print it as a single block.
This is useful in combination with the -j option, where the output of multiple subprocesses can be garbled. The diversion is printed as a single coherent unit. ⟨N⟩
Print the exit codes of all commands that have been run. ⟨N⟩
Print status lines (starting with ‘+’ or ‘-’). This is the default setting. ⟨N⟩
Print a progress indicator; enabled by default if stdout is a terminal and disabled if the output has been redirected. ⟨N⟩
Do not print commands as they are executed unless they produce any output or they fail. This is the default. ⟨N⟩
Never print commands before they are executed. ⟨N⟩
Mnemonic: “silent”.
Switch on very verbose output. This option is equivalent to

--no-S --print-status --print-exit VERBOSE=true
    
Print the directory in “make format” as commands are executed. This is mainly useful for editors that expect make-style directory information for determining the location of errors. ⟨N⟩

Always use the directory $HOME/.omake for *.omc-cache files. ⟨N⟩
Use the specified DIRECTORY in place of $HOME/.omake for the storage of *.omc-files.
Save the build DB (.omakedb) every DURATION seconds (0 disables, default: 60).
Execute COMMAND.
Treat the session as interactive. ⟨N⟩
Run the OMake shell: osh. ⟨N⟩

Do not catch top-level exceptions. This option is useful if running with OCAMLRUNPARAM=b. ⟨N⟩
Debug active rules. ⟨N⟩
Print tokens as they are scanned. ⟨N⟩
Display debugging information during the build. ⟨N⟩
Display cache debugging information. ⟨N⟩
Debug the file database. ⟨N⟩
Display dependency information as scanned. ⟨N⟩
Debug the evaluator. ⟨N⟩
Display execution debugging information. ⟨N⟩
Show Lm_hash statistics. ⟨N⟩
Display debugging information for implicit rule selection. ⟨N⟩
Debug the lexer. ⟨N⟩
Debug the lexer generator. ⟨N⟩
Debug the FAM (-p filesystem watch) operations. ⟨N⟩
Debug the parser. ⟨N⟩
Debug the parser generator. ⟨N⟩
Debug OMake parsing operations. ⟨N⟩
Print source position information on error. ⟨N⟩
Debug remote execution. ⟨N⟩
Display debugging information about rule execution. ⟨N⟩
Display debugging information for scanner selection. ⟨N⟩
Debug shell operations. ⟨N⟩
Show thread operations. ⟨N⟩
Print more about resource usage. ⟨N⟩
Do instrument functions. ⟨N⟩
Print the AST after parsing. ⟨N⟩
Print the files as they are read. ⟨N⟩
Print the IR. ⟨N⟩
Also print locations. ⟨N⟩
Trace the program execution. ⟨N⟩
Print the rules after evaluation. ⟨N⟩

Install default files OMakefile and OMakeroot of an OMake project into the current directory. This is typically done only once to start an OMake project in the current directory. ⟨N⟩
--install-all
In addition to installing the default files OMakefile and OMakeroot of an OMake project into the current directory install default OMakefiles into each subdirectory of the current directory. cvs(1) rules are used for filtering the subdirectory list. For example, OMakefiles are not copied into directories called CVS, RCCS, etc. ⟨N⟩
--install-force
Normally, OMake will prompt before it overwrites any existing OMakefile. If this option is given, all files are overwritten without prompting; implies --install. ⟨N⟩
Display help message and exit.
--help-all
Display help message for all options and exit.
--help-debug
Display help message just for the debugging-related options and exit.
Run as a remote server called SERVER-NAME.
Print the version string and the default library directory then exit.

0
No problems; everything went well.
1
Build failure caused by a program with non-zero exit code.
2
Not a build-related error, for example a syntax error in one of the files that constitute the OMake project.
3
Bogus command-line option.

If defined, OMAKEFLAGS should contain a set of options exactly as they are specified on the command line.
If defined, OMAKELIB refers to the installed location of the OMake standard library. This is the directory that contains Pervasives.om etc. On a Unix system, this is often /usr/lib/omake or /usr/local/lib/omake, and on Win32 systems it is often c:\Program Files\OMake\lib.
If not defined, OMake uses the default configured location, which can be inquired with option --version.
Normally, this variable should not be set.

This file is required; it serves to identify the project root, and it contains code that sets up the project.
Any project-specific configuration lives in the OMakefiles.
.om
Conventional filename extension for OMake “library” files.
.omc
For performance OMake compiles all OMake-source files on the fly. Compiled OMake files receive extension .omc.

  • This is an almost minimal OMakeroot file.
    ##  Setup for building a C- or C++-project.
    open build/C
    ##  Define according our configuration.
    DefineCommandVars()
    ##  Include the OMakefile in this directory.
    .SUBDIRS: .
        
  • Small OMakefile file to build the famous “Hello, world!” example.
    ##  Define target-source relationship of a C-program.
    CProgram(hello, hello) # we can be extension agnostic
    ##  Define the default (and only) target.
    .DEFAULT: hello$(EXE)
        

  • Call date(1) with some options via OMake.
    $ omake --shell -c 'date --universal --iso-8601=seconds'
    2021-11-20T14:52:10+00:00
        
  • Call update(1) via Osh.
    $ osh -c uptime
    
    15:54:03 up 6:41, 1 user, load average: 0.02, 0.04, 0.11
  • Interactive use.
    $ osh
    % uname --kernel-release --kernel-version
    5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30)
    % ^D
    $
        

make(1), sh(1).

2021-11-17