AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo
INCLUDES = -I@top_srcdir@ @ROOT_INCLUDES@ @LOG4CXX_INCLUDES@
LDFLAGS = @ROOT_LDFLAGS@ @LOG4CXX_LDFLAGS@
SUBDIRS = log mcmd tmtc physics arrDump tabDump varDump tsbt tsbb endrun

lib_LTLIBRARIES = libyoda.la

libyoda_la_SOURCES =                                \
 NullAlgorithm.cpp                                  \
 Filter.cpp                 Filter.h                \
 PamelaRun.cpp              PamelaRun.h             \
 RunInfo.cpp                RunInfo.h               \
 EventDict.cpp              EventDict.h             \
 SubPacket.cpp              SubPacket.h             \
 PacketType.cpp             PacketType.h            \
 SubDetector.cpp            SubDetector.h           \
 DirectoryStructure.c       DirectoryStructure.h    \
 Algorithm.cpp              Algorithm.h             \
 AlgorithmInfo.cpp          AlgorithmInfo.h         \
 EventHeader.cpp            EventHeader.h           \
 PscuHeader.cpp             PscuHeader.h            \
 EventCounter.cpp           EventCounter.h          \
 PscuEvent.cpp              PscuEvent.h             \
 CalibCalPulse1Event.cpp    CalibCalPulse1Event.h   \
 CalibCalPulse2Event.cpp    CalibCalPulse2Event.h   \
 CalibTrkBothEvent.cpp      CalibTrkBothEvent.h     \
 CalibTrk1Event.cpp         CalibTrk1Event.h        \
 CalibTrk2Event.cpp         CalibTrk2Event.h        \
 CalibTrdEvent.cpp          CalibTrdEvent.h         \
 CalibTofEvent.cpp          CalibTofEvent.h         \
 CalibS4Event.cpp           CalibS4Event.h          \
 CalibCalPedEvent.cpp       CalibCalPedEvent.h      \
 Calib1_Ac1Event.cpp        Calib1_Ac1Event.h       \
 Calib1_Ac2Event.cpp        Calib1_Ac2Event.h       \
 Calib2_Ac1Event.cpp        Calib2_Ac1Event.h       \
 Calib2_Ac2Event.cpp        Calib2_Ac2Event.h       \
 RunHeaderEvent.cpp         RunHeaderEvent.h        \
 RunTrailerEvent.cpp        RunTrailerEvent.h       \
 CalibHeaderEvent.cpp       CalibHeaderEvent.h      \
 CalibTrailerEvent.cpp      CalibTrailerEvent.h     \
 InitHeaderEvent.cpp        InitHeaderEvent.h       \
 InitTrailerEvent.cpp       InitTrailerEvent.h      \
 EventTrkEvent.cpp          EventTrkEvent.h         \
 TestTrkEvent.cpp           TestTrkEvent.h          \
 TestTofEvent.cpp           TestTofEvent.h          \
 ForcedFECmdEvent.cpp       ForcedFECmdEvent.h      \
 Ac1InitEvent.cpp           Ac1InitEvent.h          \
 CalInitEvent.cpp           CalInitEvent.h          \
 TrkInitEvent.cpp           TrkInitEvent.h          \
 TofInitEvent.cpp           TofInitEvent.h          \
 TrgInitEvent.cpp           TrgInitEvent.h          \
 NdInitEvent.cpp            NdInitEvent.h           \
 S4InitEvent.cpp            S4InitEvent.h           \
 Ac2InitEvent.cpp           Ac2InitEvent.h          \
 CalAlarmEvent.cpp          CalAlarmEvent.h         \
 AcAlarmEvent.cpp           AcAlarmEvent.h          \
 TrkAlarmEvent.cpp          TrkAlarmEvent.h         \
 TrgAlarmEvent.cpp          TrgAlarmEvent.h         \
 TofAlarmEvent.cpp          TofAlarmEvent.h         \
 S4AlarmEvent.cpp           S4AlarmEvent.h          \
 CRC.c                      CRC.h                   \
 Exception.h                LinkDef.h

libyoda_la_LIBADD =                         \
 physics/tracker/libtrackerevent.la         \
 physics/S4/libs4event.la                   \
 physics/anticounter/libanticounterevent.la \
 physics/calorimeter/libcalorimeterevent.la \
 physics/neutronDetector/libneutronevent.la \
 physics/tof/libtofevent.la                 \
 physics/trigger/libtriggerevent.la         \
 tmtc/libtmtcevent.la                       \
 mcmd/libmcmdevent.la                       \
 log/liblogevent.la                         \
 arrDump/libarrdumpevent.la                 \
 tabDump/libtabdumpevent.la                 \
 varDump/libvardumpevent.la                 \
 tsbt/libtsbtevent.la                       \
 tsbb/libtsbbevent.la                       \
 endrun/libendrunevent.la                   \
 @LOG4CXX_LIBRARY@/liblog4cxx.la

BUILT_SOURCES = EventDict.cpp EventDict.h

SUBPACKET_HEADER_FILES =                                            \
 PamelaRun.h            RunInfo.h           Filter.h                \
 SubPacket.h            PacketType.h        SubDetector.h           \
 DirectoryStructure.h   Algorithm.h         AlgorithmInfo.h         \
 EventHeader.h          PscuHeader.h        EventCounter.h          \
 PscuEvent.h            CalibCalPulse1Event.h                       \
 CalibCalPulse2Event.h  CalibTrkBothEvent.h CalibTrk1Event.h        \
 CalibTrk2Event.h       CalibTrdEvent.h                             \
 CalibTofEvent.h        CalibS4Event.h      CalibCalPedEvent.h      \
 Calib1_Ac1Event.h      Calib1_Ac2Event.h   Calib2_Ac1Event.h   Calib2_Ac2Event.h   \
 RunHeaderEvent.h       RunTrailerEvent.h                           \
 CalibHeaderEvent.h     CalibTrailerEvent.h InitHeaderEvent.h       \
 InitTrailerEvent.h     EventTrkEvent.h     TestTrkEvent.h          \
 TestTofEvent.h         ForcedFECmdEvent.h  Ac1InitEvent.h          \
 CalInitEvent.h         TrkInitEvent.h      TofInitEvent.h          \
 TrgInitEvent.h         NdInitEvent.h       S4InitEvent.h           \
 Ac2InitEvent.h         CalAlarmEvent.h     AcAlarmEvent.h          \
 TrkAlarmEvent.h        TrgAlarmEvent.h     TofAlarmEvent.h         \
 S4AlarmEvent.h                                                     \
 Exception.h            

yodaincdir = $(includedir)/yoda/event
yodainc_HEADERS= ${SUBPACKET_HEADER_FILES}

DICT_HEADER_FILES = ${SUBPACKET_HEADER_FILES} \
  CRC.h Algorithm.h AlgorithmInfo.h RunInfo.h Filter.h LinkDef.h

EventDict.cpp: ${DICT_HEADER_FILES} 
	rootcint -f $@ -c ${INCLUDES} $^
