% OpenCP Module Player
%
% Documentation LaTeX source
%
% revision history: (please note changes here)
% -doj990413  Dirk Jagdmann  <doj@cubic.org>
%   -initial release
% -doj990421  Dirk Jagdmann  <doj@cubic.org>
%   -added subsection about problems with wmake
% -doj20020204 Dirk Jagdmann <doj@cubic.org>
%   -added links to dx sdk and openwatcom

\chapter{Compiling \cp}

To compile OCP you need the following software:

\begin{itemize}

\item Watcom C++ 11c\footnote{Sometime in the future the Watcom
  compiler will become open source and be available for free, but
  currently you have to get the commercial version.}  please apply the
  update from \htmladdnormallink{http://www.openwatcom.org}{http://www.openwatcom.org}
  
\item TASM 

\item \htmladdnormallink{DirectX 8 SDK}{http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/494/msdncompositedoc.xml}
\end{itemize}

Remember to set your WATCOM, INCLUDE and PATH environment variables.
You should unpack the Microsoft stuff and copy the header and libs
into your Watcom directories. You don't have to install the complete
DirectX SDK via the provided install program.

Now you should be able to build everything with a simple "wmake".
"wmake install" will copy all the files built into a bin\ directory
located in the source tree.

The \texttt{wmake} utility accepts some parameters. Only one of the
following may be supplied at a time.
\begin{dojlist}
\item[all] compile \cp (this is like supplying no switch)
\item[install] compile the program and the copy program into the \texttt{\symbol{92}bin}
directory.
\item[clean] delete all compiled \texttt{.obj} files
\item[distclean] delete all files that have been ''made'' once. This is like
unpacking the source distribution again.
\end{dojlist}

\section{Compiler switches}
These switches are enabled with the \texttt{/d} switch on the command
line.  You could also edit the \texttt{cflags} variable in the
\texttt{makefile}.

\begin{dojlist}
\item[RASTER] enable a fake raster bar every time the mixer starts. You can
then see how much cpu time the mixing routines use.
\end{dojlist}

\section{wmake}
If you experience problems with \texttt{wmake} please make sure you
have enough dos memory available. You should supply at least
580KB. You can simply check how much memory is available by using
\texttt{mem /c /p}. This command will tell you the memory usage of
each single loaded driver and programm. If you find out that there is
not enough dos memory available you can free memory by unloading some
cd-rom drivers, mouse drivers or smartdrv etc.
