| 1 | mocchiut | 1.1 | #***************************************************************************** | 
| 2 |  |  | # | 
| 3 | mocchiut | 1.9 | # FILE NAME:    $Id: Makefile,v 1.8 2009/07/29 16:13:13 mocchiut Exp $ | 
| 4 | mocchiut | 1.1 | # VERSION: | 
| 5 |  |  | # AUTHOR:       Nergal S.r.l. | 
| 6 |  |  | # DATE: | 
| 7 |  |  | # | 
| 8 |  |  | # DESCRIPTION:  base Makefile | 
| 9 |  |  | # | 
| 10 |  |  | # REVISION HISTORY: | 
| 11 |  |  | # | 
| 12 |  |  | # Version     Date      Author         Change Description | 
| 13 |  |  | # | 
| 14 |  |  | #*****************************************************************************/ | 
| 15 |  |  |  | 
| 16 |  |  |  | 
| 17 |  |  | #------------------------------------------------------------------------------ | 
| 18 | pam-fi | 1.6 | ifneq ($(MAKECMDGOALS),distclean) | 
| 19 | mocchiut | 1.1 | include $(BASEDIR)/PamOffLineSW/Make.def | 
| 20 | pam-fi | 1.6 | endif | 
| 21 | mocchiut | 1.9 | ifeq ($(GCC4),1) | 
| 22 |  |  | export LG2C=-lgfortran | 
| 23 |  |  | else | 
| 24 |  |  | export  LG2C=-lg2c | 
| 25 |  |  | endif | 
| 26 | mocchiut | 1.1 | #------------------------------------------------------------------------------ | 
| 27 |  |  |  | 
| 28 |  |  |  | 
| 29 |  |  | #CFLAGS += -I $(PAMOFF_DIR) -I $(TECH_DIR_INC) -I $(ROOT_DIR_INC) -I $(BASEDIR) -I $(EVENT_DIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -fPIC -DPIC | 
| 30 |  |  | CFLAGS += -I $(BASEDIR) -I $(EVENT_DIR) -I $(TECH_DIR) -I $(PAMOFF_DIR) -I $(ROOT_DIR_INC) -fPIC -DPIC | 
| 31 |  |  |  | 
| 32 |  |  | CXXSRCS =       \ | 
| 33 |  |  | PamOffLineSW_Main.cpp   \ | 
| 34 |  |  | StateManager.cpp        \ | 
| 35 |  |  | R0_Init_State.cpp       \ | 
| 36 |  |  | R1_FA_State.cpp         \ | 
| 37 |  |  | R2_FAFE_State.cpp       \ | 
| 38 |  |  | R3_FAFEDE_State.cpp     \ | 
| 39 |  |  | R4_HEADER_State.cpp     \ | 
| 40 |  |  | CRC16.cpp               \ | 
| 41 |  |  | PacketSemanticAnalyzer.cpp \ | 
| 42 |  |  | PacketUser.cpp          \ | 
| 43 |  |  | Logger.cpp | 
| 44 |  |  |  | 
| 45 |  |  |  | 
| 46 |  |  | #------------------------------------------------------------------------------ | 
| 47 |  |  |  | 
| 48 |  |  | TARGETLIB = $(PAMOFF_A) | 
| 49 |  |  |  | 
| 50 |  |  | #------------------------------------------------------------------------------ | 
| 51 |  |  | EXECUTABLES=chewbacca | 
| 52 |  |  | #EXECUTABLES=PamOffLineSW | 
| 53 |  |  |  | 
| 54 |  |  | all: $(EXECUTABLES) | 
| 55 |  |  |  | 
| 56 |  |  | $(EXECUTABLES): $(TARGETLIB) $(EXTLIB) | 
| 57 | mocchiut | 1.7 | ifeq ($(verbose),) | 
| 58 | mocchiut | 1.9 | @$(CXX) $(PAM_BIT) -o  $@    -L ../event -lyoda ${LG2C} `root-config --libs` -lRMySQL $^ | 
| 59 | mocchiut | 1.7 | else | 
| 60 | mocchiut | 1.9 | $(CXX) $(PAM_BIT) -o  $@    -L ../event -lyoda ${LG2C} `root-config --libs` -lRMySQL $^ | 
| 61 | mocchiut | 1.7 | endif | 
| 62 | mocchiut | 1.1 |  | 
| 63 |  |  | $(EXTLIB): $(EXTDIR) | 
| 64 | mocchiut | 1.7 | ifeq ($(verbose),) | 
| 65 |  |  | @for sub_dir in $(EXTDIR) ; do \ | 
| 66 |  |  | (${EGREEN} "Make all in $$sub_dir "; ${RESET});\ | 
| 67 |  |  | $(MAKE) -s -C $$sub_dir libs ; \ | 
| 68 |  |  | done | 
| 69 |  |  | else | 
| 70 | mocchiut | 1.1 | for sub_dir in $(EXTDIR) ; do \ | 
| 71 |  |  | $(MAKE) -C $$sub_dir libs ; \ | 
| 72 |  |  | done | 
| 73 | mocchiut | 1.7 | endif | 
| 74 | mocchiut | 1.1 |  | 
| 75 |  |  | libs: $(TARGETLIB) | 
| 76 |  |  |  | 
| 77 |  |  | $(TARGETLIB) : ${OBJS} | 
| 78 | mocchiut | 1.7 | ifeq ($(verbose),) | 
| 79 |  |  | @$(AR) -scrv $@ ${OBJS} &>/dev/null | 
| 80 |  |  | else | 
| 81 | mocchiut | 1.1 | $(AR) -scrv $@ ${OBJS} | 
| 82 | mocchiut | 1.7 | endif | 
| 83 | mocchiut | 1.1 |  | 
| 84 |  |  | SUBPACKET_HEADER_FILES = \ | 
| 85 |  |  |  | 
| 86 |  |  | INCLUDES = -I. -I$(ROOT_DIR)/include | 
| 87 |  |  | DICT_HEADER_FILES = \ | 
| 88 |  |  | PamelaRun.h             yodaversion.h           RunInfoYoda.h   \ | 
| 89 |  |  | SubPacket.h             PacketType.h            SubDetector.h   \ | 
| 90 |  |  | DirectoryStructure.h    Algorithm.h             AlgorithmInfo.h \ | 
| 91 |  |  | EventHeader.h           PscuHeader.h            EventCounter.h  \ | 
| 92 |  |  | endrun/PhysEndRunEvent.h                                        \ | 
| 93 |  |  | endrun/CaloEndRun.h                                             \ | 
| 94 |  |  | endrun/TBEndRun.h                                               \ | 
| 95 |  |  | log/LogEvent.h          log/LogRecord.h \ | 
| 96 |  |  | varDump/VarDumpEvent.h varDump/VarDumpRecord.h  \ | 
| 97 |  |  | arrDump/ArrDumpEvent.h arrDump/ArrDumpRecord.h  \ | 
| 98 |  |  | tabDump/TabDumpEvent.h tabDump/TabDumpRecord.h  \ | 
| 99 |  |  | tmtc/TmtcEvent.h        tmtc/TmtcRecord.h       \ | 
| 100 |  |  | mcmd/McmdEvent.h        mcmd/McmdRecord.h       \ | 
| 101 |  |  | physics/neutronDetector/NeutronEvent.h          \ | 
| 102 |  |  | physics/neutronDetector/NeutronRecord.h         \ | 
| 103 |  |  | physics/anticounter/AnticounterEvent.h          \ | 
| 104 |  |  | physics/calorimeter/CalorimeterEvent.h          \ | 
| 105 |  |  | physics/S4/S4Event.h                            \ | 
| 106 |  |  | physics/tof/TofEvent.h                          \ | 
| 107 |  |  | physics/tracker/TrackerEvent.h                  \ | 
| 108 |  |  | physics/trigger/TriggerEvent.h                  \ | 
| 109 |  |  | tsbt/TsbTEvent.h        tsbt/TsbTRecord.h       \ | 
| 110 |  |  | tsbb/TsbBEvent.h        tsbb/TsbBRecord.h       \ | 
| 111 |  |  | PscuEvent.h             \ | 
| 112 |  |  | CalibCalPulse1Event.h   \ | 
| 113 |  |  | CalibCalPulse2Event.h   \ | 
| 114 |  |  | CalibTrkBothEvent.h     \ | 
| 115 |  |  | CalibTrk1Event.h        \ | 
| 116 |  |  | CalibTrk2Event.h        \ | 
| 117 |  |  | CalibTofEvent.h         \ | 
| 118 |  |  | CalibS4Event.h          \ | 
| 119 |  |  | CalibCalPedEvent.h      \ | 
| 120 |  |  | Calib1_Ac1Event.h       \ | 
| 121 |  |  | Calib2_Ac1Event.h       \ | 
| 122 |  |  | Calib1_Ac2Event.h       \ | 
| 123 |  |  | Calib2_Ac2Event.h       \ | 
| 124 |  |  | CalibCalEvent.h         \ | 
| 125 |  |  | RunHeaderEvent.h        \ | 
| 126 |  |  | RunTrailerEvent.h       \ | 
| 127 |  |  | CalibHeaderEvent.h      \ | 
| 128 |  |  | CalibTrailerEvent.h     \ | 
| 129 |  |  | InitHeaderEvent.h       \ | 
| 130 |  |  | InitTrailerEvent.h      \ | 
| 131 |  |  | EventTrkEvent.h         \ | 
| 132 |  |  | ForcedFECmdEvent.h      \ | 
| 133 |  |  | Ac1InitEvent.h          \ | 
| 134 |  |  | CalInitEvent.h          \ | 
| 135 |  |  | TrkInitEvent.h          \ | 
| 136 |  |  | TofInitEvent.h          \ | 
| 137 |  |  | TrgInitEvent.h          \ | 
| 138 |  |  | NdInitEvent.h           \ | 
| 139 |  |  | S4InitEvent.h           \ | 
| 140 |  |  | Ac2InitEvent.h          \ | 
| 141 |  |  | CalAlarmEvent.h         \ | 
| 142 |  |  | Ac1AlarmEvent.h         \ | 
| 143 |  |  | TrkAlarmEvent.h         \ | 
| 144 |  |  | TrgAlarmEvent.h         \ | 
| 145 |  |  | TofAlarmEvent.h         \ | 
| 146 |  |  | S4AlarmEvent.h          \ | 
| 147 |  |  | Ac2AlarmEvent.h         \ | 
| 148 |  |  | CRC.h                   \ | 
| 149 |  |  | Exception.h             \ | 
| 150 |  |  | LinkDef.h | 
| 151 |  |  |  | 
| 152 |  |  | $(ROOTEVENTDICT).cpp: ${DICT_HEADER_FILES} | 
| 153 | mocchiut | 1.7 | ifeq ($(verbose),) | 
| 154 |  |  | @echo   "Calling ROOTCINT" ;\ | 
| 155 |  |  | LD_LIBRARY_PATH=$(ROOT_LIB):$(LD_LIBRARY_PATH); $(ROOTCINT) -f $@ -c ${INCLUDES} $^ | 
| 156 |  |  | else | 
| 157 | mocchiut | 1.1 | echo    $(ROOTCINT) -f $@ -c ${INCLUDES} $^ ;\ | 
| 158 | mocchiut | 1.5 | LD_LIBRARY_PATH=$(ROOT_LIB):$(LD_LIBRARY_PATH); $(ROOTCINT) -f $@ -c ${INCLUDES} $^ | 
| 159 | mocchiut | 1.7 | endif | 
| 160 | mocchiut | 1.1 |  | 
| 161 |  |  | clean: clean-subdir | 
| 162 | mocchiut | 1.7 | ifeq ($(verbose),) | 
| 163 |  |  | @rm -f $(TARGETLIB) ${OBJS} $(OBJDIR)/.*.d $(EXECUTABLES) | 
| 164 |  |  | else | 
| 165 | mocchiut | 1.1 | rm -f $(TARGETLIB) ${OBJS} $(OBJDIR)/.*.d $(EXECUTABLES) | 
| 166 | mocchiut | 1.7 | endif | 
| 167 | mocchiut | 1.1 |  | 
| 168 |  |  | clean-subdir: $(EXTDIR) | 
| 169 | mocchiut | 1.7 | ifeq ($(verbose),) | 
| 170 |  |  | @for sub_dir in $(EXTDIR) ; do \ | 
| 171 |  |  | $(MAKE) -s -C $$sub_dir clean ; \ | 
| 172 |  |  | done | 
| 173 |  |  | else | 
| 174 | mocchiut | 1.1 | for sub_dir in $(EXTDIR) ; do \ | 
| 175 |  |  | $(MAKE) -C $$sub_dir clean ; \ | 
| 176 |  |  | done | 
| 177 | mocchiut | 1.7 | endif | 
| 178 | mocchiut | 1.1 |  | 
| 179 |  |  | distclean: distclean-sub distclean-subdir clean | 
| 180 | mocchiut | 1.7 | ifeq ($(verbose),) | 
| 181 |  |  | @rm -f $(ROOTEVENTDICT).{cpp,h} | 
| 182 | mocchiut | 1.8 | @$(MAKE) -s -C techmodel/ clean | 
| 183 | mocchiut | 1.7 | else | 
| 184 | mocchiut | 1.1 | rm -f $(ROOTEVENTDICT).{cpp,h} | 
| 185 | mocchiut | 1.7 | endif | 
| 186 | mocchiut | 1.1 |  | 
| 187 |  |  | distclean-subdir: | 
| 188 | mocchiut | 1.7 | ifeq ($(verbose),) | 
| 189 |  |  | @for sub_dir in $(EXTDIR) ; do \ | 
| 190 |  |  | $(MAKE) -s -C $$sub_dir distclean-sub ; \ | 
| 191 |  |  | done | 
| 192 |  |  | else | 
| 193 | mocchiut | 1.1 | for sub_dir in $(EXTDIR) ; do \ | 
| 194 |  |  | $(MAKE) -C $$sub_dir distclean-sub ; \ | 
| 195 |  |  | done | 
| 196 | mocchiut | 1.7 | endif | 
| 197 | mocchiut | 1.1 |  | 
| 198 | mocchiut | 1.7 | #-include $(DEPEND) | 
| 199 | mocchiut | 1.1 |  | 
| 200 |  |  |  | 
| 201 |  |  | #------------------------------------------------------------------------------ | 
| 202 |  |  | include $(BASEDIR)/PamOffLineSW/Make.def.post | 
| 203 |  |  | #------------------------------------------------------------------------------ |