
all:: includes ps pdf html

ps::
	(vtex FYPFinalReport)

pdf::
	(makepdf FYPFinalReport)

html::
	(makehtml FYPFinalReport)

includes:: includes-api includes-src

includes-api:: docu libcomm-api interface-api

includes-src:: libcommH libcommC \
	interfaceC \
	guicommonH guicommonC guirobotC guiserverC \
	test001socketsC test002integerC test003blockC \
	test004md5C tes005realtimeC test001interfaceC

docu::
	(cd ../src; make docu)

libcomm-api::
	(man ../src.doc/man/man3/libcomm.c.3 | man2latex/man2latex > libcomm.c.3.tex)

interface-api::
	(man ../src.doc/man/man3/interface.c.3 | man2latex/man2latex > interface.c.3.tex)

libcommH::
	(echo {\\scriptsize \\begin{lstlisting} > libcomm.h.tex)
	(nl -ba ../src/lib/libcomm.h >> libcomm.h.tex)
	(echo \\end{lstlisting}} >> libcomm.h.tex)

libcommC::
	(echo {\\scriptsize \\begin{lstlisting} > libcomm.c.tex)
	(nl -ba ../src/lib/libcomm.c >> libcomm.c.tex)
	(echo \\end{lstlisting}} >> libcomm.c.tex)


interfaceC::
	(echo {\\scriptsize \\begin{lstlisting} > interface.c.tex)
	(nl -ba ../src/example/interface.c >> interface.c.tex)
	(echo \\end{lstlisting}} >> interface.c.tex)

guicommonH::
	(echo {\\scriptsize \\begin{lstlisting} > guicommon.h.tex)
	(nl -ba ../src/example/guicommon.h >> guicommon.h.tex)
	(echo \\end{lstlisting}} >> guicommon.h.tex)

guicommonC::
	(echo {\\scriptsize \\begin{lstlisting} > guicommon.c.tex)
	(nl -ba ../src/example/guicommon.c >> guicommon.c.tex)
	(echo \\end{lstlisting}} >> guicommon.c.tex)

guirobotC::
	(echo {\\scriptsize \\begin{lstlisting} > guirobot.c.tex)
	(nl -ba ../src/example/guirobot.c >> guirobot.c.tex)
	(echo \\end{lstlisting}} >> guirobot.c.tex)

guiserverC::
	(echo {\\scriptsize \\begin{lstlisting} > guiserver.c.tex)
	(nl -ba ../src/example/guiserver.c >> guiserver.c.tex)
	(echo \\end{lstlisting}} >> guiserver.c.tex)


test001socketsC::
	(echo {\\scriptsize \\begin{lstlisting} > test001sockets.c.tex)
	(nl -ba ../src/tests/test001sockets.c >> test001sockets.c.tex)
	(echo \\end{lstlisting}} >> test001sockets.c.tex)

test002integerC::
	(echo {\\scriptsize \\begin{lstlisting} > test002integer.c.tex)
	(nl -ba ../src/tests/test002integer.c >> test002integer.c.tex)
	(echo \\end{lstlisting}} >> test002integer.c.tex)

test003blockC::
	(echo {\\scriptsize \\begin{lstlisting} > test003block.c.tex)
	(nl -ba ../src/tests/test003block.c >> test003block.c.tex)
	(echo \\end{lstlisting}} >> test003block.c.tex)

test004md5C::
	(echo {\\scriptsize \\begin{lstlisting} > test004md5.c.tex)
	(nl -ba ../src/tests/test004md5.c >> test004md5.c.tex)
	(echo \\end{lstlisting}} >> test004md5.c.tex)

tes005realtimeC::
	(echo {\\scriptsize \\begin{lstlisting} > tes005realtime.c.tex)
	(nl -ba ../src/tests/tes005realtime.c >> tes005realtime.c.tex)
	(echo \\end{lstlisting}} >> tes005realtime.c.tex)

test001interfaceC::
	(echo {\\scriptsize \\begin{lstlisting} > test001interface.c.tex)
	(nl -ba ../src/example/test001interface.c >> test001interface.c.tex)
	(echo \\end{lstlisting}} >> test001interface.c.tex)
