OMAKE(1)
π OMAKE(1) β General Commands Manual π
β¨ NAME β¨
omake, osh β make-like build utility and its shell. No cap, that's the whole vibe. π
πΈ SYNOPSIS πΈ
omake [OPTION...] [TARGET...]
osh [OPTION...]
π¦ DESCRIPTION π¦
okay so 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. Periodt.
π OMake π
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. It's giving organized. π₯
π Osh π
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. Iconic.
See also the OMake Manual, chapters 11, βShell commandsβ and 15, βThe Osh shellβ.
β¨ OPTIONS β¨
The options are presented in functionally related sections. Within these the options are sorted alphabetically in case-insensitive order. Bestie, keep that in mind. π«Ά
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. Not me pointing out the double dash, but it's literally there. π
π¨ Build Control π¨
--absnameβ Enforce that filenames always expand to their absolute pathnames. β¨Nβ©
Note: This is an experimental option. It may become deprecated.
--all-dependenciesβ If the options--print-dependenciesor--show-dependenciesare given, print transitive dependencies. This means that all dependencies will be printed recursively. Otherwise no effect. β¨Nβ©--configureβ Recompute static. sections of the included omake files, instead of trusting the cached results. β¨Nβ©--dependβ Do not trust the cached dependency information. This will force files to be rescanned for dependency information. β¨Nβ©--flush-includesβ Do not trust cached*.omcfiles. β¨Nβ©-j JOB-SPECβJOB-SPECis 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.
-kβ Do not stop when an error occurs; continue to build as much of the project as possible. This option is implied by-pand-P. β¨Nβ©
Mnemonic: βkeep on makingβ.
-nβ Print commands, but do not execute them. β¨Nβ©
Mnemonic: βno operationβ.
-Pβ Keep on polling the filesystem for changes βforeverβ; implies-kand-p. β¨Nβ©-pβ 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β.
--print-dependenciesβ Collect and print dependency information for theTARGETs on the command line. β¨Nβ©--projectβ Ignore the current directory and build the project. β¨Nβ©-Rβ 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.DEFAULTtargets in the current directory and its subdirectories. If the-Roption 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 TARGETβ Show dependencies (only) ifTARGETis built.-tβ Update the OMake database to force all target files of the project are considered up-to-date. β¨Nβ©-Uβ 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-dependenciesor--show-dependenciesis 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β©-warn-errorβ Treat warnings as errors. β¨Nβ©-Wdeclareβ Warn about undeclared variables. β¨Nβ©
π Output π
-o SHORT-OPTION...β 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-OPTIONis 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.
P(uppercase) β Equivalent to--progress.p(lowercase) β Equivalent to--no--progress.S(uppercase) β Equivalent to-S.s(lowercase) β Equivalent to--no-S.W(uppercase) β Equivalent to-w.w(lowercase) β Equivalent to--no-w.X(uppercase) β Equivalent to--print-exit.x(lowercase) β Equivalent to--no-print-exit.
--output-at-endβ The output of the failed commands will be printed after OMake has finished. Off by default, unless-kis enabled (directly or via-p/-P). β¨Nβ©--output-normalβ Relay the output of the rule commands to the OMake output right away. This is the default when no--output-postponeand no--output-only-errorsflags are given. β¨Nβ©--output-only-errorsβ 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β©
--output-postponeβ 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-exitβ Print the exit codes of all commands that have been run. β¨Nβ©--print-statusβ Print status lines (starting with β+β or β-β). This is the default setting. β¨Nβ©--progressβ Print a progress indicator; enabled by default if stdout is a terminal and disabled if the output has been redirected. β¨Nβ©-Sβ Do not print commands as they are executed unless they produce any output or they fail. This is the default. β¨Nβ©-sβ Never print commands before they are executed. β¨Nβ©
Mnemonic: βsilentβ.
--verboseβ Switch on very verbose output. This option is equivalent to
--no-S --print-status --print-exit VERBOSE=true
-wβ 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β©
ποΈ Cache Management ποΈ
--force-dotomakeβ Always use the directory$HOME/.omakefor*.omc-cachefiles. β¨Nβ©--dotomake DIRECTORYβ Use the specifiedDIRECTORYin place of$HOME/.omakefor the storage of*.omc-files.--save-intervalDURATION β saves the build DB (.omakedb) every DURATION seconds (0disables it, default:60). β¨
Shell Related
-cCOMMAND β executes COMMAND. β¨Nβ©-iβ treats the session as interactive. β¨Nβ©--shellβ runs the OMake shell:osh. β¨Nβ©
Debugging
-allow-exceptionsβ does not catch top-level exceptions. This one's useful if you're running withOCAMLRUNPARAM=b. β¨Nβ©-debug-active-rulesβ debugs active rules. β¨Nβ©-debug-ast-lexβ prints tokens as they're scanned. β¨Nβ©-debug-buildβ shows debugging info during the build. β¨Nβ©-debug-cacheβ shows cache debugging info. β¨Nβ©-debug-dbβ debugs the file database. β¨Nβ©-debug-depsβ shows dependency info as it's scanned. β¨Nβ©-debug-evalβ debugs the evaluator. β¨Nβ©-debug-execβ shows execution debugging info. β¨Nβ©-debug-hashβ showsLm_hashstatistics. β¨Nβ©-debug-implicitβ shows debugging info for implicit rule selection. β¨Nβ©-debug-lexβ debugs the lexer. β¨Nβ©-debug-lexgenβ debugs the lexer generator. β¨Nβ©-debug-notifyβ debugs the FAM (-pfilesystem watch) operations. β¨Nβ©-debug-parseβ debugs the parser. β¨Nβ©-debug-parsegenβ debugs the parser generator. β¨Nβ©-debug-parsingβ debugs OMake parsing operations. β¨Nβ©-debug-posβ prints source position info on error. β¨Nβ©-debug-remoteβ debugs remote execution. β¨Nβ©-debug-ruleβ shows debugging info about rule execution. β¨Nβ©-debug-scannerβ shows debugging info for scanner selection. β¨Nβ©-debug-shellβ debugs shell operations. β¨Nβ©-debug-threadβ shows thread operations. β¨Nβ©-extended-rusageβ prints more about resource usage. β¨Nβ©-instrumentβ does instrument functions. β¨Nβ©-print-astβ prints the AST after parsing. β¨Nβ©-print-filesβ prints the files as they're read. β¨Nβ©-print-irβ prints the IR. β¨Nβ©-print-locβ also prints locations. β¨Nβ©-trace-posβ traces the program execution. β¨Nβ©-print-rulesβ prints the rules after evaluation. β¨Nβ©
Miscellaneous
--installβ installs the default filesOMakefileandOMakerootof an OMake project into the current directory. This is usually done just once to start an OMake project here. β¨Nβ©--install-allβ in addition to installing the defaultOMakefileandOMakerootfiles into the current directory, it installs defaultOMakefiles 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 calledCVS,RCCS, etc. β¨Nβ©--install-forceβ normally OMake prompts before overwriting any existingOMakefile. With this option, all files get overwritten with no prompting; implies--install. β¨Nβ©--helpβ displays the help message and exits.--help-allβ displays the help message for all options and exits.--help-debugβ displays the help message just for the debugging-related options and exits.--serverSERVER-NAME β runs as a remote server called SERVER-NAME.--versionβ prints the version string and the default library directory, then exits.
β¨ EXIT STATUS β¨
0β no problems; everything went well. slay1β build failure caused by a program with non-zero exit code. oof2β 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.
πΈ ENVIRONMENT πΈ
OMAKEFLAGSβ if defined,OMAKEFLAGSshould contain a set of options exactly as they are specified on the command line.OMAKELIBβ if defined,OMAKELIBrefers to the installed location of the OMake standard library. This is the directory that containsPervasives.ometc. On a Unix system, this is often/usr/lib/omakeor/usr/local/lib/omake, and on Win32 systems it is oftenc:\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.
bestie, don't set OMAKELIB unless you really know what you're doing β it literally says normally it should not be set. π
π FILES π
OMakerootβ this file is required; it serves to identify the project root, and it contains code that sets up the project.OMakefileβ any project-specific configuration lives in theOMakefiles..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.
π¦ EXAMPLES π¦
OMake
- This is an almost minimal
OMakerootfile.
## Setup for building a C- or C++-project.
open build/C
## Define according our configuration.
DefineCommandVars()
## Include the OMakefile in this directory.
.SUBDIRS: .
- Small
OMakefilefile 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)
Osh
- 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
$
π SEE ALSO π
That's the whole vibe, bestie! This page is from the OMake(1) manual, dated 2021-11-17. Now go build something iconic. πβ¨
π¦ where this page comes from
- alpine 3.24: ocaml-omake-doc 0.10.6-r1 Β· GPL-2.0-only
- debian bookworm: omake 0.10.5-2
- debian trixie: omake 0.10.7-1
- fedora 43: ocaml-omake 0.10.7-5.fc43 Β· MIT AND LGPL-2.1-only AND GPL-2.0-only WITH cryptsetup-OpenSSL-exception AND GPL-2.0-or-later
- fedora 44: ocaml-omake 0.10.7-7.fc44 Β· MIT AND LGPL-2.1-only AND GPL-2.0-only WITH cryptsetup-OpenSSL-exception AND GPL-2.0-or-later
- nixos 26.05: omake 0.10.7
- nixpkgs unstable: omake 0.10.7
- ubuntu noble: omake 0.10.6-2
- ubuntu questing: omake 0.10.7-1
- ubuntu resolute: omake 0.10.7-1build1
- ubuntu stonking: omake 0.10.7-1build1
- Copyright (C) 2021 by Christoph L. Spiel
- Copyright (C) 2007-2018 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms