\section{Configuration File}

\subsection{rebar.config}

mad uses {\bf rebar.config} filename to load mad configuration.
Despite mad is no fully rebar compatible (e.g. it can't uses
rebar plugins, ports compilation is rather different, etc),
it uses its name to achive certail level of compatibility.

\subsection{deps}

deps is the core option of mad. It says which OTP applications
shold be used and where they could be found. Yoy may also specify
versions. Here is simpliest example:

\vspace{1\baselineskip}
\begin{lstlisting}[caption=deps Option]
    {deps, [
             {kvs,   ".*", {git,"git://github.com/synrc/kvs"}},
             {forms, ".*", {git,"git://github.com/spawnproc/forms"}}
    ]}.
\end{lstlisting}
\vspace{1\baselineskip}

\subsection{deps\_dir}

To specify where deps should be stored after fetching inside
your application you use deps\_dir option:

\vspace{1\baselineskip}
\begin{lstlisting}[caption=deps\_dir Option]
    {deps_dir, "deps"}.
\end{lstlisting}
\vspace{1\baselineskip}

\subsection{sub\_dirs}

If your application consist of more than one src
directory, you may specify all of the sub-applications.
Each sub-application should be valid OTP application
with its own rebar.config configuration file.

\vspace{1\baselineskip}
\begin{lstlisting}
    {sub_dirs,["apps"]}.
\end{lstlisting}
\vspace{1\baselineskip}

\subsection{lib\_dirs}

To use include directive across your sub-applications
you should specify the {\bf lib\_dirs} directories
which will be settled as include directories during compilation.

\vspace{1\baselineskip}
\begin{lstlisting}
    {lib_dirs,["apps"]}.
\end{lstlisting}
\vspace{1\baselineskip}

E.g. you have my\_app and my\_server applications
inside apps directory and you including HRL file
from my\_server application from ap\_app application:

\vspace{1\baselineskip}
\begin{lstlisting}
    -module(my_app).
    -include_lib("my_server/include/my_server.hrl").
\end{lstlisting}
\vspace{1\baselineskip}
