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