]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/HOMER/Makefile.am
filter out additional compile defines to fit into rootcints 1024 char limit
[u/mrichter/AliRoot.git] / HLT / BASE / HOMER / Makefile.am
1 # $Id$
2 # Makefile template for the Alice HLT HOMER library
3
4 # This is a ported version of the HOMER library of the HLT
5 # PubSub package HLT-stable-20070905.141318 (rev 2375) on Sep 14 2007
6
7 MODULE                          = HOMER
8
9 ROOT_DEFS                       = USE_ROOT
10 AM_CPPFLAGS                     = -DMODULE=$(MODULE) \
11                                   $(foreach i, $(ROOT_DEFS), -D$(i))
12
13 # library definition
14 # for now we only create the version with ROOT support
15 # the build system is not completely ready yet, the approach with the copied
16 # sources and replacement of USE_ROOT is not yet working. Send an email to
17 # Matthias.Richter@ift.uib.no if you need this feature
18 #lib_LTLIBRARIES                        =  libHOMER.la libAliHLTHOMER.la
19 lib_LTLIBRARIES                 =  libAliHLTHOMER.la
20
21 # version info for the library
22 LIBRARY_VERSION                 = '0:0:0'
23
24 # MODDIR is set by the AliRoot build system and denotes the topdir
25 # of the module, we must set it since the package definition libAliHLTHOMER.pkg
26 # includes another common configuration file
27 MODDIR                          = $(top_srcdir)
28 PKGDEF                          = $(MODDIR)/libAliHLTHOMER.pkg
29 CINTFLAGS                       =
30 include $(top_srcdir)/libAliHLTHOMER.pkg
31
32 NOROOT_SRC                      = $(MODULE_SRCS:.cxx=_noRoot.cxx)
33
34 # ##########################################################
35 # general settings for both libraries
36 #
37 HOMER_DOC                       = HOMERReader.tex
38
39 EXTRA_DIST                      = $(HOMER_DOC)
40
41 # automatic generation of data and time of library build
42 COMPILE_INFO                    =  AliHLTHOMERCompileInfo.cxx
43
44 # library headers
45 pkginclude_HEADERS              = $(MODULE_HDRS) $(MODULE_DHDR)
46
47 # ##########################################################
48 # library version with ROOT support
49 #
50
51 # library sources
52 libAliHLTHOMER_la_SOURCES       = $(MODULE_SRCS)
53
54 # linker flags
55 libAliHLTHOMER_la_LDFLAGS       = -L@ROOTLIBDIR@ \
56                                   @ROOTLIBS@ \
57                                   -version-info $(LIBRARY_VERSION)
58
59 # set the file name for the generated root dictionary
60 DICTCPP                         =  HOMER-DICT.cxx
61 nodist_libAliHLTHOMER_la_SOURCES = $(COMPILE_INFO) \
62                                    $(DICTCPP)
63
64 # ##########################################################
65 # library version w/o ROOT support
66 #
67 # enable this if library w/o ROOT support is build
68
69 # # library sources (generated)
70 # nodist_libHOMER_la_SOURCES    = $(COMPILE_INFO) \
71 #                                  $(NOROOT_SRC)
72
73 # # # linker flags
74 # libHOMER_la_LDFLAGS           = -version-info $(LIBRARY_VERSION)
75
76 # ##########################################################
77
78 CLEANFILES                      =  $(COMPILE_INFO) \
79                                    $(NOROOT_SRC)
80
81 DICTFILES                       =  $(DICTCPP) $(DICTCPP:.cxx=.h)
82 DICTHEADERS                     =  $(CLASS_HDRS)
83
84 CLEANFILES                      += $(DICTFILES)
85
86 # the rootcint buffer for macros is limited to 1024 characters
87 # we have to filter out some of the defines
88 DEFFILTER                       = -DPACKAGE* -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
89
90 # as the first step of the migration of the HOMER library to
91 # AliRoot we leave the class names as they are but change the
92 # file names. Thats why the automatic generation of the ROOT
93 # LinkDef file doesn't work for the moment
94 $(DICTCPP:.cxx=.h): $(DICTCPP)
95         if test $@ ; then : ; else rm -f $< ; $(MAKE) $(MAKEFLAGS) $< ; fi 
96
97 $(DICTCPP): $(DICTHEADERS:%=$(srcdir)/%) $(MODULE_DHDR)
98         if [ -x $(ROOTCINT) ]; then $(ROOTCINT) -f $@ -c $(CPPFLAGS) $(AM_CPPFLAGS) \
99          `for i in $(DEFS);do case $$i in $(foreach def, $(DEFFILTER), $(def) |) -DVERSION*);; *) echo -n " $$i";; esac; done` \
100          $(foreach i, $(DICTINCLUDE), $(i)) \
101          $^ ; fi
102
103 # include $(top_srcdir)/make.dict
104
105 $(NOROOT_SRC): $(MODULE_SRCS)
106         cat $(srcdir)/$(@:_noRoot.cxx=.cxx) $(foreach i, $(ROOT_DEFS), | sed -e "s|$(i)|FALSE|") > $@
107
108 $(COMPILE_INFO): $(libAliHLTUtil_la_SOURCES) $(pkginclude_HEADERS) $(noinst_HEADERS) Makefile.am
109         @echo '//automatically generated compilation info' > $@
110         @echo '//!!! DO NOT EDIT THIS FILE !!!' >> $@
111         @echo '//add changes in Makefile.am' >> $@
112         @echo 'extern "C" void CompileInfo( char*& date, char*& time)' >> $@
113         @echo '{date=__DATE__; time=__TIME__; return;}' >> $@
114
115 all-local: $(HOMER_DOC:.tex=.ps) $(HOMER_DOC:.tex=.pdf)
116
117 clean-local:
118         rm -f $(HOMER_DOC:.tex=.pdf) $(HOMER_DOC:.tex=.ps) $(HOMER_DOC:.tex=.dvi) $(HOMER_DOC:.tex=.aux) $(HOMER_DOC:.tex=.log)
119
120 $(HOMER_DOC:.tex=.pdf): $(HOMER_DOC:.tex=.ps)
121         ps2pdf13 -dEmebedAllFonts=true $^
122
123 $(HOMER_DOC:.tex=.ps): $(HOMER_DOC:.tex=.dvi)
124         dvips -o $@ $^
125
126 $(HOMER_DOC:.tex=.dvi): $(HOMER_DOC)
127         latex $^
128         latex $^