]> rtime.felk.cvut.cz Git - omk.git/blobdiff - doc/omk-manual.texinfo
Small fix in documentation
[omk.git] / doc / omk-manual.texinfo
index 46e5959c8ddc5b9c23d8d2f81d1403462cb37bfa..7c026a7c6cc779cb1835c1cd84df0c7f06952ddc 100644 (file)
@@ -1,13 +1,14 @@
 \input texinfo   @c -*-texinfo-*-
 @c %**start of header
 @setfilename omk-manual
+@documentencoding UTF-8
 @settitle OMK: Ocera Make System
 @c %**end of header
 
 @copying
-Manual for Ocera Make System (OMK)
+Manual for Ocera Make System (OMK) version $Id$
 
-Copyright @copyright{} 2007 Michal Sojka, Pavel Pisa
+Copyright @copyright{} 2007, 2008 Michal Sojka, Pavel Pisa
 @end copying
 
 @titlepage
@@ -40,12 +41,10 @@ Copyright @copyright{} 2007 Michal Sojka, Pavel Pisa
 @cindex overview
 
 OMK is an advanced make system written entirely in GNU make. Compiling
-software using OMK requires only GNU make binary and standard UNIX
-utilities (@command{sh}, @command{sed}, @command{cmp} and
-@command{tr}@footnote{@command{tr} is needed only for OMK to be
-compatible with MinGW.}) installed. OMK aims to be developer friendly;
-to use OMK, you do not need to understand (sometimes) cryptic syntax of
-Makefiles.
+software using OMK requires only GNU Make and standard UNIX
+utilities (@command{sh}, @command{sed}, @command{cmp}, ...)
+installed. OMK aims to be developer friendly; to use OMK, you do not
+need to understand (sometimes) cryptic syntax of Makefiles.
 
 You can use OMK on all platforms where you can run GNU Make including
 Cygwin and MinGW. MS DOS was not tested.
@@ -113,6 +112,8 @@ choosing of a make system.
 @end itemize
 
 
+
+
 @node Quick Start, History, Why to Use OMK?, Overview of OMK
 @section Quick Start
 
@@ -130,8 +131,11 @@ make
 
 @enumerate
 @item
-  Take appropriate @file{Makefile.rules}, put it together with leaf
-  @file{Makefile} to the root directory of your project.
+  The newest version of OMK can be found at @uref{http://rtime.felk.cvut.cz/omk/}.
+@item
+  Take appropriate @file{Makefile.rules} (see @ref{Properties of
+  Specific Makefile.rules}), put it together with leaf @file{Makefile}
+  to the root directory of your project.
 @item
   Create @file{Makefile.omk} files in all directories you want to
   compile something. Please refer to @ref{OMK User's Manual} to learn
@@ -146,7 +150,7 @@ make
 @node History,  , Quick Start, Overview of OMK
 @section History
 
-OMK was originally written by Pavel Pisa as a solution to have one
+OMK was originally written by Pavel Píša as a solution to have one
 common make system for OCERA project, where we needed to compile
 user-space programs, Linux kernel modules and RT Linux modules in one
 package. Although this system was not accepted for the whole OCERA
@@ -188,7 +192,9 @@ in the respective directory (e.g. compile a program from several source
 files). Its syntax is very simple -- see the following sections.
 
 Since make searches by default for a @file{Makefile} and not for
-@file{Makefile.rules} or @file{Makefile.omk}, there must be a small
+@file{Makefile.rules} or @file{Makefile.omk}, there must@footnote{When
+USE_LEAF_MAKEFILES is set to @samp{n}, this @file{Makefile} can be
+omitted in subdirectories. @xref{USE_LEAF_MAKEFILES}.} be a small
 generic @file{Makefile} in every directory, whose task is only to find
 @file{Makefile.rules} in the actual or any parent directory and include
 it. This search is performed only once at the beginning of compilation.
@@ -399,7 +405,7 @@ In @file{Makefile.omk}, you specify several variables, which defines how
 the libraries should be compiled. In the example below the library
 @samp{mylib} (full filename will be @file{libmylib.a}) is created from
 two sources @file{funca.c} and @file{funcb.c}. Interface of this library
-is defined in @file{myfunc.h}. Therfore, we export this header for use
+is defined in @file{myfunc.h}. Therefore, we export this header for use
 by other programs.
 
 @example
@@ -410,7 +416,7 @@ by other programs.
 
 @defvar lib_LIBRARIES
   Specifies a list of statically linked libraries to be compiled. OMK
-  automaticvally prepends @code{lib} prefix library names.
+  automatically prepends @code{lib} prefix library names.
 @end defvar
 
 @defvar shared_LIBRARIES
@@ -503,6 +509,7 @@ classic Makefiles that provides all the needed features.
 You can instruct OMK to descend to a (sub)directory by setting the
 @code{SUBDIRS} variable in @file{Makefile.omk}.
 
+@anchor{SUBDIRS}
 @defvar SUBDIRS
   This variable contains a list of directories, in which compilation
   must be also invoked. Usually, names of subdirectories are used, but
@@ -510,9 +517,12 @@ You can instruct OMK to descend to a (sub)directory by setting the
 
   Compilation is invoked in these directories before it is invoked in
   the current directory.
+
+  See also @ref{AUTOMATIC_SUBDIRS}.
 @end defvar
 @c TODO: Write tests for this.
 
+@anchor{ALL_OMK_SUBDIRS}
 @defvar ALL_OMK_SUBDIRS
   This variable is set by OMK and can be used as the value of
   @code{SUBDIRS} variable. It contains a list of all direct
@@ -527,6 +537,13 @@ You can instruct OMK to descend to a (sub)directory by setting the
   @end example
 @end defvar
 
+@anchor{AUTOMATIC_SUBDIRS}
+@defvar AUTOMATIC_SUBDIRS
+  If this variable is set to @samp{y} and @code{SUBDIRS} is not assigned
+  in @file{Makefile.omk}, then @code{SUBDIRS} is assigned a default
+  value @code{$(ALL_OMK_SUBDIRS)}.
+@end defvar
+
 @node Dependency Tracking, Configuration and Conditional Compilation, Multiple Directories, OMK User's Manual
 @section Dependency Tracking
 
@@ -723,9 +740,10 @@ directory.
 @node Common Variables,  , Using Configuration Parameters, Configuration and Conditional Compilation
 @subsection Common Variables
 
-It is common practice to use @file{config.omk} to store project-wide
-settings. Here is the list of variables, which are commonly set here
-(but they can also be set elsewhere, e.g. in @file{Makefile.omk}).
+It is common practice to use @file{config.target} or @file{config.omk}
+to store project-wide settings. Here is the list of variables, which are
+commonly set here (but they can also be set elsewhere, e.g. in
+@file{Makefile.omk}).
 
 You can easily ``reconfigure'' your project by changing the
 @file{config.omk} file. It is useful to have several configurations
@@ -806,7 +824,7 @@ the leaf @file{Makefile} only when it is invoked by simple
 directly.
 
 This feature is useful if you are integrating some non-OMK project into
-your project. You only add @file{Makefile.omk} files to the other
+your project. You only add @file{Makefile.omk} files to the non-OMK
 project and don't need to modify project's original Makefiles.
 
 This variable can be set either globally in a @file{config.*} file or
@@ -893,7 +911,7 @@ in some particular @file{Makefile.rules}.
 @subsection Linux
 
 This @file{Makefile.rules} is used not only for Linux as the name
-sugest, but also for other Unices and even for Windows.
+suggests, but also for other Unices and even for Windows.
 
 @defvar BUILD_OS
   The name of the operating system (OS) where make was invoked.
@@ -910,20 +928,33 @@ sugest, but also for other Unices and even for Windows.
   parameters to interface QT application to the rest of the compilation
   tree.  Then @command{make} is called there to compile QT
   application. Variable @samp{QTDIR} must be set to the directory with
-  QT instalation (e.g. /usr/share/qt4 on Debian).
+  QT installation (e.g. /usr/share/qt4 on Debian).
 @end defvar
 
 
 @node System-Less, RTEMS, Linux, Properties of Specific Makefile.rules
 @subsection System-Less
 
+This @file{Makefile.rules} is designed for compilation of code for
+(small) micro-controllers without operating systems. See
+@uref{http://rtime.felk.cvut.cz/hw/index.php/System-Less_Framework} for
+more information about our framework, which uses this rules.
+
 @node RTEMS,  , System-Less, Properties of Specific Makefile.rules
 @subsection RTEMS
+
+TODO
  
  
 @node Running OMK under Windows OS, Interfacing OMK to popular IDEs, Properties of Specific Makefile.rules, OMK User's Manual
 @section Running OMK under Windows OS
 
+It is possible to use OMK under Windows OS with MinGW (see
+@uref{http://www.mingw.org/}). Unfortunately, the compilation speed is
+much lower than on UNIX systems.
+
+TODO: Is it necessary to install anything special?
+
 @node Interfacing OMK to popular IDEs, Troubleshooting, Running OMK under Windows OS, OMK User's Manual
 @section Interfacing OMK to popular IDEs
 
@@ -1015,15 +1046,19 @@ commands as you are used to do.
   Sometimes, you may want to compile one file the same way as OMK does
   it, but run the compilation manually from command line. For example,
   you want to debug some preprocessor macros and you only want to
-  produce preprocessed source instead of object file.
+  produce preprocessed source instead of an object file.
 
-  To compile something manually, you can run OMK with @command{make
+  To compile something manually, you can run OMK by @command{make
   V=2}. This will print all commands executed together with directory
   navigation messages. Find the command you want to execute manually in
   the output. To run it, you need to change the working directory to the
   correct one in the @file{_build} tree. The correct directory can be
   found in make output on the line @samp{Entering directory} preceding
   the desired command.
+
+@item
+  Currently, C++ sources are supposed to have @file{.cc} or @file{.cxx}
+  extensions. The @file{.cpp} extension is not supported (yet).
 @end itemize
 
 @node Original README, OMK Development, OMK User's Manual, Top
@@ -1054,7 +1089,7 @@ different kernel, RT-Linux etc would be nightmare in other case).
 @item
 Make system should allow to freely move cross-dependant components in
 directory structure without need to update users of moved component (I
-hate somethink like @option{-I../../sched/rtlshwq/include} in CAN makefiles for
+hate something like @option{-I../../sched/rtlshwq/include} in CAN makefiles for
 example. If a component is renamed or version is added to then name,
 all Makefiles in CAN will require update).
 @item
@@ -1118,7 +1153,7 @@ sources directory. Alternatively this file could be moved
 to link tree pointing into readonly media or can be anywhere
 else if @code{MAKERULES_DIR} and @code{SOURCES_DIR} are specified.
 
-@c !!! tohle tam nejak zmizelo, mozna by to chtelo skontrolovat, ze to
+@c !!! tohle tam nejak zmizelo, mozna by to chtelo zkontrolovat, ze to
 @c     sedi s aktualnim stavem
 
 
@@ -1291,9 +1326,9 @@ separate lookup and download for .po files and full Autoheader... cycle.
 I have put together package similar to release. Only ./configure --prefix=...
 and make is required. CVS sources contains version 3.81beta1.
 You can download prepared sources archive from
-  @indicateurl{http://paulandlesley.org/make/make-3.81beta1.tar.bz2}
+  @uref{http://paulandlesley.org/make/make-3.81beta1.tar.bz2}
 Or you can get our local copy from
-  @indicateurl{http://cmp.felk.cvut.cz/~pisa/can/make-3.81beta1.tar.gz}
+  @uref{http://cmp.felk.cvut.cz/~pisa/can/make-3.81beta1.tar.gz}
 
 The archive contains even "make" binary build by me, which should work
 on other Linux distributions as well.  Older version of MAKE (3.79.x
@@ -1305,7 +1340,7 @@ bug.
 The local CTU archive with our CAN components prepared for inclusion
 into OCERA SF CVS could be found in my "can" directory
 
-  @indicateurl{http://cmp.felk.cvut.cz/~pisa/can/ocera-can-031212.tar.gz}
+  @uref{http://cmp.felk.cvut.cz/~pisa/can/ocera-can-031212.tar.gz}
 
 The code should build for user-space with new make on most of Linux distros
 when make is updated.
@@ -1349,7 +1384,34 @@ list for all options if Kconfig is used.
 @node OMK Development, Variable Index, Original README, Top
 @chapter OMK Development
 
+This section is far from complete. Its purpose is to document internals
+of @file{Makefile.rules} as well as other things needed only by people
+who hack OMK itself.
 
+@section Passes
+
+A pass is created by instantiation of @code{omk_pass_template} with
+@var{pass-name} as one of arguments. This defines several targets which
+are described here:
+
+@table @code
+@item @var{pass-name}
+Target used to invoke the individual pass either from command line or
+from inside of @file{Makefile.rules}.
+
+@item @var{pass-name}-submakes
+Invoked recursively from @var{pass-name}. The reason for this is the
+fact that 
+
+@item @var{pass-name}-this-dir
+This target calls make recursively once again with @var{pass-name}-local
+target, which does the real-work. Make's working directory is set to the
+corresponding directory in @file{_build} tree and the -local
+
+@item @var{pass-name}-@var{dirname}-subdir
+This target is responsible for recursive invocation of @command{make} in
+subdirectories specified in @code{@ref{SUBDIRS}} variable.
+@end table
 
 @node Variable Index,  , OMK Development, Top
 @unnumbered Variable Index