added switch for doc to configure.ac; added monilithic doc build; configure.ac and...
[u/mrichter/AliRoot.git] / HLT / doc / Makefile.am
CommitLineData
b521659f 1# $Id$
2# Makefile template for the Alice HLT documentation
3#
ccef02e8 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#**************************************************************************
b521659f 16
85869391 17EXTRA_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
b521659f 23
b521659f 24if HAVE_DOXYGEN
b22e91eb 25HTML = html/index.html
2efb85be 26MODULES =
ccef02e8 27
28if EN_HLT_TPC
29MODULES += TPCLib
30endif
31
32if EN_HLT_RCU
33MODULES += RCU
34endif
35
36if EN_HLT_PHOS
37MODULES += PHOS
38endif
39
40if EN_HLT_TRD
41MODULES += TRD
42endif
43
44if EN_HLT_MUON
45MODULES += MUON
46endif
47
48if EN_HLT_COMP
49MODULES += comp
50endif
51
52if EN_HLT_TRIGGER
53MODULES += trigger
54endif
55
56# if EN_HLT_ITS
57# MODULES += ITS
58# endif
59
b22e91eb 60#PDF = latex/refman.pdf
b521659f 61TAGS = $(PACKAGE).tags
62else
63HTML =
64TAGS =
65endif
66
ae1c1854 67if MONOLITHIC_DOC
68RUN_MODULES =
69MAIN_MODULE = doxymono.conf readme.c sample_readme.c module_group.c
70MESSAGE = monolithic
71else
72RUN_MODULES = $(TAGS) $(MODULES)
73MAIN_MODULE = doxymain.conf
74MESSAGE = main
75endif
76
2efb85be 77DISTCLEANFILES = doxy.log $(PACKAGE).tags
78
79CLEANFILES = $(MODULES:%=$(PACKAGE).%.tags) \
80 $(MODULES:%=%.conf)
81
b22e91eb 82SECTION_FILTER = Directory File
83CLASS_FILTER = structAliHLTRawBuffer \
84 classAliHLTDataBuffer \
85 structAliHLTDataSegment \
86 TObject \
87 structAliHLTComponentEnvironment
88
b521659f 89%.png:%.fig
90 fig2dev -Lpng $<
91
ae1c1854 92all-local: $(RUN_MODULES) $(HTML) $(PDF)
b521659f 93
94
95clean-local:
ae1c1854 96 rm -rf *~ html latex man readme.c sample_readme.c module_group.c $(MAIN_MODULE) $(TAGS)
b521659f 97
9be2600f 98readme.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
ccef02e8 106 @echo "/** @file $@" > $@
9be2600f 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
7b969ef7 120sample_readme.c: @top_srcdir@/SampleLib/README
ccef02e8 121 @echo "/** @file $@" > $@
7b969ef7 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
ccef02e8 132module_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:' >> $@
e99f29ed 139 @$(foreach m, $(MODULES), echo "- @ref alihlt_`echo $(m) | tr '[:upper:]' '[:lower:]' | sed -e 's|lib||'`" >> $@;)
ccef02e8 140 @echo '*/' >> $@
141
142doxymain.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
ae1c1854 146doxymono.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
ccef02e8 150$(TAGS): doxygen.conf mainpage.c readme.c sample_readme.c module_group.c
151 @echo creating main tag file ...
152 $(DOXYGEN) $<
153
ae1c1854 154$(HTML): $(MAIN_MODULE)
155 @echo creating $(MESSAGE) documentation ...
b521659f 156 $(DOXYGEN) $<
b521659f 157
2efb85be 158%.conf: doxymodule.conf Makefile
ccef02e8 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|" > $@
2efb85be 162
163html/%/index.html: %.conf
ccef02e8 164 @echo creating module ...
2efb85be 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
b521659f 175tar-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
b22e91eb 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 $@ $<
b521659f 192
b22e91eb 193$(PDF): latex/Makefile $(PDF:.pdf=.tex_)
194 @(cd latex && $(MAKE))
b521659f 195#
196# EOF
197#