]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/doc/Makefile.am
Update master to aliroot
[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 BUILD_DOC
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_GLOBAL
57 MODULES                 += global
58 endif
59
60 # if EN_HLT_ITS
61 # MODULES                       += ITS
62 # endif
63
64 #PDF                    = latex/refman.pdf
65 TAGS                    = $(PACKAGE).tags
66 else 
67 HTML                    =
68 TAGS                    = 
69 endif
70
71 if MONOLITHIC_DOC
72 RUN_MODULES             =
73 MAIN_MODULE             = doxymono.conf readme.c sample_readme.c module_group.c
74 MESSAGE                 = monolithic
75 else
76 RUN_MODULES             = $(TAGS) $(MODULES)
77 MAIN_MODULE             = doxymain.conf
78 MESSAGE                 = main
79 endif
80
81 DISTCLEANFILES          = doxy.log $(PACKAGE).tags
82
83 CLEANFILES              = $(MODULES:%=$(PACKAGE).%.tags) \
84                           $(MODULES:%=%.conf)
85
86 SECTION_FILTER  = Directory File
87 CLASS_FILTER    = structAliHLTRawBuffer \
88                   classAliHLTDataBuffer \
89                   structAliHLTDataSegment \
90                   TObject \
91                   structAliHLTComponentEnvironment
92
93 %.png:%.fig
94         fig2dev -Lpng $< 
95
96 all-local: $(RUN_MODULES) $(HTML) $(PDF)
97
98
99 clean-local: 
100         rm -rf *~ html latex man readme.c sample_readme.c module_group.c $(MAIN_MODULE) $(TAGS)
101
102 readme.c: @top_srcdir@/README
103         @cat $< | sed -e '/^=/s|=||g' -e '/^-/s|-||g'                     | \
104         sed -e '/^+/d'                                                    | \
105         sed -e '/^[0-9]. /s|^\([0-9]*\)\.|@section readme_\1 |'           | \
106         sed -e '/^[0-9]*.[0-9] /s|^\([0-9]*\)\.\([0-9]*\)|@subsection readme_\1_\2 |' | \
107         sed -e '/^  [-()\<a-zA-Z0-9.]/s|\([<>]\)|\\\1|g'                  | \
108         sed -e '/^  [-()\<a-zA-Z0-9.]/s|\(.*\)|<tt>  \1</tt><br>|'        | \
109         sed -e 's|\!\!\!\!|<b>|' -e 's|\!\!\!|</b>|'                      > $@_work
110         @echo "/** @file $@"                                              > $@
111         @echo '    @brief  autogenerated from README.'                   >> $@
112         @echo '    @see  @ref readme                  */'                >> $@
113         @echo '/** '                                                     >> $@
114         @echo '    @page readme README'                                  >> $@
115         @echo '    @section readme_toc TOC'                              >> $@
116         @(for i in `cat $@_work | sed -e /@section/!d | cut -d ' ' -f 2` ; do \
117           echo "- @ref $$i" ; \
118         done )                                                           >> $@
119         @echo                                                            >> $@
120         @cat $@_work                                                     >> $@
121         @echo '*/'                                                       >> $@
122         @rm $@_work
123
124 sample_readme.c: @top_srcdir@/SampleLib/README
125         @echo "/** @file $@"                                              > $@
126         @echo '    @brief  autogenerated from SampleLib/README.'         >> $@
127         @echo '*/'                                                       >> $@
128         @echo '/** '                                                     >> $@
129         @echo '    @page sample_readme Creating a new Library'           >> $@
130         @echo '<pre>'                                                    >> $@
131         @cat $<                                                          | \
132         sed -e 's|<|\&lt;|g' -e 's|>|\&gt;|g'                            >> $@
133         @echo '</pre>'                                                   >> $@
134         @echo '*/'                                                       >> $@
135
136 module_group.c: Makefile
137         @echo "/** @file $@"                                              > $@
138         @echo '    @brief  autogenerated from Makefile.'                 >> $@
139         @echo '*/'                                                       >> $@
140         @echo '/** @defgroup alihlt_modules HLT Detector Modules'        >> $@
141         @echo                                                            >> $@
142         @echo 'Available detector modules:'                              >> $@
143         @$(foreach m, $(MODULES), echo "- @ref alihlt_`echo $(m) | tr '[:upper:]' '[:lower:]' | sed -e 's|lib||'`" >> $@;)
144         @echo '*/'                                                       >> $@
145
146 doxymain.conf: doxygen.conf Makefile
147         @t="$(foreach m, $(MODULES), @PACKAGE@.$(m).tags=$(m))"; \
148         cat $< | sed -e "s|^\(TAGFILES[ ]*=\)|\1 $$t|" -e "/^WARN/s|=[ ]*NO|= YES|"> $@
149
150 doxymono.conf: doxygen.conf Makefile
151         @t="$(foreach m, $(MODULES), @top_srcdir@/$(m))"; \
152         cat $< | sed -e "s|^\(INPUT[ ]*=\)|\1 $$t|" -e "/^WARN/s|=[ ]*NO|= YES|"> $@
153
154 $(TAGS): doxygen.conf mainpage.c readme.c sample_readme.c module_group.c
155         @echo creating main tag file ...
156         $(DOXYGEN) $<  
157
158 $(HTML): $(MAIN_MODULE)
159         @echo creating $(MESSAGE) documentation ...
160         $(DOXYGEN) $<  
161
162 %.conf: doxymodule.conf Makefile
163         @e=`find $(top_srcdir)/$(@:.conf=) -name configure.ac -exec dirname {} \;`; \
164         e=`echo $$e | tr -d '\n'`; \
165         cat $< | sed -e "s|@DOXYMODULE@|$(@:.conf=)|" -e "s|^\(EXCLUDE[ ]*=\)|\1 $$e|" > $@
166
167 html/%/index.html: %.conf
168         @echo creating module ...
169         $(DOXYGEN) $<
170
171 $(MODULES:%=html/%):
172         @mkdir -p $@
173
174 $(MODULES): $(MODULES:%=html/%) $(MODULES:%=html/%/index.html)
175
176 $(MODULES:%=clean-%):
177         rm -r html/$(patsubst clean-%,%,$(@))
178
179 tar-ball:$(HTML)
180         if test -f html/index.html ; then \
181           mv html $(PACKAGE) ;  \
182           tar -czvf ../$(PACKAGE)-$(VERSION)-doc.tar.gz $(PACKAGE) ; \
183           mv $(PACKAGE) html ; fi 
184
185 $(PDF:.pdf=.tex_): $(PDF:.pdf=.tex)
186         cat $< \
187         $(foreach i, $(SECTION_FILTER), \
188          | sed -e '/$i Documentation/,/section/ { /input/d}' \
189          | sed -e '/$i Documentation/ d' \
190         ) \
191         $(foreach i, $(CLASS_FILTER), \
192          | sed -e '/input{$i}/d' \
193         ) \
194         > $@
195         cp -a $@ $<
196
197 $(PDF): latex/Makefile $(PDF:.pdf=.tex_)
198         @(cd latex && $(MAKE))
199 #
200 # EOF
201 #