1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<project basedir="." default="everything" name="deploy"> |
3 |
<property environment="env"/> |
4 |
|
5 |
<!-- |
6 |
CONFIGURATION PARAMETERS |
7 |
Modify here the parameters according to your own system |
8 |
--> |
9 |
<!-- PAMELA Software(s) root directory --> |
10 |
<property name="pamSoftware" |
11 |
value="/opt/yoda"/> |
12 |
<!-- CERN's ROOT base directory --> |
13 |
<property name="root" |
14 |
value="/usr/local/root"/> |
15 |
<!-- LOG4CXX base directory --> |
16 |
<property name="log4cxx" |
17 |
value="/usr/local"/> |
18 |
<!-- ant-contrib base directory --> |
19 |
<property name="ant-contrib.lib" |
20 |
value="/usr/share/ant/lib"/> |
21 |
|
22 |
<property name="scripts.src" |
23 |
value="${basedir}"/> |
24 |
|
25 |
<property name="destdir" |
26 |
value="${basedir}/.."/> |
27 |
|
28 |
|
29 |
<!-- |
30 |
CONFIGURATION PARAMETERS (optional) |
31 |
If your system have custom installation, uncomment and modify |
32 |
the parameters according to your own system |
33 |
--> |
34 |
<!-- fortToC library directory --> |
35 |
<!--<property name="g2c" |
36 |
value="xxx/libf2c/.libs"/>--> |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
<!-- |
45 |
PARAMETRIZED PARAMETERS |
46 |
From here to the end there is NO NEED to modify anything |
47 |
--> |
48 |
<tstamp> |
49 |
<format property="compilationFolder" pattern="hmsS" unit="millisecond"/> |
50 |
</tstamp> |
51 |
|
52 |
<!-- Linux --> |
53 |
<property name="local" value="/usr/local"/> |
54 |
<property name="local.include" value="${local}/include"/> |
55 |
<property name="local.lib" value="${local}/lib"/> |
56 |
|
57 |
<!-- CERN's ROOT --> |
58 |
<property name="root.include" value="${root}/include"/> |
59 |
<property name="root.lib" value="${root}/lib"/> |
60 |
|
61 |
<!-- log4cxx --> |
62 |
<property name="log4cxx.include" value="${log4cxx}/include"/> |
63 |
<property name="log4cxx.lib" value="${log4cxx}/lib"/> |
64 |
|
65 |
<!-- ant-contrib library --> |
66 |
<path id="classpath"> |
67 |
<pathelement location="${ant-contrib.lib}/cpptasks.jar"/> |
68 |
</path> |
69 |
|
70 |
<!-- |
71 |
Load definition of C/C++ Tasks and Types |
72 |
To allow the compilation and linking of C/C++ code |
73 |
--> |
74 |
<taskdef classpathref="classpath" loaderref="classpath.loaderRef" resource="cpptasks.tasks"/> |
75 |
<typedef classpathref="classpath" loaderref="classpath.loaderRef" resource="cpptasks.types"/> |
76 |
|
77 |
<!-- |
78 |
Load definition of Additional Tasks and Types |
79 |
--> |
80 |
<taskdef resource="net/sf/antcontrib/antcontrib.properties"> |
81 |
<classpath> |
82 |
<pathelement location="${ant-contrib.lib}/ant-contrib.jar"/> |
83 |
</classpath> |
84 |
</taskdef> |
85 |
|
86 |
<target name="init"> |
87 |
<!-- Compiler parameters --> |
88 |
<property name="compilationFolder.lib" value="${compilationFolder}/lib"/> |
89 |
<property name="compilationFolder.include" value="${compilationFolder}/include"/> |
90 |
|
91 |
<!-- scripts parameters --> |
92 |
<property name="scripts.compilationFolder" value="${env.HOME}/tmp/${compilationFolder}"/> |
93 |
<property name="scripts.obj" value="${scripts.compilationFolder}/obj"/> |
94 |
<property name="scripts.lib" value="${scripts.compilationFolder}/lib"/> |
95 |
<property name="scripts.bin" value="${scripts.compilationFolder}/bin"/> |
96 |
|
97 |
<!-- Deploy parameters --> |
98 |
<property name="deploy" value="${destdir}"/> |
99 |
<property name="deploy.lib" value="${destdir}/lib"/> |
100 |
<property name="deploy.include" value="${destdir}/include"/> |
101 |
<property name="deploy.bin" value="${deploy}/bin"/> |
102 |
|
103 |
<mkdir dir="${compilationFolder}"/> |
104 |
</target> |
105 |
|
106 |
<compiler id="scripts-gcc" name="gcc"> |
107 |
<includepath location="${local.include}"/> |
108 |
<includepath location="${log4cxx.include}"/> |
109 |
<includepath location="${root.include}"/> |
110 |
<compilerarg value="-O"/> |
111 |
<compilerarg value="-g"/> |
112 |
</compiler> |
113 |
|
114 |
<linker id="scripts-link"> |
115 |
<libset dir="${root.lib}" libs="Cint, Core, Tree, Graf, Hist, Matrix, Gpad"/> |
116 |
<libset dir="${log4cxx.lib}" libs="log4cxx"/> |
117 |
<libset libs="stdc++"/> |
118 |
</linker> |
119 |
|
120 |
|
121 |
<!-- |
122 |
Clean the compilation folder |
123 |
--> |
124 |
<target description="Clean all build products." name="clean"> |
125 |
<delete dir="${scripts.compilationFolder}"/> |
126 |
<delete dir="${compilationFolder}"/> |
127 |
</target> |
128 |
|
129 |
<target description="Create executable" name="compileQLB"> |
130 |
<mkdir dir="${scripts.bin}"/> |
131 |
<mkdir dir="${scripts.obj}"/> |
132 |
<cc objdir="${scripts.obj}" outfile="${scripts.bin}/TrackerQLookBasic" outtype="executable"> |
133 |
<compiler extends="scripts-gcc"> |
134 |
<fileset dir="${scripts.src}" includes="TrackerQLookBasic.cpp"> |
135 |
</fileset> |
136 |
<includepath location="${scripts.src}"/> |
137 |
<includepath location="${pamSoftware}/include"/> |
138 |
<includepath location="${pamSoftware}/include/yoda/event"/> |
139 |
</compiler> |
140 |
<linker extends="scripts-link"> |
141 |
<libset dir="${pamSoftware}/lib" libs="yoda, utils"/> |
142 |
</linker> |
143 |
</cc> |
144 |
|
145 |
</target> |
146 |
|
147 |
<target description="Create executable" name="compileQLE"> |
148 |
<mkdir dir="${scripts.bin}"/> |
149 |
<mkdir dir="${scripts.obj}"/> |
150 |
<cc objdir="${scripts.obj}" outfile="${scripts.bin}/TrackerQLookExpert" outtype="executable"> |
151 |
<compiler extends="scripts-gcc"> |
152 |
<fileset dir="${scripts.src}" includes="TrackerQLookExpert.cpp"> |
153 |
</fileset> |
154 |
<includepath location="${scripts.src}"/> |
155 |
<includepath location="${pamSoftware}/include"/> |
156 |
<includepath location="${pamSoftware}/include/yoda/event"/> |
157 |
</compiler> |
158 |
<linker extends="scripts-link"> |
159 |
<libset dir="${pamSoftware}/lib" libs="yoda, utils"/> |
160 |
</linker> |
161 |
</cc> |
162 |
|
163 |
</target> |
164 |
|
165 |
<target description="Create executable" name="compileCQLB"> |
166 |
<mkdir dir="${scripts.bin}"/> |
167 |
<mkdir dir="${scripts.obj}"/> |
168 |
<cc objdir="${scripts.obj}" outfile="${scripts.bin}/TrkCalibQLookBasic" outtype="executable"> |
169 |
<compiler extends="scripts-gcc"> |
170 |
<fileset dir="${scripts.src}" includes="TrkCalibQLookBasic.cpp"> |
171 |
</fileset> |
172 |
<includepath location="${scripts.src}"/> |
173 |
<includepath location="${pamSoftware}/include"/> |
174 |
<includepath location="${pamSoftware}/include/yoda/event"/> |
175 |
</compiler> |
176 |
<linker extends="scripts-link"> |
177 |
<libset dir="${pamSoftware}/lib" libs="yoda, utils"/> |
178 |
</linker> |
179 |
</cc> |
180 |
|
181 |
</target> |
182 |
|
183 |
<target description="Create executable" name="compileCQLE"> |
184 |
<mkdir dir="${scripts.bin}"/> |
185 |
<mkdir dir="${scripts.obj}"/> |
186 |
<cc objdir="${scripts.obj}" outfile="${scripts.bin}/TrkCalibQLookExpert" outtype="executable"> |
187 |
<compiler extends="scripts-gcc"> |
188 |
<fileset dir="${scripts.src}" includes="TrkCalibQLookExpert.cpp"> |
189 |
</fileset> |
190 |
<includepath location="${scripts.src}"/> |
191 |
<includepath location="${pamSoftware}/include"/> |
192 |
<includepath location="${pamSoftware}/include/yoda/event"/> |
193 |
</compiler> |
194 |
<linker extends="scripts-link"> |
195 |
<libset dir="${pamSoftware}/lib" libs="yoda, utils"/> |
196 |
</linker> |
197 |
</cc> |
198 |
|
199 |
</target> |
200 |
|
201 |
<target depends="compileQLE,compileQLB,compileCQLB,compileCQLE" description="Create executable" name="all"> |
202 |
|
203 |
</target> |
204 |
|
205 |
<target depends="init" description="Deploy the scripts" name="deploy"> |
206 |
<mkdir dir="${deploy}"/> |
207 |
<mkdir dir="${deploy.lib}"/> |
208 |
<mkdir dir="${deploy.bin}"/> |
209 |
<!--<copy todir="${deploy.lib}"> |
210 |
<fileset dir="${profiler.lib}" includes="*.so"/> |
211 |
</copy>--> |
212 |
<copy todir="${deploy.bin}"> |
213 |
<fileset dir="${scripts.bin}" includes="*" excludes="*.*"/> |
214 |
</copy> |
215 |
<chmod dir="${deploy.bin}" perm="775" includes="**/*"/> |
216 |
</target> |
217 |
|
218 |
<target depends="init,all,deploy,clean" description="Make everything" name="everything"> |
219 |
</target> |
220 |
</project> |