]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/doc/Makefile.am
Test for Coverity
[u/mrichter/AliRoot.git] / HLT / doc / Makefile.am
index ee1f6ff30e200a0634f64319eb34bf47eccd94be..80d0e59337d48749770f809b3fc5b96c0db92a15 100644 (file)
 # $Id$
 # Makefile template for the Alice HLT documentation
 #
-#***********************************************************************
-#
-# Alice HLT project
-# Copyright (c) 2005
-#
-# This file is property of and copyright by the Experimental Nuclear 
-# Physics Group, Dep. of Physics and Technology
-# University of Bergen, Norway, 2004
-# This file has been written by Matthias Richter,
-# Matthias.Richter@ift.uib.no
-#
-# Permission to use, copy, modify and distribute this software and its  
-# documentation strictly for non-commercial purposes is hereby granted  
-# without fee, provided that the above copyright notice appears in all  
-# copies and that both the copyright notice and this permission notice  
-# appear in the supporting documentation. The authors make no claims    
-# about the suitability of this software for any purpose. It is         
-# provided "as is" without express or implied warranty.                 
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
-# MA 02111-1307  USA  
-#
-#***********************************************************************/
+#**************************************************************************
+#* This file is property of and copyright by the ALICE HLT Project        * 
+#* ALICE Experiment at CERN, All rights reserved.                         *
+#*                                                                        *
+#* Permission to use, copy, modify and distribute this software and its   *
+#* documentation strictly for non-commercial purposes is hereby granted   *
+#* without fee, provided that the above copyright notice appears in all   *
+#* copies and that both the copyright notice and this permission notice   *
+#* appear in the supporting documentation. The authors make no claims     *
+#* about the suitability of this software for any purpose. It is          *
+#* provided "as is" without express or implied warranty.                  *
+#**************************************************************************
 
-EXTRA_DIST             = mainpage.c
+EXTRA_DIST             = mainpage.c \
+                         pics/HLT-AliRoot-Integration_overview.png \
+                         pics/HLT-AliRoot-Integration_overview.eps \
+                         pics/HLT-AliRoot-Integration_overview.png \
+                         pics/HLT-AliRoot-Integration_overview.eps \
+                         pics/PubSub_WrapperComponent.png
 
-DISTCLEANFILES         = doxy.log $(PACKAGE).tags
-if HAVE_DOXYGEN
-HTML                   = html/index.html 
+if BUILD_DOC
+HTML                   = html/index.html
+MODULES                        = 
+
+if EN_HLT_TPC
+MODULES                        += TPCLib
+endif
+
+if EN_HLT_RCU
+MODULES                        += RCU
+endif
+
+if EN_HLT_PHOS
+MODULES                        += PHOS
+endif
+
+if EN_HLT_TRD
+MODULES                        += TRD
+endif
+
+if EN_HLT_MUON
+MODULES                        += MUON
+endif
+
+if EN_HLT_COMP
+MODULES                        += comp
+endif
+
+if EN_HLT_TRIGGER
+MODULES                        += trigger
+endif
+
+if EN_HLT_GLOBAL
+MODULES                        += global
+endif
+
+# if EN_HLT_ITS
+# MODULES                      += ITS
+# endif
+
+#PDF                   = latex/refman.pdf
 TAGS                   = $(PACKAGE).tags
 else 
 HTML                   =
 TAGS                   = 
 endif
 
+if MONOLITHIC_DOC
+RUN_MODULES            =
+MAIN_MODULE            = doxymono.conf readme.c sample_readme.c module_group.c
+MESSAGE                        = monolithic
+else
+RUN_MODULES            = $(TAGS) $(MODULES)
+MAIN_MODULE            = doxymain.conf
+MESSAGE                        = main
+endif
+
+DISTCLEANFILES         = doxy.log $(PACKAGE).tags
+
+CLEANFILES             = $(MODULES:%=$(PACKAGE).%.tags) \
+                         $(MODULES:%=%.conf)
+
+SECTION_FILTER = Directory File
+CLASS_FILTER   = structAliHLTRawBuffer \
+                 classAliHLTDataBuffer \
+                 structAliHLTDataSegment \
+                 TObject \
+                 structAliHLTComponentEnvironment
+
 %.png:%.fig
        fig2dev -Lpng $< 
 
-all-local:$(HTML)
+all-local: $(RUN_MODULES) $(HTML) $(PDF)
 
 
 clean-local: 
-       rm -rf *~ html latex man
+       rm -rf *~ html latex man readme.c sample_readme.c module_group.c $(MAIN_MODULE) $(TAGS)
+
+readme.c: @top_srcdir@/README
+       @cat $< | sed -e '/^=/s|=||g' -e '/^-/s|-||g'                     | \
+       sed -e '/^+/d'                                                    | \
+       sed -e '/^[0-9]. /s|^\([0-9]*\)\.|@section readme_\1 |'           | \
+       sed -e '/^[0-9]*.[0-9] /s|^\([0-9]*\)\.\([0-9]*\)|@subsection readme_\1_\2 |' | \
+       sed -e '/^  [-()\<a-zA-Z0-9.]/s|\([<>]\)|\\\1|g'                  | \
+       sed -e '/^  [-()\<a-zA-Z0-9.]/s|\(.*\)|<tt>  \1</tt><br>|'        | \
+       sed -e 's|\!\!\!\!|<b>|' -e 's|\!\!\!|</b>|'                      > $@_work
+       @echo "/** @file $@"                                              > $@
+       @echo '    @brief  autogenerated from README.'                   >> $@
+       @echo '    @see  @ref readme                  */'                >> $@
+       @echo '/** '                                                     >> $@
+       @echo '    @page readme README'                                  >> $@
+       @echo '    @section readme_toc TOC'                              >> $@
+       @(for i in `cat $@_work | sed -e /@section/!d | cut -d ' ' -f 2` ; do \
+         echo "- @ref $$i" ; \
+       done )                                                           >> $@
+       @echo                                                            >> $@
+       @cat $@_work                                                     >> $@
+       @echo '*/'                                                       >> $@
+       @rm $@_work
+
+sample_readme.c: @top_srcdir@/SampleLib/README
+       @echo "/** @file $@"                                              > $@
+       @echo '    @brief  autogenerated from SampleLib/README.'         >> $@
+       @echo '*/'                                                       >> $@
+       @echo '/** '                                                     >> $@
+       @echo '    @page sample_readme Creating a new Library'           >> $@
+       @echo '<pre>'                                                    >> $@
+       @cat $<                                                          | \
+       sed -e 's|<|\&lt;|g' -e 's|>|\&gt;|g'                            >> $@
+       @echo '</pre>'                                                   >> $@
+       @echo '*/'                                                       >> $@
 
-html/index.html $(PACKAGE).tags: doxygen.conf mainpage.c       
+module_group.c: Makefile
+       @echo "/** @file $@"                                              > $@
+       @echo '    @brief  autogenerated from Makefile.'                 >> $@
+       @echo '*/'                                                       >> $@
+       @echo '/** @defgroup alihlt_modules HLT Detector Modules'        >> $@
+       @echo                                                            >> $@
+       @echo 'Available detector modules:'                              >> $@
+       @$(foreach m, $(MODULES), echo "- @ref alihlt_`echo $(m) | tr '[:upper:]' '[:lower:]' | sed -e 's|lib||'`" >> $@;)
+       @echo '*/'                                                       >> $@
+
+doxymain.conf: doxygen.conf Makefile
+       @t="$(foreach m, $(MODULES), @PACKAGE@.$(m).tags=$(m))"; \
+       cat $< | sed -e "s|^\(TAGFILES[ ]*=\)|\1 $$t|" -e "/^WARN/s|=[ ]*NO|= YES|"> $@
+
+doxymono.conf: doxygen.conf Makefile
+       @t="$(foreach m, $(MODULES), @top_srcdir@/$(m))"; \
+       cat $< | sed -e "s|^\(INPUT[ ]*=\)|\1 $$t|" -e "/^WARN/s|=[ ]*NO|= YES|"> $@
+
+$(TAGS): doxygen.conf mainpage.c readme.c sample_readme.c module_group.c
+       @echo creating main tag file ...
+       $(DOXYGEN) $<  
+
+$(HTML): $(MAIN_MODULE)
+       @echo creating $(MESSAGE) documentation ...
        $(DOXYGEN) $<  
-       for i in `find @srcdir@ -name '*.png'`; do cp -f $$i html/pic_`basename $$i`; done
+
+%.conf: doxymodule.conf Makefile
+       @e=`find $(top_srcdir)/$(@:.conf=) -name configure.ac -exec dirname {} \;`; \
+       e=`echo $$e | tr -d '\n'`; \
+       cat $< | sed -e "s|@DOXYMODULE@|$(@:.conf=)|" -e "s|^\(EXCLUDE[ ]*=\)|\1 $$e|" > $@
+
+html/%/index.html: %.conf
+       @echo creating module ...
+       $(DOXYGEN) $<
+
+$(MODULES:%=html/%):
+       @mkdir -p $@
+
+$(MODULES): $(MODULES:%=html/%) $(MODULES:%=html/%/index.html)
+
+$(MODULES:%=clean-%):
+       rm -r html/$(patsubst clean-%,%,$(@))
 
 tar-ball:$(HTML)
        if test -f html/index.html ; then \
@@ -57,7 +182,20 @@ tar-ball:$(HTML)
          tar -czvf ../$(PACKAGE)-$(VERSION)-doc.tar.gz $(PACKAGE) ; \
          mv $(PACKAGE) html ; fi 
 
+$(PDF:.pdf=.tex_): $(PDF:.pdf=.tex)
+       cat $< \
+       $(foreach i, $(SECTION_FILTER), \
+        | sed -e '/$i Documentation/,/section/ { /input/d}' \
+        | sed -e '/$i Documentation/ d' \
+       ) \
+       $(foreach i, $(CLASS_FILTER), \
+        | sed -e '/input{$i}/d' \
+       ) \
+       > $@
+       cp -a $@ $<
 
+$(PDF): latex/Makefile $(PDF:.pdf=.tex_)
+       @(cd latex && $(MAKE))
 #
 # EOF
 #