diff --git a/Makefile.am b/Makefile.am index 29bd989..84fae97 100644 --- a/Makefile.am +++ b/Makefile.am @@ -89,3 +89,19 @@ make-cgtests-cpp: tock cgtests/cgtest00.occ clean-cgtests clean-cgtests: rm -f cgtests/cgtest?? + +#Haddock does allow you to customise the description section of a file, but only with more Haskell comments +#Since I want to use an HTML description (with links to SVG using object tags) I have to perform the following hack +#to use my own custom HTML description. Fixes to make the hack nicer are welcome :-) + +haddock: + @mkdir -p doc + @echo "putmycustomdocumentationhere" > .temp-haddock-file + haddock -o doc --html -p .temp-haddock-file -t Tock $(filter-out frontends/LexOccam.hs frontends/LexRain.hs,$(sources)) + cp docextra/*.svg doc/ + @rm .temp-haddock-file + @grep -B 10000 putmycustomdocumentationhere doc/index.html | sed "s/putmycustomdocumentationhere//" > doc/index.html-2 + @cat docextra/description.html >> doc/index.html-2 + @grep -A 10000 putmycustomdocumentationhere doc/index.html | tail -n +2 >> doc/index.html-2 + @rm doc/index.html + @mv doc/index.html-2 doc/index.html diff --git a/configure.ac b/configure.ac index 2456d95..c184ffa 100644 --- a/configure.ac +++ b/configure.ac @@ -51,7 +51,12 @@ if test "x$HAVE_SVN" = "xfalse"; then AC_MSG_WARN([svn (Subversion) not found; you will not be able to fetch the occam cgtests from the public repository]) fi -#TODO test that they have the right GHC libraries installed (such as hunit, mtl) +AC_CHECK_PROG([HAVE_HADDOCK],[haddock],[true],[false]) +if test "x$HAVE_HADDOCK" = "xfalse"; then + AC_MSG_WARN([haddock not found; you will not be able to generate the documentation from the Tock source code]) +fi + +#Test that they have the right GHC libraries installed (such as hunit, mtl) AC_DEFUN([AC_NEED_HASKELL_LIB], [