@c Cygwin, MS DOS and maybe others.
@c @end itemize
+@section Why to Use OMK?
+
@section Quick Start
If you get some sources, which are distributed with OMK, usually the
@section Dependency Tracking
OMK automatically handles tracking of dependencies of compiled
-projects. It uses gcc's @option{-Mx} options to do this for object
-files. This way, whenever you change some header file, OMK recompiles
-only those files, where the changed header was really included.
+projects. It uses gcc's @option{-M@var{x}} options to do this for
+object files. This way, whenever you change some header file, OMK
+recompiles only those files, where the changed header was really
+included.
Dependencies are also kept for libraries and binaries. OMK parses linker
-map files, so a change to some library causes all programs using this
-library to be recompiled.
+map files, so a change to some library causes recompilation of all
+programs using this library.
@section Compiling Simple Programs
+To tell OMK to compile a program, you need to set some variables in
+@file{Makefile.omk} (usually) in the directory where program sources are
+located.
+
+In the example bellow a program @command{test} will be compiled from
+source @file{test.c}.
+
+@example
+@verbatiminclude ../tests/programs/Makefile.omk
+@end example
+
+@noindent The variables are:
+
+@defvar bin_PROGRAMS
+Contains a list of names (whitespace separated) of programs to be
+compiled in this directory.
+@end defvar
+
+@defvar @var{program name}_SOURCES
+For every program name in @code{bin_PROGRAMS}, this variable contains a
+list of sources that are needed to compile the executable. OMK uses an
+extension of the filename to determine the compiler to compile this
+source.
+@end defvar
+
+@defvar @var{program name}_LIBS
+This variable contains a list of libraries the program @var{program
+name} needs to be linked to.
+@end defvar
+
+@defvar LOADLIBES
+This variable contains a list of libraries all programs in this
+directory needs to be linked to.
+@end defvar
+
+@defvar INCLUDES
+Directives passed to the C or C++ compiler with additional directories
+to be searched for header files. This variable applies to all
+compilations invoked in the current directory.
+@example
+INCLUDES = -Imy_include_dir
+@end example
+@end defvar
+
+@defvar DEFS
+Directives passed to the C or C++ compiler with preprocessor macro
+definitions. This variable applies to all compilations invoked in the
+current directory.
+@example
+DEFS = -DDEBUG=1
+@end example
+@end defvar
+
+
+
+@c FIXME: INCLUDES variable should not be set by rtlinux rules.
+
@section Libraries
LN_INCLUDES
+@section Multiple Directories
+
+ALL_OMK_SUBDIRS
+SUBDIRS
+
@node Configuration and Conditional Compilation
@section Configuration and Conditional Compilation
Renaming of some file => dependency problems.
+Manual compilation ... V=1
+
@chapter OMK Reference