X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=HLT%2Fmake.dict;h=7ba1f3f809942bd05ebc9a4c1f8e48aae4956c15;hp=f3161b442b7c03fc2d5d67655d2d8b857c0295aa;hb=b3ffafe78d2ebe32c36ff2340ea8849e88831ed0;hpb=fa760045323e6b3a2e9f09e20dcbf3919aa2cf41 diff --git a/HLT/make.dict b/HLT/make.dict index f3161b442b7..7ba1f3f8099 100644 --- a/HLT/make.dict +++ b/HLT/make.dict @@ -1,29 +1,54 @@ # Makefile template for ROOT dictionary generation # +# This is a common include file which handles generation of the ROOT dictionary +# files. It creates: +# - the dict.cxx (variable DICTCPP) +# - the dict.h (variable DICTCPP:.cxx=.h) +# - optional: the linkdef.h (variable MODULE postfixed by -LinkDef.h) +# +# If the MODULE_DHDR variable is set in the package definition lib.pkg +# to a custom LinkDef file, the automatic generation of the LinkDef header is +# disabled. Instead, the specified one is used. +# # usage: # 1. set variable CLASS_HDRS to the class header files # 2. set DICTCPP variable to dictionary c++ file name -# e.g. -DICT.cxx +# e.g. -DICT.cxx ( replaced by your module name) # 3. add the source file name to the list of generated sources # nodist_lib_la_SOURCES = $(DICTCPP) -# 4. include this file from your Makefile(.am) +# 4. add additional include files which are necessary for the compilation +# of the dictionary files and which are not part of the CLASS_HDRS to +# the DICTINCLUDE variable +# 5. include this file from your Makefile(.am) # e.g. include ../make.dict # # Author: Matthias.Richter@ift.uib.no # -DICTDEF = $(MODULE)-LinkDef.h -DICTFILES = $(DICTCPP) $(DICTCPP:.cxx=.h) $(DICTDEF) +DICTAUTODEF = $(MODULE)-LinkDef.h +DICTDEF = $(shell if test "x$(MODULE_DHDR)" = "x"; then echo $(DICTAUTODEF); else echo $(MODULE_DHDR); fi) +DICTFILES = $(DICTCPP) $(DICTCPP:.cxx=.h) $(DICTAUTODEF) DICTHEADERS = $(CLASS_HDRS) CLEANFILES += $(DICTFILES) +EXTRA_DIST += $(MODULE_DHDR) + +# the rootcint buffer for macros is limited to 1024 characters +# we have to filter out some of the defines +# The asterisk at the end is important even for defines which +# are not wildcards. But otherwise the case does not pick them. +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* -DHAVE_NOT_ALIMAGF30848* -DHAVE_NOT_ALTRORAWSTREAMV3* -DHAVE_NOT_ALIRUNLOADER30859* -DHAVE_NOT_ESD_COPY* -DHAVE_NOT_MUON_DIGITMAKER_GETRAWSTREAM* -DHAVE_NOT_ALITPCCALIBPULSER* -DHAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER* -DHAVE_NOT_TPCOFFLINE_REC* $(DICTCPP:.cxx=.h): $(DICTCPP) if test $@ ; then : ; else rm -f $< ; $(MAKE) $(MAKEFLAGS) $< ; fi $(DICTCPP): $(DICTHEADERS:%=$(srcdir)/%) $(DICTDEF) - if [ -x $(ROOTCINT) ]; then $(ROOTCINT) -f $@ -c $(CPPFLAGS) $(AM_CPPFLAGS) $(DEFS) $^ ; fi -$(DICTDEF): Makefile.am + if [ -x $(ROOTCINT) ]; then $(ROOTCINT) -f $@ -c $(CPPFLAGS) $(AM_CPPFLAGS) \ + `for i in $(DEFS);do case $$i in $(foreach def, $(DEFFILTER), $(def) |) -DVERSION*);; *) echo -n " $$i";; esac; done` \ + $(foreach i, $(DICTINCLUDE), $(i)) \ + $^ ; fi + +$(DICTAUTODEF): Makefile.am $(PKGDEF) @echo '//automatically generated ROOT DICT definition' > $@ @echo '//!!! DO NOT EDIT THIS FILE !!!' >> $@ @echo '//add further class definitions to the CLASS_HDRS variable in Makefile.am' >> $@ @@ -32,5 +57,7 @@ $(DICTDEF): Makefile.am @echo '#pragma link off all classes;' >> $@ @echo '#pragma link off all functions;' >> $@ @$(foreach i, $(DICTHEADERS:.h=), \ - echo "#pragma link C++ class $(i);" >> $@ ;) + attribute='+' ;\ + cat $(srcdir)/$(i).cxx | grep -e $(i)::Streamer | grep TBuffer > /dev/null && attribute='-' ;\ + echo "#pragma link C++ class "`echo $(i)| sed -e 's|.*/||'`"$$attribute;" >> $@ ;) @echo '#endif' >> $@