1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<project default="compileYoda" name="yoda"> |
3 |
|
4 |
<!-- CONFIGURATION FILE. The properties in this file overwrite the previous properties --> |
5 |
<property file="../KYoda.properties"/> |
6 |
<!-- CONFIGURATION FILE. The properties in this file overwrite the previous properties --> |
7 |
|
8 |
<property environment="env"/> |
9 |
<!-- DEFAULT CONFIGURATION PARAMETERS --> |
10 |
<!-- PAMELA Software(s) root directory --> |
11 |
<property name="pamSoftware" |
12 |
value="${env.HOME}/pamela"/> |
13 |
|
14 |
<!-- CERN's ROOT base directory --> |
15 |
<property name="root" |
16 |
value="/opt/root"/> |
17 |
|
18 |
<!-- LOG4CXX base directory --> |
19 |
<property name="log4cxx" |
20 |
value="/opt/log4cxx"/> |
21 |
|
22 |
<!-- ant-contrib base directory --> |
23 |
<property name="ant-contrib.lib" |
24 |
value="/opt/ant-contrib/lib"/> |
25 |
|
26 |
<!-- DEFAULT CONFIGURATION PARAMETERS --> |
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
<!-- |
33 |
PARAMETRIZED PARAMETERS |
34 |
From here to the end there is NO NEED to modify anything |
35 |
--> |
36 |
|
37 |
<!-- yoda source base directory --> |
38 |
<property name="yoda.src" value="${basedir}"/> |
39 |
|
40 |
<tstamp> |
41 |
<format property="compilationFolder" pattern="hmsS" unit="millisecond"/> |
42 |
</tstamp> |
43 |
|
44 |
<!-- Linux --> |
45 |
<property name="local" value="/usr"/> |
46 |
<property name="local.include" value="${local}/include"/> |
47 |
<property name="local.lib" value="${local}/lib"/> |
48 |
|
49 |
<!-- CERN's ROOT --> |
50 |
<property name="root.include" value="${root}/include"/> |
51 |
<property name="root.lib" value="${root}/lib"/> |
52 |
|
53 |
<!-- log4cxx --> |
54 |
<property name="log4cxx.include" value="${log4cxx}/include"/> |
55 |
<property name="log4cxx.lib" value="${log4cxx}/lib"/> |
56 |
|
57 |
<!-- ant-contrib library --> |
58 |
<path id="classpath"> |
59 |
<pathelement location="${ant-contrib.lib}/cpptasks.jar"/> |
60 |
</path> |
61 |
|
62 |
<!-- |
63 |
Load definition of C/C++ Tasks and Types |
64 |
To allow the compilation and linking of C/C++ code |
65 |
--> |
66 |
<taskdef classpathref="classpath" loaderref="classpath.loaderRef" resource="cpptasks.tasks"/> |
67 |
<typedef classpathref="classpath" loaderref="classpath.loaderRef" resource="cpptasks.types"/> |
68 |
|
69 |
<!-- |
70 |
Load definition of Additional Tasks and Types |
71 |
--> |
72 |
<taskdef resource="net/sf/antcontrib/antcontrib.properties"> |
73 |
<classpath> |
74 |
<pathelement location="${ant-contrib.lib}/ant-contrib.jar"/> |
75 |
</classpath> |
76 |
</taskdef> |
77 |
|
78 |
|
79 |
<target name="initYoda"> |
80 |
<!-- Compiler parameters --> |
81 |
<property name="compilationFolder.lib" value="${compilationFolder}/lib"/> |
82 |
<property name="compilationFolder.include" value="${compilationFolder}/include"/> |
83 |
|
84 |
<!-- Yoda parameters --> |
85 |
<property name="yoda.compilationFolder" value="${env.HOME}/tmp/${compilationFolder}"/> |
86 |
<property name="yoda.obj" value="${yoda.compilationFolder}/obj"/> |
87 |
<property name="yoda.lib" value="${yoda.compilationFolder}/lib"/> |
88 |
<property name="yoda.bin" value="${yoda.compilationFolder}/bin"/> |
89 |
|
90 |
<!-- Deploy parameters --> |
91 |
<property name="deploy" value="${pamSoftware}"/> |
92 |
<property name="deploy.lib" value="${pamSoftware}/lib"/> |
93 |
<property name="deploy.include" value="${pamSoftware}/include"/> |
94 |
<property name="deploy.bin" value="${deploy}/bin"/> |
95 |
</target> |
96 |
|
97 |
<compiler id="yoda-gcc" name="gcc"> |
98 |
<includepath location="${local.include}"/> |
99 |
<includepath location="${log4cxx.include}"/> |
100 |
<includepath location="${root.include}"/> |
101 |
<compilerarg value="-O4"/> |
102 |
<compilerarg value="-g"/> |
103 |
</compiler> |
104 |
|
105 |
<compiler id="yoda-fort" name="g77"> |
106 |
<compilerarg value="-c"/> |
107 |
<compilerarg value="-O0"/> |
108 |
</compiler> |
109 |
|
110 |
<linker id="yoda-link"> |
111 |
<libset dir="${root.lib}" libs="Cint, Core, Tree"/> |
112 |
<libset dir="${log4cxx.lib}" libs="log4cxx"/> |
113 |
<libset libs="stdc++"/> |
114 |
<libset libs="dl"/> |
115 |
<libset libs="g2c" unless="g2c"/> |
116 |
<libset dir="${g2c}" libs="g2c" if="g2c"/> |
117 |
</linker> |
118 |
|
119 |
<linker id="yoda-static"> |
120 |
<libset dir="${root.lib}" libs="Root" type="static"/> |
121 |
<libset dir="${log4cxx.lib}" libs="log4cxx" type="static"/> |
122 |
<libset dir="${local.lib}" libs="gcc_s"/> |
123 |
<!--<libset dir="/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1" libs="gcc, gcc_eh" type="static"/>--> |
124 |
<!--<libset libs="dl"/>--> |
125 |
<libset libs="g2c" unless="g2c" type="static"/> |
126 |
<libset dir="${g2c}" libs="g2c" if="g2c" type="static"/> |
127 |
</linker> |
128 |
|
129 |
|
130 |
<!-- |
131 |
Clean the compilation folder |
132 |
--> |
133 |
<target description="Clean all build products." name="cleanYoda"> |
134 |
<delete dir="${yoda.compilationFolder}"/> |
135 |
<delete file="${yoda.src}/event/EventDict.cpp"/> |
136 |
<delete file="${yoda.src}/event/EventDict.h"/> |
137 |
<delete file="${yoda.src}/techmodel/TechmodelDict.cpp"/> |
138 |
<delete file="${yoda.src}/techmodel/TechmodelDict.h"/> |
139 |
</target> |
140 |
|
141 |
<target depends="cleanYoda, initYoda" description="Create Yoda library" name="compileYodaLib"> |
142 |
<mkdir dir="${yoda.compilationFolder}"/> |
143 |
<mkdir dir="${yoda.obj}"/> |
144 |
<mkdir dir="${yoda.lib}"/> |
145 |
<delete file="${yoda.src}/event/EventDict.cpp"/> |
146 |
<delete file="${yoda.src}/event/EventDict.h"/> |
147 |
<exec dir="${yoda.src}/event" executable="rootcint"> |
148 |
<arg line="-f EventDict.cpp -c -I.. -I../event -I${root.include} -I${log4cxx.include} |
149 |
endrun/CaloEndRun.h endrun/PhysEndRunEvent.h endrun/TBEndRun.h |
150 |
CalibCalPulse1Event.h |
151 |
CalibCalPulse2Event.h |
152 |
CalibTrkBothEvent.h |
153 |
CalibTrk1Event.h |
154 |
CalibTrk2Event.h |
155 |
CalibTofEvent.h |
156 |
CalibS4Event.h |
157 |
CalibCalPedEvent.h |
158 |
Calib1_Ac1Event.h |
159 |
Calib2_Ac1Event.h |
160 |
Calib1_Ac2Event.h |
161 |
Calib2_Ac2Event.h |
162 |
CalibCalEvent.h |
163 |
RunHeaderEvent.h |
164 |
RunTrailerEvent.h |
165 |
CalibHeaderEvent.h |
166 |
CalibTrailerEvent.h |
167 |
InitHeaderEvent.h |
168 |
InitTrailerEvent.h |
169 |
EventTrkEvent.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 |
ForcedFECmdEvent.h |
177 |
Ac1InitEvent.h |
178 |
CalInitEvent.h |
179 |
TrkInitEvent.h |
180 |
TofInitEvent.h |
181 |
TrgInitEvent.h |
182 |
NdInitEvent.h |
183 |
S4InitEvent.h |
184 |
Ac2InitEvent.h |
185 |
CalAlarmEvent.h |
186 |
Ac1AlarmEvent.h |
187 |
TrkAlarmEvent.h |
188 |
TrgAlarmEvent.h |
189 |
TofAlarmEvent.h |
190 |
S4AlarmEvent.h |
191 |
Ac2AlarmEvent.h |
192 |
tsbb/TsbBEvent.h tsbb/TsbBRecord.h |
193 |
tsbt/TsbTEvent.h tsbt/TsbTRecord.h |
194 |
|
195 |
physics/anticounter/AnticounterEvent.h |
196 |
physics/calorimeter/CalorimeterEvent.h |
197 |
physics/neutronDetector/NeutronEvent.h physics/neutronDetector/NeutronRecord.h |
198 |
physics/S4/S4Event.h |
199 |
physics/tof/TofEvent.h |
200 |
physics/tracker/TrackerEvent.h |
201 |
physics/trigger/TriggerEvent.h |
202 |
PamelaRun.h RunInfo.h |
203 |
SubPacket.h PacketType.h SubDetector.h |
204 |
DirectoryStructure.h Algorithm.h AlgorithmInfo.h |
205 |
EventHeader.h PscuHeader.h EventCounter.h |
206 |
PscuEvent.h |
207 |
|
208 |
|
209 |
Ac2AlarmEvent.h Exception.h LinkDef.h"/> |
210 |
</exec> |
211 |
<cc objdir="${yoda.obj}" outfile="${yoda.lib}/yoda" outtype="shared"> |
212 |
<compiler extends="yoda-gcc"> |
213 |
<fileset dir="${yoda.src}/event" includes="**/*.cpp, **/*.c"/> |
214 |
<includepath location="${yoda.src}/event"/> |
215 |
</compiler> |
216 |
<linker extends="yoda-link"/> |
217 |
</cc> |
218 |
</target> |
219 |
|
220 |
<target depends="compileYodaLib" description="Create Yoda flight library" name="compileYoda"> |
221 |
<delete file="${yoda.src}/event/TechmodelDict.cpp"/> |
222 |
<delete file="${yoda.src}/event/TechmodelDict.h"/> |
223 |
<mkdir dir="${yoda.bin}"/> |
224 |
<exec dir="${yoda.src}/techmodel" executable="rootcint"> |
225 |
<arg line="-f TechmodelDict.cpp -c -I.. -I../event -I${root.include} -I${log4cxx.include} TechmodelAlgorithm.h EventReader.h LinkDef.h"/> |
226 |
</exec> |
227 |
<cc objdir="${yoda.obj}" outfile="${yoda.bin}/yoda" outtype="executable"> |
228 |
<compiler extends="yoda-gcc"> |
229 |
<fileset dir="${yoda.src}/techmodel" includes="**/*.cpp, **/*.c"/> |
230 |
<includepath location="${yoda.src}/techmodel"/> |
231 |
<includepath location="${yoda.src}/event"/> |
232 |
<includepath location="${yoda.src}"/> |
233 |
</compiler> |
234 |
<compiler extends="yoda-fort"> |
235 |
<fileset dir="${yoda.src}/techmodel/forroutines/calorimeter" includes="**/*.for"/> |
236 |
<fileset dir="${yoda.src}/techmodel/forroutines/tof" includes="**/*.for"/> |
237 |
<fileset dir="${yoda.src}/techmodel/forroutines/tracker/readraw" includes="**/*.f"/> |
238 |
<fileset dir="${yoda.src}/techmodel/forroutines/trigger" includes="**/*.for"/> |
239 |
</compiler> |
240 |
<linker extends="yoda-link"> |
241 |
<libset dir="${yoda.lib}" libs="yoda" type="shared"/> |
242 |
</linker> |
243 |
</cc> |
244 |
</target> |
245 |
|
246 |
<target depends="compileYoda" description="Deploy the Yoda" name="deployYoda"> |
247 |
<mkdir dir="${deploy}"/> |
248 |
<mkdir dir="${deploy.lib}"/> |
249 |
<mkdir dir="${deploy.include}"/> |
250 |
<mkdir dir="${deploy.include}/yoda"/> |
251 |
<mkdir dir="${deploy.bin}"/> |
252 |
<copy todir="${deploy.include}/yoda"> |
253 |
<fileset dir="${yoda.src}/event" includes="**/*.h" excludes="**/*Dict*"/> |
254 |
</copy> |
255 |
<copy todir="${deploy.lib}"> |
256 |
<fileset dir="${yoda.lib}" includes="*.so"/> |
257 |
</copy> |
258 |
<copy todir="${deploy.bin}"> |
259 |
<fileset dir="${yoda.bin}" includes="*" excludes="*.*"/> |
260 |
</copy> |
261 |
<chmod dir="${deploy.bin}" perm="775" includes="**/*"/> |
262 |
</target> |
263 |
</project> |