1 |
CC = gcc -I/usr/include -DSOLARIS |
2 |
ALTCC=CC -DSOLARIS -g |
3 |
CFLAGS = -g -DCONTRACTS -DUNIX -DATT -D__EXTENSIONS__ -DUSECB63 |
4 |
GCCFLAGS = -c -Wunused $(CFLAGS) |
5 |
STDLIBS = -ldl -lsocket -lnsl |
6 |
RM = rm -f |
7 |
|
8 |
TOP = ../../.. |
9 |
|
10 |
CODEBASEPATH = /tools/codebase63/source |
11 |
|
12 |
SHAREPATH = $(TOP)/share |
13 |
SRCPATH = $(SHAREPATH)/src |
14 |
SRC = $(SRCPATH)/servers |
15 |
EPICSHDIR = $(SHAREPATH)/epicsH |
16 |
TRENDVUSRCDIR = $(SRCPATH)/trendvuCC |
17 |
LIBTISSRCDIR = $(SRCPATH)/libtis |
18 |
TRENDSRCDIR = $(SRCPATH)/newtrend |
19 |
AVMSRCDIR = $(SRCPATH)/avm |
20 |
JAVASRC = $(TOP)/java/projects/hathaway |
21 |
|
22 |
JAVAINCLUDE = \ |
23 |
-I/usr/java/include \ |
24 |
-I/usr/java/include/solaris |
25 |
|
26 |
INCLUDES = \ |
27 |
-I$(SRC) \ |
28 |
-I$(CODEBASEPATH) \ |
29 |
-I$(EPICSHDIR) \ |
30 |
-I$(TRENDSRCDIR) \ |
31 |
-I$(TRENDVUSRCDIR) \ |
32 |
-I$(LIBTISSRCDIR) \ |
33 |
-I. \ |
34 |
-I$(AVMSRCDIR) \ |
35 |
$(JAVAINCLUDE) |
36 |
|
37 |
|
38 |
ALLDEFINES = $(INCLUDES) |
39 |
|
40 |
LIBS = \ |
41 |
../bin/tisMsgLib.a \ |
42 |
../bin/libCom.a \ |
43 |
../bin/libtis.a \ |
44 |
../bin/libUnix.a \ |
45 |
$(CODEBASEPATH)/libcb.a \ |
46 |
../bin/libca.a -lm |
47 |
|
48 |
SRCS = \ |
49 |
$(SRC)/client.c \ |
50 |
$(SRC)/mergeupdates.c \ |
51 |
$(SRC)/OpPrivData.c \ |
52 |
$(SRC)/plcTrendLib.c \ |
53 |
$(SRC)/server.c \ |
54 |
$(SRC)/snapsync.c \ |
55 |
$(SRC)/svcmgr.c \ |
56 |
$(SRC)/svcquery.c \ |
57 |
$(SRC)/trendupdate.c \ |
58 |
$(SRC)/trenddata.c \ |
59 |
$(SRC)/trclient.c \ |
60 |
$(JAVASRC)/trend/client/TrendClient.c |
61 |
|
62 |
all : \ |
63 |
depend \ |
64 |
buildVersion.h \ |
65 |
libServer.a \ |
66 |
client.o \ |
67 |
OpPrivData \ |
68 |
server.o \ |
69 |
svcmgr \ |
70 |
svcquery \ |
71 |
oracleSnapTrenddata \ |
72 |
libTrendClient.so |
73 |
# snapsync \ |
74 |
# trendupdate \ |
75 |
# snapTrenddata \ |
76 |
# trenddata \ |
77 |
|
78 |
#------------------------------------------------------------------------------- |
79 |
# Svcquery - respond to broadcast for server site |
80 |
|
81 |
svcquery : svcquery.o |
82 |
$(RM) svcquery |
83 |
$(CC) $(CFLAGS) -o svcquery svcquery.o $(STDLIBS) ../bin/tisMsgLib.a |
84 |
|
85 |
svcquery.o : $(SRC)/svcquery.c |
86 |
$(RM) svcquery.o |
87 |
$(CC) $(GCCFLAGS) -o svcquery.o $(INCLUDES) $(SRC)/svcquery.c |
88 |
|
89 |
#------------------------------------------------------------------------------- |
90 |
# Svcmgr - execute proper server for the client request |
91 |
|
92 |
svcmgr : svcmgr.o ../bin/tisMsgLib.a |
93 |
$(RM) svcmgr |
94 |
$(CC) $(CFLAGS) -o svcmgr svcmgr.o $(STDLIBS) ../bin/tisMsgLib.a |
95 |
|
96 |
svcmgr.o : $(SRC)/svcmgr.c |
97 |
$(RM) svcmgr.o |
98 |
$(CC) $(GCCFLAGS) -o svcmgr.o $(INCLUDES) $(SRC)/svcmgr.c |
99 |
|
100 |
#------------------------------------------------------------------------------- |
101 |
# Snapsync client - requests data from other hosts to fill in ar_snap file |
102 |
|
103 |
snapsync : snapsync.o client.o \ |
104 |
../bin/xbaseSnapLib.a ../bin/dbLibrary.a $(LIBS) |
105 |
$(RM) snapsync |
106 |
$(CC) $(CFLAGS) -o snapsync snapsync.o client.o \ |
107 |
../newtrend/trendLib.o ../newtrend/utils.o \ |
108 |
../bin/xbaseSnapLib.a ../bin/dbLibrary.a \ |
109 |
$(LIBS) $(STDLIBS) |
110 |
|
111 |
snapsync.o : $(SRC)/snapsync.c $(TRENDSRCDIR)/archiveLib.h \ |
112 |
$(SRC)/server.h $(SRC)/tisservice.h |
113 |
$(RM) snapsync.o |
114 |
$(CC) $(GCCFLAGS) -o snapsync.o $(INCLUDES) $(SRC)/snapsync.c |
115 |
|
116 |
#------------------------------------------------------------------------------- |
117 |
# Trenddata server program components |
118 |
|
119 |
trenddata : trenddata.o server.o ../newtrend/trendLib.o ../newtrend/utils.o \ |
120 |
../trendvuCC/trendutils.o \ |
121 |
../bin/xbaseSnapLib.a ../bin/dbLibrary.a ../bin/tisMsgLib.a $(LIBS) |
122 |
$(RM) trenddata |
123 |
$(CC) $(CFLAGS) -o trenddata trenddata.o server.o \ |
124 |
../newtrend/trendLib.o ../newtrend/utils.o \ |
125 |
../trendvuCC/trendutils.o \ |
126 |
../bin/xbaseSnapLib.a ../bin/dbLibrary.a ../bin/tisMsgLib.a $(LIBS) $(STDLIBS) |
127 |
|
128 |
trenddata.o : $(SRC)/trenddata.c $(TRENDSRCDIR)/archiveLib.h \ |
129 |
$(SRC)/server.h $(SRC)/tisservice.h |
130 |
$(RM) trenddata.o |
131 |
$(CC) $(GCCFLAGS) -o trenddata.o $(INCLUDES) $(SRC)/trenddata.c |
132 |
|
133 |
snapTrenddata : snapTrenddata.o server.o ../newtrend/trendLib.o ../newtrend/utils.o \ |
134 |
../newtrend/snapEditLib.o ../bin/tisMsgLib.a $(LIBS) |
135 |
$(RM) snapTrenddata |
136 |
$(CC) $(CFLAGS) -o snapTrenddata snapTrenddata.o server.o \ |
137 |
../newtrend/trendLib.o ../newtrend/utils.o \ |
138 |
../newtrend/snapEditLib.o $(LIBS) $(STDLIBS) |
139 |
|
140 |
snapTrenddata.o : $(SRC)/trenddata.c $(TRENDSRCDIR)/archiveLib.h \ |
141 |
$(SRC)/server.h $(SRC)/tisservice.h |
142 |
$(RM) snapTrenddata.o |
143 |
$(CC) $(GCCFLAGS) -DSNAPEDIT -o snapTrenddata.o $(INCLUDES) $(SRC)/trenddata.c |
144 |
|
145 |
../newtrend/snapEditLib.o : $(SRCPATH)/newtrend/snapEditLib.c |
146 |
cd ../newtrend ; make snapEditLib.o |
147 |
|
148 |
#------------------------------------------------------------------------------- |
149 |
# oracle Snapsync client - requests data from other hosts to fill in ar_snap file |
150 |
|
151 |
oracleSnapsync : snapsync.o client.o ../bin/tisMsgLib.a oracleTrendfil.o \ |
152 |
../newtrend/trendLib.o ../newtrend/archiveLib.o \ |
153 |
../newtrend/oracleSnapLib.o ../avm/catLib.o ../newtrend/utils.o \ |
154 |
../bin/tisMsgLib.a |
155 |
$(RM) oracleSnapsync |
156 |
$(CC) $(CFLAGS) -o oracleSnapsync snapsync.o client.o ../bin/tisMsgLib.a \ |
157 |
oracleTrendfil.o \ |
158 |
../newtrend/trendLib.o ../newtrend/utils.o \ |
159 |
$(LIBS) $(STDLIBS) ../newtrend/archiveLib.o ../newtrend/oracleSnapLib.o \ |
160 |
../avm/catLib.o \ |
161 |
$(CODEBASEPATH)/libcb.a ../bin/dbLibrary.a -lUnix -lcb \ |
162 |
-L$(ORACLE_HOME)/lib -lsql $(ORACLE_HOME)/lib/osntab.o -lsqlnet \ |
163 |
-lora -lsqlnet -lpls -lora -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 \ |
164 |
-lcore3 -lsocket -lnsl -lm -ldl -laio -lsocket |
165 |
|
166 |
|
167 |
#------------------------------------------------------------------------------- |
168 |
# oracle Trenddata server program components |
169 |
|
170 |
#oracleTrenddata : trenddata.o server.o oracleTrendfil.o ../newtrend/trendLib.o \ |
171 |
# ../newtrend/utils.o ../newtrend/archiveLib.o \ |
172 |
# ../newtrend/oracleSnapLib.o ../avm/catLib.o |
173 |
# rm -f oracleTrenddata |
174 |
# $(CC) $(CFLAGS) -o oracleTrenddata trenddata.o server.o oracleTrendfil.o \ |
175 |
# ../newtrend/trendLib.o ../newtrend/utils.o \ |
176 |
# $(LIBS) $(STDLIBS) ../newtrend/archiveLib.o ../newtrend/oracleSnapLib.o \ |
177 |
# ../avm/catLib.o \ |
178 |
# $(TOP)/unix/sun2.4/bin/libcb.a ../bin/dbLibrary.a -lUnix -lcb \ |
179 |
# -L$(ORACLE_HOME)/lib -lsql $(ORACLE_HOME)/lib/osntab.o -lsqlnet \ |
180 |
# -lora -lsqlnet -lpls -lora -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 \ |
181 |
# -lcore3 -lsocket -lnsl -lm -ldl -laio -lsocket |
182 |
|
183 |
|
184 |
#oracleTrendfil.o : $(TRENDVUSRCDIR)/trendfil.c $(TRENDVUSRCDIR)/trendfil.h |
185 |
# $(CC) $(CFLAGS) -DORACLESNAP -c -o oracleTrendfil.o $(INCLUDES) \ |
186 |
# $(TRENDVUSRCDIR)/trendfil.c |
187 |
|
188 |
#------------------------------------------------------------------------------- |
189 |
# oracle server for java snap edit SnapEdit.jar |
190 |
# |
191 |
oracleSnapTrenddata : snapTrenddata.o server.o ../newtrend/trendLib.o \ |
192 |
../newtrend/utils.o ../newtrend/oracleSnapEditLib.o \ |
193 |
../newtrend/oracleSnapLib.o ../avm/catLib.o |
194 |
rm -f oracleSnapTrenddata |
195 |
$(CC) $(CFLAGS) -o oracleSnapTrenddata snapTrenddata.o server.o \ |
196 |
../newtrend/trendLib.o ../newtrend/utils.o \ |
197 |
../newtrend/oracleSnapEditLib.o ../newtrend/oracleSnapLib.o \ |
198 |
../avm/catLib.o \ |
199 |
../bin/dbLibrary.a $(LIBS) $(STDLIBS) \ |
200 |
-L$(ORACLE_HOME)/lib -lsql $(ORACLE_HOME)/lib/osntab.o -lsqlnet \ |
201 |
-lora -lsqlnet -lpls -lora -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 \ |
202 |
-lcore3 -lsocket -lnsl -lm -ldl -laio -lsocket |
203 |
|
204 |
../newtrend/oracleSnapEditLib.o : $(SRCPATH)/newtrend/snapEditLib.c |
205 |
cd ../newtrend ; make oracleSnapEditLib.o |
206 |
|
207 |
#------------------------------------------------------------------------------- |
208 |
# Trend update and merge components |
209 |
|
210 |
trendupdate : trendupdate.o plcTrendLib.o ../servers/server.o utils.o \ |
211 |
$(CODEBASEPATH)/libcb.a ../bin/tisMsgLib.a ../libtis.a |
212 |
$(RM) trendupdate |
213 |
$(CC) -o trendupdate trendupdate.o plcTrendLib.o \ |
214 |
../servers/server.o utils.o \ |
215 |
$(CODEBASEPATH)/libcb.a ../bin/tisMsgLib.a ../bin/libtis.a\ |
216 |
-lm -lsocket -lnsl |
217 |
|
218 |
trendupdate.o : $(SRC)/trendupdate.c |
219 |
$(RM) trendupdate.o |
220 |
$(CC) $(GCCFLAGS) $(INCLUDES) $(SRC)/trendupdate.c |
221 |
|
222 |
testtrendupdate: testtrendupdate.o plcTrendLib.o ../servers/server.o utils.o |
223 |
$(CODEBASEPATH)/libcb.a ../bin/tisMsgLib.a ../bin/libtis.a |
224 |
$(RM) testtrendupdate |
225 |
$(CC) -o testtrendupdate testtrendupdate.o plcTrendLib.o \ |
226 |
../servers/server.o utils.o |
227 |
$(CODEBASEPATH)/libcb.a ../bin/tisMsgLib.a ../bin/libtis.a \ |
228 |
-lm -lsocket -lnsl |
229 |
|
230 |
testtrendupdate.o : $(SRC)/trendupdate.c |
231 |
$(RM) testtrendupdate.o |
232 |
$(CC) $(GCCFLAGS) $(INCLUDES) -DTEST -o testtrendupdate.o $(SRC)/trendupdate.c |
233 |
|
234 |
plcTrendLib.o : $(SRC)/plcTrendLib.c |
235 |
$(RM) plcTrendLib.o |
236 |
$(CC) $(GCCFLAGS) $(INCLUDES) $(SRC)/plcTrendLib.c |
237 |
|
238 |
mergeupdates: mergeupdates.o utils.o ../servers/client.o \ |
239 |
../bin/tisMsgLib.a $(CODEBASEPATH)/libcb.a ../bin/tisMsgLib.a \ |
240 |
../libtis.a |
241 |
$(CC) -o mergeupdates mergeupdates.o ../servers/client.o utils.o \ |
242 |
../bin/tisMsgLib.a $(CODEBASEPATH)/libcb.a ../bin/tisMsgLib.a \ |
243 |
../bin/libtis.a \ |
244 |
-lm -lsocket -lnsl |
245 |
|
246 |
mergeupdates.o : $(SRC)/mergeupdates.c |
247 |
$(RM) mergeupdates.o |
248 |
$(CC) $(GCCFLAGS) $(INCLUDES) $(SRC)/mergeupdates.c |
249 |
|
250 |
#------------------------------------------------------------------------------- |
251 |
# OpPrivdata server program components |
252 |
|
253 |
OpPrivData : OpPrivData.o server.o $(LIBS) |
254 |
$(RM) OpPrivData |
255 |
$(CC) $(CFLAGS) -o OpPrivData OpPrivData.o server.o \ |
256 |
$(LIBS) $(STDLIBS) |
257 |
|
258 |
OpPrivData.o : $(SRC)/OpPrivData.c $(SRC)/OpPrivData.h \ |
259 |
$(LIBTISSRCDIR)/OperPriv.h $(SRC)/server.h \ |
260 |
$(SRC)/tisservice.h |
261 |
$(RM) OpPrivData.o |
262 |
$(CC) $(GCCFLAGS) -o OpPrivData.o $(INCLUDES) $(SRC)/OpPrivData.c |
263 |
|
264 |
debugOpPrivData : debugOpPrivData.o serverDebug.o $(LIBS) |
265 |
$(RM) debugOpPrivData |
266 |
$(CC) $(CFLAGS) -o debugOpPrivData debugOpPrivData.o serverDebug.o \ |
267 |
$(LIBS) $(STDLIBS) |
268 |
|
269 |
debugOpPrivData.o : $(SRC)/OpPrivData.c $(SRC)/OpPrivData.h \ |
270 |
$(LIBTISSRCDIR)/OperPriv.h $(SRC)/server.h \ |
271 |
$(SRC)/tisservice.h |
272 |
$(RM) debugOpPrivData.o |
273 |
$(CC) $(GCCFLAGS) -DDEBUG -o debugOpPrivData.o $(INCLUDES) $(SRC)/OpPrivData.c |
274 |
#------------------------------------------------------------------------------- |
275 |
# libServer.a |
276 |
libServer.a: client.o server.o |
277 |
$(RM) libServer.a |
278 |
ar crv libServer.a client.o server.o |
279 |
cp -p libServer.a ../bin |
280 |
#------------------------------------------------------------------------------- |
281 |
# libTrendClient.so, jni interface between SnapEdit.jar and oracleSnapTrenddata server |
282 |
# |
283 |
libTrendClient.so : TrendClient.o snaptrclient.o clientjni.o |
284 |
$(RM) libTrendClient.so |
285 |
ld -G -z text -o libTrendClient.so TrendClient.o snaptrclient.o clientjni.o -ldl -lsocket -lnsl -lc -lm -lmp -lC |
286 |
|
287 |
TrendClient.o : $(JAVASRC)/trend/client/TrendClient.c |
288 |
$(RM) TrendClient.o |
289 |
gcc $(JAVAINCLUDE) $(INCLUDES) -c -Wunused -fpic -o TrendClient.o $(JAVASRC)/trend/client/TrendClient.c |
290 |
#------------------------------------------------------------------------------- |
291 |
#------------------------------------------------------------------------------- |
292 |
# Common server program components |
293 |
|
294 |
../avm/catLib.o: $(SRCPATH)/avm/catLib.c |
295 |
cd ../avm ; make catLib.o |
296 |
|
297 |
client.o : $(SRC)/client.c $(SRC)/client.h $(SRC)/tisservice.h |
298 |
$(RM) client.o |
299 |
$(CC) $(GCCFLAGS) -o client.o $(INCLUDES) $(SRC)/client.c |
300 |
|
301 |
clientjni.o : $(SRC)/client.c $(SRC)/client.h $(SRC)/tisservice.h |
302 |
$(RM) clientjni.o |
303 |
# gcc -c -Wunused -fpic -o clientjni.o $(INCLUDES) $(SRC)/client.c |
304 |
$(CC) $(GCCFLAGS) -fpic -o clientjni.o $(INCLUDES) $(SRC)/client.c |
305 |
|
306 |
snaptrclient.o : $(SRC)/trclient.c $(SRC)/trclient.h |
307 |
$(RM) snaptrclient.o |
308 |
# gcc -c -Wunused -fpic -o snaptrclient.o $(INCLUDES) -DSNAPEDIT $(SRC)/trclient.c |
309 |
$(CC) $(GCCFLAGS) -fpic -o snaptrclient.o $(INCLUDES) -DSNAPEDIT $(SRC)/trclient.c |
310 |
|
311 |
clientDebug.o : $(SRC)/client.c $(SRC)/client.h $(SRC)/tisservice.h |
312 |
$(RM) clientDebug.o |
313 |
$(CC) $(GCCFLAGS) -DDEBUG -o clientDebug.o $(INCLUDES) $(SRC)/client.c |
314 |
|
315 |
server.o : $(SRC)/server.c $(SRC)/server.h $(SRC)/tisservice.h |
316 |
$(RM) server.o |
317 |
$(CC) $(GCCFLAGS) -o server.o $(INCLUDES) $(SRC)/server.c |
318 |
|
319 |
serverDebug.o : $(SRC)/server.c $(SRC)/server.h $(SRC)/tisservice.h |
320 |
$(RM) serverDebug.o |
321 |
$(CC) $(GCCFLAGS) -DDEBUG -o serverDebug.o $(INCLUDES) $(SRC)/server.c |
322 |
|
323 |
../trendvuCC/trendutils.o: $(SRCPATH)/trendvuCC/trendutils.c |
324 |
cd ../trendvuCC ; make trendutils.o |
325 |
|
326 |
install : |
327 |
cp -p OpPrivData ../bin |
328 |
cp -p libServer.a ../bin |
329 |
cp -p svcquery ../bin |
330 |
cp -p svcmgr ../bin |
331 |
cp -p oracleSnapTrenddata ../bin |
332 |
cp -p libTrendClient.so ../bin |
333 |
# cp -p trenddata ../bin |
334 |
|
335 |
clean : |
336 |
$(RM) *.o |
337 |
$(RM) svcquery |
338 |
$(RM) svcmgr |
339 |
$(RM) snapsync |
340 |
$(RM) trenddata |
341 |
$(RM) oracleSnapsync |
342 |
$(RM) oracleTrenddata |
343 |
$(RM) trendupdate |
344 |
$(RM) testtrendupdate |
345 |
$(RM) mergeupdates |
346 |
$(RM) OpPrivData |
347 |
$(RM) debugOpPrivData |
348 |
$(RM) libServer.a |
349 |
$(RM) Makefile.depend |
350 |
$(RM) buildVersion.h |
351 |
$(RM) oracleSnapTrenddata |
352 |
$(RM) libTrendClient.so |
353 |
$(RM) snapTrenddata |
354 |
|
355 |
depend: Makefile.depend |
356 |
|
357 |
Makefile.depend: buildVersion.h $(SRCS) Makefile |
358 |
$(RM) Makefile.depend |
359 |
$(CC) -M $(ALLDEFINES) $(SRCS) > Makefile.depend |
360 |
|
361 |
include Makefile.depend |
362 |
|
363 |
buildVersion.h : $(SRCS) Makefile |
364 |
$(RM) buildVersion.h |
365 |
pwd > work0.tmp |
366 |
sed -f ../bin/vrsscript.sed work0.tmp > xxx.txt |
367 |
../bin/getverdefs.sh xxx.txt > buildVersion.h |
368 |
date '+#define BUILDDATE "%m/%d/%Y"' >> buildVersion.h |
369 |
$(RM) xxx.txt work0.tmp |