- The standard OMakeroot file defines the functions are
- rules for building standard projects.
- VARIABLES
- ROOT The root directory of the current project.
- CWD The current working directory (the directory is set
- for each OMakefile in the project).
- EMPTY The empty string.
- STDROOT
The name of the standard installed OMakeroot file.
- VERBOSE
Whether certain commands should be verbose (false
by default).
- ABORT_ON_COMMAND_ERROR
If set to true, the construction of a target should
be aborted whenever one of the commands to build it fail. This
defaults to true, and should normally be left that way.
- SCANNER_MODE
This variable should be defined as one of four
values (defaults to enabled).
- enabled
Allow the use of default .SCANNER rules.
Whenever a rule does not specify a :scanner: dependency explicit
ly, try to find a .SCANNER with the same target name.
- disabled
Never use default .SCANNER rules.
- warning
Allow the use of default .SCANNER rules, but
print a warning whenever one is selected.
- error Do not allow the use of default .SCANNER
- rules. If a rule does not specify a :scanner: dependency, and
- there is a default .SCANNER rule, the build will terminate abnor
- mally.
- SYSTEM VARIABLES
- INSTALL
The command to install a program (install on Unix,
cp on Win32).
- PATHSEP
The normal path separator (: on Unix, ; on Win32).
- DIRSEP The normal directory separator (/ on Unix, on
- Win32).
- EXT_LIB
File suffix for a static library (default is .a on
Unix, and .lib on Win32).
- EXT_OBJ
File suffix for an object file (default is .o on
Unix, and .obj on Win32).
- EXT_ASM
File suffix for an assembly file (default is .s on
Unix, and .asm on Win32).
- EXE File suffix for executables (default is empty for
- Unix, and .exe on Win32 and Cygwin).
- omake provides extensive support for building C programs.
- C CONFIGURATION VARIABLES
- The following variables can be redefined in your project.
- CC The name of the C compiler (on Unix it defaults to
- gcc when gcc is present and to cc otherwise; on Win32 defaults to
- cl /nologo).
- CXX The name of the C++ compiler (on Unix it defaults
- to gcc when gcc is present and to c++ otherwise; on Win32 de
- faults to cl /nologo).
- CPP The name of the C preprocessor (defaults to cpp on
- Unix, and cl /E on Win32).
- CFLAGS Compilation flags to pass to the C compiler (de
- fault empty on Unix, and /DWIN32 on Win32).
- CXXFLAGS
Compilation flags to pass to the C++ compiler (de
fault empty on Unix, and /DWIN32 on Win32).
- INCLUDES
Additional directories that specify the search path
to the C and C++ compilers (default is .). The directories are
passed to the C and C++ compilers with the -I option. The in
clude path with -I prefixes is defined in the PREFIXED_INCLUDES
variable.
- LIBS Additional libraries needed when building a program
- (default is empty).
- AS The name of the assembler (defaults to as on Unix,
- and ml on Win32).
- ASFLAGS
Flags to pass to the assembler (default is empty on
Unix, and /c /coff on Win32).
- AR The name of the program to create static libraries
- (defaults to ar cq on Unix, and lib on Win32).
- AROUT The option string that specifies the output file
- for AR.
- LD The name of the linker (defaults to ld on Unix, and
- cl on Win32).
- LDFLAGS
Options to pass to the linker (default is empty).
- YACC The name of the yacc parser generator (default is
- yacc on Unix, empty on Win32).
- LEX The name of the lex lexer generator (default is lex
- on Unix, empty on Win32).
- CGENERATEDFILES, LOCALCGENERATEDFILES
- CGeneratedFiles(files)
LocalCGeneratedFiles(files)
- The CGeneratedFiles and LocalCGeneratedFiles functions
- specify files that need to be generated before any C files are
- scanned for dependencies. For example, if config.h and inputs.h
- are both generated files, specify:
CGeneratedFiles(config.h inputs.h)
- The CGeneratedFiles function is global --- its arguments
- will be generated before any C files anywhere in the project are
- scanned for dependencies. The LocalCGeneratedFiles function fol
- lows the normal scoping rules of OMake.
- STATICCLIBRARY
- The StaticCLibrary builds a static library.
- StaticCLibrary(<target>, <files>)
- The <target> does not include the library suffix, and The
- <files> list does not include the object suffix. These are ob
- tained from the EXT_LIB and EXT_OBJ variables.
- This function returns the library filename.
- The following command builds the library libfoo.a from the
- files a.o b.o c.o on Unix, or the library libfoo.lib from the
- files a.obj b.obj c.obj on Win32.
- StaticCLibrary(libfoo, a b c)
- STATICCLIBRARYCOPY
- The StaticCLibraryCopy function copies the static library
- to an install location.
- StaticCLibraryCopy(<tag>, <dir>, <lib>)
- The <tag> is the name of a target (typically a .PHONY tar
- get); the <dir> is the installation directory, and <lib> is the
- library to be copied (without the library suffix).
- This function returns the filename of the library in the
- target directory.
- For example, the following code copies the library lib
- foo.a to the /usr/lib directory.
- StaticCLibraryCopy(install, /usr/lib, libfoo)
- STATICCLIBRARYINSTALL
- The StaticCLibraryInstall function builds a library, and
- sets the install location in one step. It returns the filename of
- the library in the target directory.
- StaticCLibraryInstall(<tag>, <dir>, <libname>, <files>)
- StaticCLibraryInstall(install, /usr/lib, libfoo, a b c)
- STATICCOBJECT, STATICCOBJECTCOPY, STATICCOBJECTINSTALL
- These functions mirror the StaticCLibrary, StaticCLi
- braryCopy, and StaticCLibraryInstall functions, but they build an
- object file (a .o file on Unix, and a .obj file on Win32).
- CPROGRAM
- The CProgram function builds a C program from a set of ob
- ject files and libraries.
- CProgram(<name>, <files>)
- The <name> argument specifies the name of the program to
- be built; the <files> argument specifies the files to be linked.
- The function returns the filename of the executable.
- Additional options can be passed through the following
- variables.
- CFLAGS Flags used by the C compiler during the link step.
- LDFLAGS
Flags to pass to the loader.
- LIBS Additional libraries to be linked.
- For example, the following code specifies that the program
- foo is to be produced by linking the files bar.o and baz.o and
- libraries libfoo.a.
- section
LIBS = libfoo$(EXT_LIB)
CProgram(foo, bar baz)
- CPROGRAMCOPY
- The CProgramCopy function copies a file to an install lo
- cation.
- CProgramCopy(<tag>, <dir>, <program>)
- CProgramCopy(install, /usr/bin, foo)
- CPROGRAMINSTALL
- The CProgramInstall function specifies a program to build,
- and a location to install, simultaneously.
- CProgramInstall(<tag>, <dir>, <name>, <files>)
- section
LIBS = libfoo$(EXT_LIB)
CProgramInstall(install, /usr/bin, foo, bar baz)
- CXXPROGRAM, CXXPROGRAMINSTALL
- The CXXProgram and CXXProgramInstall functions are equiva
- lent to their C counterparts, except that would use $(CXX) and
- $(CXXFLAGS) for linking instead of $(CC) and $(CFLAGS).
- VARIABLES FOR OCAML PROGRAMS
- The following variables can be redefined in your project.
- USE_OCAMLFIND
Whether to use the ocamlfind utility (default false
- OCAMLC The OCaml bytecode compiler (default ocamlc.opt if
- it exists and USE_OCAMLFIND is not set, otherwise ocamlc).
- OCAMLOPT
The OCaml native-code compiler (default ocam
lopt.opt if it exists and USE_OCAMLFIND is not set, otherwise
ocamlopt).
- CAMLP4 The camlp4 preprocessor (default camlp4).
- OCAMLLEX
The OCaml lexer generator (default ocamllex).
- OCAMLLEXFLAGS
The flags to pass to ocamllex (default -q).
- OCAMLYACC
The OCaml parser generator (default ocamlyacc).
- OCAMLDEP
The OCaml dependency analyzer (default ocamldep).
- OCAMLMKTOP
The OCaml toploop compiler (default ocamlmktop).
- OCAMLLINK
The OCaml bytecode linker (default $(OCAMLC)).
- OCAMLOPTLINK
The OCaml native-code linker (default $(OCAMLOPT)).
- OCAMLINCLUDES
Search path to pass to the OCaml compilers (default
.). The search path with the -I prefix is defined by the PRE
FIXED_OCAMLINCLUDES variable.
- OCAMLFIND
The ocamlfind utility (default ocamlfind if
USE_OCAMLFIND is set, otherwise empty).
- OCAMLFINDFLAGS
The flags to pass to ocamlfind (default empty,
USE_OCAMLFIND must be set).
- OCAMLPACKS
Package names to pass to ocamlfind (USE_OCAMLFIND
must be set).
- BYTE_ENABLED
Flag indicating whether to use the bytecode compil
er (default true, when no ocamlopt found, false otherwise).
- NATIVE_ENABLED
Flag indicating whether to use the native-code com
piler (default true, when ocamlopt is found, false otherwise).
Both BYTE_ENABLED and NATIVE_ENABLED can be set to true; at least
one should be set to true.
- OCAML COMMAND FLAGS
- The following variables specify additional options to be
- passed to the OCaml tools.
- OCAMLDEPFLAGS
Flags to pass to OCAMLDEP.
- OCAMLPPFLAGS
Flags to pass to CAMLP4.
- OCAMLCFLAGS
Flags to pass to the byte-code compiler (default
-g).
- OCAMLOPTFLAGS
Flags to pass to the native-code compiler (default
empty).
- OCAMLFLAGS
Flags to pass to either compiler (default -warn-er
ror A).
- OCAMLINCLUDES
Include path (default .).
- OCAML_BYTE_LINK_FLAGS
Flags to pass to the byte-code linker (default emp
ty).
- OCAML_NATIVE_LINK_FLAGS
Flags to pass to the native-code linker (default
empty).
- OCAML_LINK_FLAGS
Flags to pass to either linker.
- LIBRARY VARIABLES
- The following variables are used during linking.
- OCAML_LIBS
Libraries to pass to the linker. These libraries
become dependencies of the link step.
- OCAML_OTHER_LIBS
Additional libraries to pass to the linker. These
libraries are not included as dependencies to the link step. Typ
ical use is for the OCaml standard libraries like unix or str.
- OCAML_CLIBS
C libraries to pass to the linker.
- OCAML_LIB_FLAGS
Extra flags for the library.
- OCAMLGENERATEDFILES, LOCALOCAMLGENERATEDFILES
- OCamlGeneratedFiles(files)
LocalOCamlGeneratedFiles(files)
- The OCamlGeneratedFiles and LocalOCamlGeneratedFiles func
- tions specify files that need to be generated before any OCaml
- files are scanned for dependencies. For example, if parser.ml and
- lexer.ml are both generated files, specify:
OCamlGeneratedFiles(parser.ml lexer.ml)
- The OCamlGeneratedFiles function is global --- its argu
- ments will be generated before any OCaml files anywhere in the
- project are scanned for dependencies. The LocalOCamlGenerated
- Files function follows the normal scoping rules of OMake.
- OCAMLLIBRARY
- The OCamlLibrary function builds an OCaml library.
- OCamlLibrary(<libname>, <files>)
- The <libname> and <files> are listed without suffixes.
- Additional variables used by the function:
- ABORT_ON_DEPENDENCY_ERRORS
The linker requires that the files to be listed in
dependency order. If this variable is true, the order of the
files is determined by the command line, but omake will abort
with an error message if the order is illegal. Otherwise, the
files are sorted automatically.
- This function returns the list of all the targets that it
- defines the rules for (including the $(name)$(EXT_LIB) file when
- NATIVE_ENABLED is set).
- The following code builds the libfoo.cmxa library from the
- files foo.cmx and bar.cmx (if NATIVE_ENABLED is set), and lib
- foo.cma from foo.cmo and bar.cmo (if BYTE_ENABLED is set).
- OCamlLibrary(libfoo, foo bar)
- OCAMLLIBRARYCOPY
- The OCamlLibraryCopy function copies a library to an in
- stall location.
- OCamlLibraryCopy(<tag>, <libdir>, <libname>, <interface
- files>)
- The <interface-files> specify additional interface files
- to be copied if the INSTALL_INTERFACES variable is true.
- OCAMLLIBRARYINSTALL
- The OCamlLibraryInstall function builds a library and
- copies it to an install location in one step.
- OCamlLibraryInstall(<tag>, <libdir>, <libname>, <files>)
- OCAMLPROGRAM
- The OCamlProgram function builds an OCaml program. It re
- turns the array with all the targets for which it have defined
- the rules ($(name)$(EXE) and $(name).run and/or $(name).opt, de
- pending on the NATIVE_ENABLED and BYTE_ENABLED variables).
- OCamlProgram(<name>, <files>)
- Additional variables used:
- OCAML_LIBS
Additional libraries passed to the linker, without
suffix. These files become dependencies of the target program.
- OCAML_OTHER_LIBS
Additional libraries passed to the linker, without
suffix. These files do not become dependencies of the target pro
gram.
- OCAML_CLIBS
C libraries to pass to the linker.
- OCAML_BYTE_LINK_FLAGS
Flags to pass to the bytecode linker.
- OCAML_NATIVE_LINK_FLAGS
Flags to pass to the native code linker.
- OCAML_LINK_FLAGS
Flags to pass to both linkers.
- OCAMLPROGRAMCOPY
- The OCamlProgramCopy function copies an OCaml program to
- an install location.
- OCamlProgramCopy(<tag>, <bindir>, <name>)
- Additional variables used:
- NATIVE_ENABLED
If NATIVE_ENABLED is set, the native-code exe
cutable is copied; otherwise the byte-code executable is copied.
- OCAMLPROGRAMINSTALL
- The OCamlProgramInstall function builds a programs and
- copies it to an install location in one step.
- OCamlProgramInstall(<tag>, <bindir>, <name>, <files>)
- CONFIGURATION VARIABLES
- The following variables can be modified in your project.
- LATEX The LaTeX command (default latex).
- TETEX2_ENABLED
Flag indicating whether to use advanced LaTeX op
tions present in TeTeX v.2 (default value is determined the first
time omake reads LaTeX.src and depends on the version of LaTeX
you have installed).
- LATEXFLAGS
The LaTeX flags (defaults depend on the TETEX2_EN
ABLED variable)
- BIBTEX The BibTeX command (default bibtex).
- MAKEINDEX
The command to build an index (default makeindex).
- DVIPS The .dvi to PostScript converter (default dvips).
- DVIPSFLAGS
Flags to pass to dvips (default -t letter).
- DVIPDFM
The .dvi to .pdf converter (default dvipdfm).
- DVIPDFMFLAGS
Flags to pass to dvipdfm (default -p letter).
- PDFLATEX
The .latex to .pdf converter (default pdflatex).
- PDFLATEXFLAGS
Flags to pass to pdflatex (default is empty).
- USEPDFLATEX
Flag indicating whether to use pdflatex instead of
dvipdfm to generate the .pdf document (default false).
- LATEXDOCUMENT
- The LaTeXDocument produces a LaTeX document.
- LaTeXDocument(<name>, <texfiles>)
- The document <name> and <texfiles> are listed without suf
- fixes. This function returns the filenames for the generated .ps
- and .pdf files.
- Additional variables used:
- TEXINPUTS
The LaTeX search path (an array of directories, de
fault is taken from the TEXINPUTS environment variable).
- TEXDEPS
Additional files this document depends on.
- TEXGENERATEDFILES, LOCALTEXGENERATEDFILES
- TeXGeneratedFiles(files)
LocalTeXGeneratedFiles(files)
- The TeXGeneratedFiles and LocalTeXGeneratedFiles functions
- specify files that need to be generated before any LaTeXfiles are
- scanned for dependencies. For example, if config.tex and in
- puts.tex are both generated files, specify:
TeXGeneratedFiles(config.tex inputs.tex)
- The TeXGeneratedFiles function is global --- its arguments
- will be generated before any TeX files anywhere in the project
- are scanned for dependencies. The LocalTeXGeneratedFiles function
- follows the normal scoping rules of OMake.
- LATEXDOCUMENTCOPY
- The LaTeXDocumentCopy copies the document to an install
- location.
- LaTeXDocumentCopy(<tag>, <libdir>, <installname>, <doc
- name>)
- This function copies just the .pdf and .ps files.
- LATEXDOCUMENTINSTALL
- The LaTeXDocumentInstall builds a document and copies it
- to an install location in one step.
- LaTeXDocumentInstall(<tag>, <libdir>, <installname>, <doc
- name>, <files>)