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