1 |
#***************************************************************************** |
2 |
# |
3 |
# FILE NAME: $Id: Makefile,v 1.12 2009/04/10 15:01:44 pam-fi Exp $ |
4 |
# 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 |
ifneq ($(MAKECMDGOALS),distclean) |
19 |
include $(BASEDIR)/event/Make.def |
20 |
endif |
21 |
#------------------------------------------------------------------------------ |
22 |
|
23 |
CFLAGS += -I $(EVNT_DIR_INC) -I $(ROOT_DIR_INC) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -DPIC |
24 |
|
25 |
ROOTEVENTDICT = EventDict |
26 |
|
27 |
CXXSRCS = NullAlgorithm.cpp \ |
28 |
yodaversion.cpp \ |
29 |
PamelaRun.cpp \ |
30 |
RunInfoYoda.cpp \ |
31 |
$(ROOTEVENTDICT).cpp \ |
32 |
SubPacket.cpp \ |
33 |
PacketType.cpp \ |
34 |
SubDetector.cpp \ |
35 |
Algorithm.cpp \ |
36 |
AlgorithmInfo.cpp \ |
37 |
EventHeader.cpp \ |
38 |
PscuHeader.cpp \ |
39 |
EventCounter.cpp \ |
40 |
PscuEvent.cpp \ |
41 |
CalibCalPulse1Event.cpp \ |
42 |
CalibCalPulse2Event.cpp \ |
43 |
CalibTrkBothEvent.cpp \ |
44 |
CalibTrk1Event.cpp \ |
45 |
CalibTrk2Event.cpp \ |
46 |
CalibTofEvent.cpp \ |
47 |
CalibS4Event.cpp \ |
48 |
CalibCalPedEvent.cpp \ |
49 |
Calib1_Ac1Event.cpp \ |
50 |
Calib1_Ac2Event.cpp \ |
51 |
Calib2_Ac1Event.cpp \ |
52 |
Calib2_Ac2Event.cpp \ |
53 |
CalibCalEvent.cpp \ |
54 |
RunHeaderEvent.cpp \ |
55 |
RunTrailerEvent.cpp \ |
56 |
CalibHeaderEvent.cpp \ |
57 |
CalibTrailerEvent.cpp \ |
58 |
InitHeaderEvent.cpp \ |
59 |
InitTrailerEvent.cpp \ |
60 |
EventTrkEvent.cpp \ |
61 |
ForcedFECmdEvent.cpp \ |
62 |
Ac1InitEvent.cpp \ |
63 |
CalInitEvent.cpp \ |
64 |
TrkInitEvent.cpp \ |
65 |
TofInitEvent.cpp \ |
66 |
TrgInitEvent.cpp \ |
67 |
NdInitEvent.cpp \ |
68 |
S4InitEvent.cpp \ |
69 |
Ac2InitEvent.cpp \ |
70 |
CalAlarmEvent.cpp \ |
71 |
Ac1AlarmEvent.cpp \ |
72 |
TrkAlarmEvent.cpp \ |
73 |
TrgAlarmEvent.cpp \ |
74 |
TofAlarmEvent.cpp \ |
75 |
S4AlarmEvent.cpp \ |
76 |
Ac2AlarmEvent.cpp \ |
77 |
|
78 |
CSRCS= CRC.c \ |
79 |
DirectoryStructure.c |
80 |
|
81 |
|
82 |
#------------------------------------------------------------------------------ |
83 |
|
84 |
TARGETLIB = $(EVNT_A) |
85 |
|
86 |
#------------------------------------------------------------------------------ |
87 |
|
88 |
|
89 |
all: dynamic static |
90 |
|
91 |
|
92 |
dynamic: libyoda.so.0.0.0 |
93 |
ifeq ($(verbose),) |
94 |
@ln -sf libyoda.so.0.0.0 libyoda.so.0 ;\ |
95 |
ln -sf libyoda.so.0.0.0 libyoda.so |
96 |
else |
97 |
ln -sf libyoda.so.0.0.0 libyoda.so.0 ;\ |
98 |
ln -sf libyoda.so.0.0.0 libyoda.so |
99 |
endif |
100 |
|
101 |
static: libyoda.a |
102 |
|
103 |
libyoda.so.0.0.0: $(TARGETLIB) $(EXTLIB) |
104 |
ifeq ($(verbose),) |
105 |
@$(CXX) \ |
106 |
$(PAM_BIT) -o $@ \ |
107 |
-shared \ |
108 |
-Wl,-soname \ |
109 |
-Wl,libyoda.so.0 \ |
110 |
-Wl,--whole-archive \ |
111 |
$^ \ |
112 |
-Wl,--no-whole-archive |
113 |
else |
114 |
$(CXX) \ |
115 |
$(PAM_BIT) -o $@ \ |
116 |
-shared \ |
117 |
-Wl,-soname \ |
118 |
-Wl,libyoda.so.0 \ |
119 |
-Wl,--whole-archive \ |
120 |
$^ \ |
121 |
-Wl,--no-whole-archive |
122 |
endif |
123 |
|
124 |
libyoda.a: $(TARGETLIB) $(EXTLIB) |
125 |
ifeq ($(verbose),) |
126 |
@cd $(OBJDIR) &>/dev/null ; \ |
127 |
for sub_lib in $(TARGETLIB) $(EXTLIB) ; do \ |
128 |
$(AR) -x $$sub_lib ; \ |
129 |
done ;\ |
130 |
$(AR) -scrv libyoda.a *.o &>/dev/null |
131 |
else |
132 |
cd $(OBJDIR) ; \ |
133 |
pwd ;\ |
134 |
for sub_lib in $(TARGETLIB) $(EXTLIB) ; do \ |
135 |
$(AR) -x $$sub_lib ; \ |
136 |
done ;\ |
137 |
$(AR) -scrv libyoda.a *.o |
138 |
endif |
139 |
|
140 |
$(TARGETLIB) : ${OBJS} |
141 |
ifeq ($(verbose),) |
142 |
@$(AR) -scrv $@ $? &>/dev/null |
143 |
else |
144 |
$(AR) -scrv $@ $? |
145 |
endif |
146 |
|
147 |
$(EXTLIB): $(EXTDIR) |
148 |
ifeq ($(verbose),) |
149 |
@for sub_dir in $(EXTDIR) ; do \ |
150 |
(${EGREEN} "Make all in $$sub_dir "; ${RESET});\ |
151 |
$(MAKE) -s -C $$sub_dir libs ; \ |
152 |
done |
153 |
else |
154 |
for sub_dir in $(EXTDIR) ; do \ |
155 |
$(MAKE) -C $$sub_dir libs ; \ |
156 |
done |
157 |
endif |
158 |
|
159 |
SUBPACKET_HEADER_FILES = \ |
160 |
|
161 |
INCLUDES = -I. -I$(ROOT_DIR)/include |
162 |
DICT_HEADER_FILES = \ |
163 |
PamelaRun.h yodaversion.h RunInfoYoda.h \ |
164 |
SubPacket.h PacketType.h SubDetector.h \ |
165 |
DirectoryStructure.h Algorithm.h AlgorithmInfo.h \ |
166 |
EventHeader.h PscuHeader.h EventCounter.h \ |
167 |
endrun/PhysEndRunEvent.h \ |
168 |
endrun/CaloEndRun.h \ |
169 |
endrun/TBEndRun.h \ |
170 |
log/LogEvent.h log/LogRecord.h \ |
171 |
varDump/VarDumpEvent.h varDump/VarDumpRecord.h \ |
172 |
arrDump/ArrDumpEvent.h arrDump/ArrDumpRecord.h \ |
173 |
tabDump/TabDumpEvent.h tabDump/TabDumpRecord.h \ |
174 |
tmtc/TmtcEvent.h tmtc/TmtcRecord.h \ |
175 |
mcmd/McmdEvent.h mcmd/McmdRecord.h \ |
176 |
physics/neutronDetector/NeutronEvent.h \ |
177 |
physics/neutronDetector/NeutronRecord.h \ |
178 |
physics/anticounter/AnticounterEvent.h \ |
179 |
physics/calorimeter/CalorimeterEvent.h \ |
180 |
physics/S4/S4Event.h \ |
181 |
physics/tof/TofEvent.h \ |
182 |
physics/tracker/TrackerEvent.h \ |
183 |
physics/trigger/TriggerEvent.h \ |
184 |
tsbt/TsbTEvent.h tsbt/TsbTRecord.h \ |
185 |
tsbb/TsbBEvent.h tsbb/TsbBRecord.h \ |
186 |
PscuEvent.h \ |
187 |
CalibCalPulse1Event.h \ |
188 |
CalibCalPulse2Event.h \ |
189 |
CalibTrkBothEvent.h \ |
190 |
CalibTrk1Event.h \ |
191 |
CalibTrk2Event.h \ |
192 |
CalibTofEvent.h \ |
193 |
CalibS4Event.h \ |
194 |
CalibCalPedEvent.h \ |
195 |
Calib1_Ac1Event.h \ |
196 |
Calib2_Ac1Event.h \ |
197 |
Calib1_Ac2Event.h \ |
198 |
Calib2_Ac2Event.h \ |
199 |
CalibCalEvent.h \ |
200 |
RunHeaderEvent.h \ |
201 |
RunTrailerEvent.h \ |
202 |
CalibHeaderEvent.h \ |
203 |
CalibTrailerEvent.h \ |
204 |
InitHeaderEvent.h \ |
205 |
InitTrailerEvent.h \ |
206 |
EventTrkEvent.h \ |
207 |
ForcedFECmdEvent.h \ |
208 |
Ac1InitEvent.h \ |
209 |
CalInitEvent.h \ |
210 |
TrkInitEvent.h \ |
211 |
TofInitEvent.h \ |
212 |
TrgInitEvent.h \ |
213 |
NdInitEvent.h \ |
214 |
S4InitEvent.h \ |
215 |
Ac2InitEvent.h \ |
216 |
CalAlarmEvent.h \ |
217 |
Ac1AlarmEvent.h \ |
218 |
TrkAlarmEvent.h \ |
219 |
TrgAlarmEvent.h \ |
220 |
TofAlarmEvent.h \ |
221 |
S4AlarmEvent.h \ |
222 |
Ac2AlarmEvent.h \ |
223 |
CRC.h \ |
224 |
Exception.h \ |
225 |
LinkDef.h |
226 |
|
227 |
$(ROOTEVENTDICT).cpp: ${DICT_HEADER_FILES} |
228 |
ifeq ($(verbose),) |
229 |
@LD_LIBRARY_PATH=$(ROOT_LIB):$(LD_LIBRARY_PATH); $(ROOTCINT) -f $@ -c ${INCLUDES} $^ |
230 |
else |
231 |
echo $(ROOTCINT) -f $@ -c ${INCLUDES} $^ ;\ |
232 |
LD_LIBRARY_PATH=$(ROOT_LIB):$(LD_LIBRARY_PATH); $(ROOTCINT) -f $@ -c ${INCLUDES} $^ |
233 |
endif |
234 |
|
235 |
clean: clean-subdir |
236 |
ifeq ($(verbose),) |
237 |
@rm -f $(TARGETLIB) ${OBJS} $(OBJDIR)/.*.d libyoda* |
238 |
else |
239 |
rm -f $(TARGETLIB) ${OBJS} $(OBJDIR)/.*.d libyoda* |
240 |
endif |
241 |
|
242 |
clean-subdir: $(EXTDIR) |
243 |
ifeq ($(verbose),) |
244 |
@for sub_dir in $(EXTDIR) ; do \ |
245 |
$(MAKE) -s -C $$sub_dir clean ; \ |
246 |
done |
247 |
else |
248 |
for sub_dir in $(EXTDIR) ; do \ |
249 |
$(MAKE) -C $$sub_dir clean ; \ |
250 |
done |
251 |
endif |
252 |
|
253 |
distclean: distclean-sub distclean-subdir clean |
254 |
ifeq ($(verbose),) |
255 |
@rm -f $(ROOTEVENTDICT).{cpp,h} |
256 |
else |
257 |
rm -f $(ROOTEVENTDICT).{cpp,h} |
258 |
endif |
259 |
|
260 |
distclean-subdir: |
261 |
ifeq ($(verbose),) |
262 |
@for sub_dir in $(EXTDIR) ; do \ |
263 |
$(MAKE) -s -C $$sub_dir distclean-sub ; \ |
264 |
done |
265 |
else |
266 |
for sub_dir in $(EXTDIR) ; do \ |
267 |
$(MAKE) -C $$sub_dir distclean-sub ; \ |
268 |
done |
269 |
endif |
270 |
|
271 |
#-include $(DEPEND) |
272 |
|
273 |
|
274 |
#------------------------------------------------------------------------------ |
275 |
include $(BASEDIR)/event/Make.def.post |
276 |
#------------------------------------------------------------------------------ |