]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/doc/Makefile.am
26a261d66f1b9cd5da4334331f9018b6550b037f
[u/mrichter/AliRoot.git] / HLT / doc / Makefile.am
1 # $Id$
2 # Makefile template for the Alice HLT documentation
3 #
4 #**************************************************************************
5 #* This file is property of and copyright by the ALICE HLT Project        * 
6 #* ALICE Experiment at CERN, All rights reserved.                         *
7 #*                                                                        *
8 #* Permission to use, copy, modify and distribute this software and its   *
9 #* documentation strictly for non-commercial purposes is hereby granted   *
10 #* without fee, provided that the above copyright notice appears in all   *
11 #* copies and that both the copyright notice and this permission notice   *
12 #* appear in the supporting documentation. The authors make no claims     *
13 #* about the suitability of this software for any purpose. It is          *
14 #* provided "as is" without express or implied warranty.                  *
15 #**************************************************************************
16
17 EXTRA_DIST              = mainpage.c \
18                           pics/HLT-AliRoot-Integration_overview.png \
19                           pics/HLT-AliRoot-Integration_overview.eps \
20                           pics/HLT-AliRoot-Integration_overview.png \
21                           pics/HLT-AliRoot-Integration_overview.eps \
22                           pics/PubSub_WrapperComponent.png
23
24 if HAVE_DOXYGEN
25 HTML                    = html/index.html
26 MODULES                 = 
27
28 if EN_HLT_TPC
29 MODULES                 += TPCLib
30 endif
31
32 if EN_HLT_RCU
33 MODULES                 += RCU
34 endif
35
36 if EN_HLT_PHOS
37 MODULES                 += PHOS
38 endif
39
40 if EN_HLT_TRD
41 MODULES                 += TRD
42 endif
43
44 if EN_HLT_MUON
45 MODULES                 += MUON
46 endif
47
48 if EN_HLT_COMP
49 MODULES                 += comp
50 endif
51
52 if EN_HLT_TRIGGER
53 MODULES                 += trigger
54 endif
55
56 # if EN_HLT_ITS
57 # MODULES                       += ITS
58 # endif
59
60 #PDF                    = latex/refman.pdf
61 TAGS                    = $(PACKAGE).tags
62 else 
63 HTML                    =
64 TAGS                    = 
65 endif
66
67 DISTCLEANFILES          = doxy.log $(PACKAGE).tags
68
69 CLEANFILES              = $(MODULES:%=$(PACKAGE).%.tags) \
70                           $(MODULES:%=%.conf)
71
72 SECTION_FILTER  = Directory File
73 CLASS_FILTER    = structAliHLTRawBuffer \
74                   classAliHLTDataBuffer \
75                   structAliHLTDataSegment \
76                   TObject \
77                   structAliHLTComponentEnvironment
78
79 %.png:%.fig
80         fig2dev -Lpng $< 
81
82 all-local: $(TAGS) $(MODULES) $(HTML) $(PDF)
83
84
85 clean-local: 
86         rm -rf *~ html latex man readme.c sample_readme.c module_group.c
87
88 readme.c: @top_srcdir@/README
89         @cat $< | sed -e '/^=/s|=||g' -e '/^-/s|-||g'                     | \
90         sed -e '/^+/d'                                                    | \
91         sed -e '/^[0-9]. /s|^\([0-9]*\)\.|@section readme_\1 |'           | \
92         sed -e '/^[0-9]*.[0-9] /s|^\([0-9]*\)\.\([0-9]*\)|@subsection readme_\1_\2 |' | \
93         sed -e '/^  [-()\<a-zA-Z0-9.]/s|\([<>]\)|\\\1|g'                  | \
94         sed -e '/^  [-()\<a-zA-Z0-9.]/s|\(.*\)|<tt>  \1</tt><br>|'        | \
95         sed -e 's|\!\!\!\!|<b>|' -e 's|\!\!\!|</b>|'                      > $@_work
96         @echo "/** @file $@"                                              > $@
97         @echo '    @brief  autogenerated from README.'                   >> $@
98         @echo '    @see  @ref readme                  */'                >> $@
99         @echo '/** '                                                     >> $@
100         @echo '    @page readme README'                                  >> $@
101         @echo '    @section readme_toc TOC'                              >> $@
102         @(for i in `cat $@_work | sed -e /@section/!d | cut -d ' ' -f 2` ; do \
103           echo "- @ref $$i" ; \
104         done )                                                           >> $@
105         @echo                                                            >> $@
106         @cat $@_work                                                     >> $@
107         @echo '*/'                                                       >> $@
108         @rm $@_work
109
110 sample_readme.c: @top_srcdir@/SampleLib/README
111         @echo "/** @file $@"                                              > $@
112         @echo '    @brief  autogenerated from SampleLib/README.'         >> $@
113         @echo '*/'                                                       >> $@
114         @echo '/** '                                                     >> $@
115         @echo '    @page sample_readme Creating a new Library'           >> $@
116         @echo '<pre>'                                                    >> $@
117         @cat $<                                                          | \
118         sed -e 's|<|\&lt;|g' -e 's|>|\&gt;|g'                            >> $@
119         @echo '</pre>'                                                   >> $@
120         @echo '*/'                                                       >> $@
121
122 module_group.c: Makefile
123         @echo "/** @file $@"                                              > $@
124         @echo '    @brief  autogenerated from Makefile.'                 >> $@
125         @echo '*/'                                                       >> $@
126         @echo '/** @defgroup alihlt_modules HLT Detector Modules'        >> $@
127         @echo                                                            >> $@
128         @echo 'Available detector modules:'                              >> $@
129         $(foreach m, $(MODULES), echo "- @ref alihlt_`echo $(m) | tr '[:upper:]' '[:lower:]' | sed -e 's|lib||'`" >> $@;)
130         @echo '*/'                                                       >> $@
131
132 doxymain.conf: doxygen.conf Makefile
133         @t="$(foreach m, $(MODULES), @PACKAGE@.$(m).tags=$(m))"; \
134         cat $< | sed -e "s|^\(TAGFILES[ ]*=\)|\1 $$t|" -e "/^WARN/s|NO|YES|"> $@
135
136 $(TAGS): doxygen.conf mainpage.c readme.c sample_readme.c module_group.c
137         @echo creating main tag file ...
138         $(DOXYGEN) $<  
139
140 $(HTML): doxymain.conf $(TAGS)
141         @echo creating main documentation ...
142         $(DOXYGEN) $<  
143
144 %.conf: doxymodule.conf Makefile
145         @e=`find $(top_srcdir)/$(@:.conf=) -name configure.ac -exec dirname {} \;`; \
146         e=`echo $$e | tr -d '\n'`; \
147         cat $< | sed -e "s|@DOXYMODULE@|$(@:.conf=)|" -e "s|^\(EXCLUDE[ ]*=\)|\1 $$e|" > $@
148
149 html/%/index.html: %.conf
150         @echo creating module ...
151         $(DOXYGEN) $<
152
153 $(MODULES:%=html/%):
154         @mkdir -p $@
155
156 $(MODULES): $(MODULES:%=html/%) $(MODULES:%=html/%/index.html)
157
158 $(MODULES:%=clean-%):
159         rm -r html/$(patsubst clean-%,%,$(@))
160
161 tar-ball:$(HTML)
162         if test -f html/index.html ; then \
163           mv html $(PACKAGE) ;  \
164           tar -czvf ../$(PACKAGE)-$(VERSION)-doc.tar.gz $(PACKAGE) ; \
165           mv $(PACKAGE) html ; fi 
166
167 $(PDF:.pdf=.tex_): $(PDF:.pdf=.tex)
168         cat $< \
169         $(foreach i, $(SECTION_FILTER), \
170          | sed -e '/$i Documentation/,/section/ { /input/d}' \
171          | sed -e '/$i Documentation/ d' \
172         ) \
173         $(foreach i, $(CLASS_FILTER), \
174          | sed -e '/input{$i}/d' \
175         ) \
176         > $@
177         cp -a $@ $<
178
179 $(PDF): latex/Makefile $(PDF:.pdf=.tex_)
180         @(cd latex && $(MAKE))
181 #
182 # EOF
183 #