\subsection{envsetup.sh}

\begin{frame}
  \frametitle{Purpose}
  \begin{itemize}
  \item Obviously modifies the current environment, that's why we have
    to \code{source} it
  \item Exports some environment variables that will be used across
    the build system to customize its behaviour
  \item Adds some useful macros as well, making Android easier to compile,
    to deal with this huge source tree, to search for patterns
    across the source code, etc.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Environments variables 1/2}
  \begin{itemize}
  \item \code{ANDROID_EABI_TOOLCHAIN}
    \begin{itemize}
    \item Path to the Android prebuilt toolchain
      (\code{.../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin})
    \end{itemize}
  \item \code{ANDROID_TOOLCHAIN}
    \begin{itemize}
    \item Equals to \code{ANDROID_EABI_TOOLCHAIN}
    \end{itemize}
  \item \code{ANDROID_QTOOLS}
    \begin{itemize}
    \item Tracing tools for qemu
      (\code{.../development/emulator/qtools}). This is weird however,
      since this path doesn't exist at all
    \end{itemize}
  \item \code{ANDROID_BUILD_PATHS}
    \begin{itemize}
    \item Path containing all the folders containing tools for the
      build
      (\code{.../out/host/linux-x86/bin:$ANDROID_TOOLCHAIN:$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN})
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Environments variables 2/2}
  \begin{itemize}
  \item \code{JAVA_HOME}
    \begin{itemize}
    \item Path to the Java environment
      (\code{/usr/lib/jvm/java-6-sun})
    \end{itemize}
  \item \code{ANDROID_JAVA_TOOLCHAIN}
    \begin{itemize}
    \item Path to the Java toolchain (\code{$JAVA_HOME/bin})
    \end{itemize}
  \item \code{ANDROID_PRE_BUILD_PATHS}
    \begin{itemize}
    \item Alias to \code{ANDROID_JAVA_TOOLCHAIN}
    \end{itemize}
  \item \code{ANDROID_PRODUCT_OUT}
    \begin{itemize}
    \item Path to where the generated files will be for this product
      (\code{.../out/target/product/<product_name>})
    \end{itemize}
  \item \code{OUT}
    \begin{itemize}
      \item Alias to \code{ANDROID_PRODUCT_OUT}
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Defined Commands 1/2}
  \begin{description}
  \item[lunch] Used to configure the build system
  \item[croot] Changes the directory to go back to the root of the
    Android source tree
  \item[m] Makes the whole build from any directory in the source tree
  \item[mm] Builds the modules defined in the current directory
  \item[mmm] Builds the modules defined in the given directory
  \end{description}
\end{frame}

\begin{frame}    
  \frametitle{Defined Commands 2/2}
  \begin{description}
  \item[cgrep] Greps the given pattern on all the C/C++/header files
  \item[jgrep] Greps the given pattern on all the Java files
  \item[resgrep] Greps the given pattern on all the resources files 
  \item[godir] Go to the directory containing the given file
  \item[pid] Use ADB to get the PID of the given process
  \item[gdbclient] Use ADB to set up a remote debugging session
  \end{description}
\end{frame}
