DEVEL15-pthreaded-ubik-20080402
[openafs.git] / src / tptserver / Makefile.in
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 srcdir=@srcdir@/../ptserver
9 include @TOP_OBJDIR@/src/config/Makefile.config
10
11
12 CCRULE=${MT_CC} ${CFLAGS} ${MT_CFLAGS} -c $<
13
14 RX=../rx
15 UTIL=../util
16
17 RXOBJS= rx_pthread.o rxkad_errs.o
18
19 UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
20      volparse.o flipbase64.o softsig.o hostparse.o snprintf.o pthread_glock.o
21
22 INCLS=${TOP_INCDIR}/ubik.h \
23         ${TOP_INCDIR}/lock.h  \
24         ${TOP_INCDIR}/lwp.h \
25         ${TOP_INCDIR}/rx/rx.h \
26         ${TOP_INCDIR}/rx/xdr.h \
27         ${TOP_INCDIR}/afs/keys.h \
28         ${TOP_INCDIR}/afs/cellconfig.h \
29         ${srcdir}/ptserver.h \
30         ${srcdir}/ptclient.h \
31         ${srcdir}/ptuser.h \
32         ptint.h \
33         pterror.h \
34         ${srcdir}/map.h \
35         ${srcdir}/ptprototypes.h
36
37 LINCLS=${TOP_INCDIR}/ubik.h \
38         ${TOP_INCDIR}/lock.h \
39         ${TOP_INCDIR}/rx/rx.h \
40         ${TOP_INCDIR}/rx/xdr.h  \
41         ${TOP_INCDIR}/rx/rxkad.h \
42         ${TOP_INCDIR}/afs/auth.h \
43         ${TOP_INCDIR}/afs/cellconfig.h \
44         ${srcdir}/ptclient.h \
45         ${srcdir}/ptuser.h \
46         ptint.h \
47         pterror.h
48
49 LIBS=${RXOBJS} ${UTILOBJS}\
50         ${TOP_LIBDIR}/libubik_pthread.a \
51         ${TOP_LIBDIR}/libafsauthent.a \
52         ${TOP_LIBDIR}/librxstat.a \
53         ${TOP_LIBDIR}/libafsrpc.a \
54         ${TOP_LIBDIR}/libcmd.a \
55         ${TOP_LIBDIR}/libcom_err.a \
56         ${TOP_LIBDIR}/libsys.a \
57         ${TOP_LIBDIR}/libafsutil.a \
58         ${LDFLAGS} ${MT_LIBS}
59
60
61 all: ptserver pts pt_util db_verify ${TOP_LIBDIR}/libprot.a \
62         depinstall readgroup readpwd testpt
63
64 depinstall: \
65         ptint.cs.c ptint.xdr.c \
66         ${TOP_INCDIR}/afs/prclient.h \
67         ${TOP_INCDIR}/afs/prerror.h \
68         ${TOP_INCDIR}/afs/print.h \
69         ${TOP_INCDIR}/afs/prserver.h \
70         ${TOP_INCDIR}/afs/ptclient.h \
71         ${TOP_INCDIR}/afs/ptuser.h \
72         ${TOP_INCDIR}/afs/pterror.h \
73         ${TOP_INCDIR}/afs/ptint.h \
74         ${TOP_INCDIR}/afs/ptserver.h
75
76 #
77 # Build targets
78 #
79
80 rx_pthread.o: ${RX}/rx_pthread.c
81         ${CCRULE}
82
83 rxkad_errs.o: ../rxkad/rxkad_errs.c
84         ${CCRULE}
85
86 #
87 # get the pthreaded util stuff compiled here.  we do this instead of
88 # using the non-pthreaded libutil.a.  There probably should be a
89 # pthreaded version of this library, as we are doing with ubik itself, but...
90 #
91
92 assert.o: ${UTIL}/assert.c
93         ${CCRULE}
94
95 uuid.o: ${UTIL}/uuid.c
96         ${CCRULE}
97
98 serverLog.o: ${UTIL}/serverLog.c
99         ${CCRULE}
100
101 fileutil.o: ${UTIL}/fileutil.c
102         ${CCRULE}
103
104 volparse.o: ${UTIL}/volparse.c
105         ${CCRULE}
106
107 flipbase64.o: ${UTIL}/flipbase64.c
108         ${CCRULE}
109
110 netutils.o: ${UTIL}/netutils.c
111         ${CCRULE}
112
113 dirpath.o: ${UTIL}/dirpath.c
114         ${CCRULE}
115
116 softsig.o: ${UTIL}/softsig.c
117         ${CCRULE}
118
119 hostparse.o: ${UTIL}/hostparse.c
120         ${CCRULE}
121
122 snprintf.o: ${UTIL}/snprintf.c
123         ${CCRULE}
124
125 pthread_glock.o: ${UTIL}/pthread_glock.c
126         ${CCRULE}
127
128
129 #ptserver.o: ${srcdir}/ptserver.c ${INCLS} AFS_component_version_number.c
130 #       ${CCRULE}
131
132 ptserver.o: ${srcdir}/ptserver.c
133         ${CCRULE}
134
135 ptutils.o: ${srcdir}/ptutils.c
136         ${CCRULE}
137
138 ptprocs.o: ${srcdir}/ptprocs.c
139         ${CCRULE}
140
141 utils.o: ${srcdir}/utils.c
142         ${CCRULE}
143
144 map.o: ${srcdir}/map.c
145         ${CCRULE}
146
147 ptint.ss.o: ptint.ss.c
148         ${CCRULE}
149
150 ptint.cs.o: ptint.cs.c
151         ${CCRULE}
152
153 ptint.xdr.o: ptint.xdr.c
154         ${CCRULE}
155
156 ptint.cs.c: ${srcdir}/ptint.xg
157         ${RXGEN} -x -C -u -o $@ ${srcdir}/ptint.xg
158
159 ptint.ss.c: ${srcdir}/ptint.xg
160         ${RXGEN} -x -S -o $@ ${srcdir}/ptint.xg
161
162 ptint.xdr.c: ${srcdir}/ptint.xg
163         ${RXGEN} -x -c -o $@ ${srcdir}/ptint.xg
164
165 ptint.h: ${srcdir}/ptint.xg
166         ${RXGEN} -x -h -u -o $@ ${srcdir}/ptint.xg
167
168 ptint.cs.c: ptint.h
169 ptint.ss.c: ptint.h
170 ptint.xdr.c: ptint.h
171
172 Kptint.cs.c: ${srcdir}/ptint.xg Kptint.h
173         ${RXGEN} -x -k -C -o Kptint.cs.c ${srcdir}/ptint.xg
174  
175 Kptint.xdr.c: ${srcdir}/ptint.xg
176         ${RXGEN} -x -k -c -o Kptint.xdr.c ${srcdir}/ptint.xg
177  
178 Kptint.h: ${srcdir}/ptint.xg
179         ${RXGEN} -x -k -h -o Kptint.h ${srcdir}/ptint.xg
180
181 display.o: ${srcdir}/display.c
182         ${CCRULE}
183
184 ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${TOP_LIBDIR}/libaudit.a map.o
185         ${MT_CC} ${CFLAGS} ${MT_CFLAGS} -o ptserver ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o map.o $(LIBS) ${XLIBS} ${TOP_LIBDIR}/libaudit.a
186
187 db_verify.o: ${srcdir}/db_verify.c
188         ${CCRULE}
189
190 db_verify: db_verify.o pterror.o display.o $(LIBS)
191         $(CC) ${CFLAGS} -o db_verify db_verify.o display.o pterror.o $(LIBS) ${XLIBS}
192
193 ptclient: ptclient.o display.o libprot.a $(LIBS)
194         $(CC) ${CFLAGS} -o ptclient ptclient.o display.o libprot.a $(LIBS) ${XLIBS}
195
196 ptclient.o: ${srcdir}/ptclient.c
197         ${CCRULE}
198
199 ptuser.o: ${srcdir}/ptuser.c
200         ${CCRULE}
201
202 pterror.h pterror.c: ${srcdir}/pterror.et
203         $(RM) -f pterror.h pterror.c
204         ${COMPILE_ET} -p ${srcdir} pterror
205
206 libprot.a: ptuser.o pterror.o ptint.cs.o ptint.xdr.o AFS_component_version_number.o
207         $(RM) -f $@
208         $(AR) crv $@ ptuser.o pterror.o ptint.cs.o ptint.xdr.o AFS_component_version_number.o
209         $(RANLIB) $@
210
211 pts: pts.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
212         $(CC) ${CFLAGS} -o pts pts.o ${TOP_LIBDIR}/libcmd.a libprot.a ${LIBS} ${XLIBS}
213
214 pts.o: ${srcdir}/pts.c
215         ${CCRULE}
216
217 readgroup: readgroup.o libprot.a $(LIBS)
218         $(CC) ${CFLAGS} -o readgroup readgroup.o libprot.a ${LIBS} ${XLIBS}
219
220 readgroup.o: ${srcdir}/readgroup.c
221         ${CCRULE}
222
223 readpwd: readpwd.o libprot.a $(LIBS)
224         $(CC) ${CFLAGS} -o readpwd readpwd.o libprot.a ${LIBS} ${XLIBS}
225
226 readpwd.o: ${srcdir}/readpwd.c
227         ${CCRULE}
228
229 testpt: testpt.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
230         case "$(SYS_NAME)" in \
231         *_darwin_12 ) \
232                 $(CC) ${CFLAGS} -o testpt testpt.o ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ;; \
233         * ) \
234                 $(CC) ${CFLAGS} -o testpt testpt.o -lm ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ${XLIBS} ;; \
235         esac
236
237 testpt.o: ${srcdir}/testpt.c
238         ${CCRULE}
239
240 pt_util: pt_util.o ptutils.o ubik.o utils.o map.o libprot.a $(LIBS)
241         $(CC) ${CFLAGS} -o pt_util pt_util.o ptutils.o ubik.o utils.o map.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS) ${XLIBS}
242
243 pt_util.o: ${srcdir}/pt_util.c
244         ${CCRULE}
245
246 ubik.o: ${srcdir}/ubik.c
247         ${CCRULE}
248
249 prerror.h: pterror.h
250         ${INSTALL} $? $@
251         echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_PT' >> $@
252
253 #
254 # Installation targets
255 #
256 install: \
257         ${DESTDIR}${afssrvlibexecdir}/ptserver \
258         ${DESTDIR}${afssrvbindir}/pts \
259         ${DESTDIR}${bindir}/pts \
260         ${DESTDIR}${afssrvsbindir}/pt_util \
261         ${DESTDIR}${afssrvsbindir}/prdb_check \
262         ${DESTDIR}${libdir}/afs/libprot.a \
263         ${DESTDIR}${includedir}/afs/prclient.h \
264         ${DESTDIR}${includedir}/afs/prerror.h \
265         ${DESTDIR}${includedir}/afs/print.h \
266         ${DESTDIR}${includedir}/afs/prserver.h \
267         ${DESTDIR}${includedir}/afs/ptclient.h \
268         ${DESTDIR}${includedir}/afs/ptuser.h \
269         ${DESTDIR}${includedir}/afs/pterror.h \
270         ${DESTDIR}${includedir}/afs/ptint.h \
271         ${DESTDIR}${includedir}/afs/ptserver.h
272
273 ${DEST}/root.server/usr/afs/bin/ptserver: ptserver
274         ${INSTALL} $? $@
275
276 ${DEST}/bin/pts ${DEST}/root.server/usr/afs/bin/pts: pts
277         ${INSTALL} $? $@
278
279 ${DEST}/root.server/usr/afs/bin/pt_util: pt_util
280         ${INSTALL} $? $@
281
282 ${DEST}/lib/afs/libprot.a: libprot.a
283         ${INSTALL} $? $@
284
285 ${DEST}/etc/prdb_check: db_verify
286         ${INSTALL} -f $? $@
287
288 ${DEST}/include/afs/prclient.h: ${srcdir}/ptclient.h
289         ${INSTALL} $? $@
290
291 ${DEST}/include/afs/prerror.h: pterror.h
292         ${INSTALL} $? $@
293
294 ${DEST}/include/afs/print.h: ptint.h
295         ${INSTALL} $? $@
296
297 ${DEST}/include/afs/prserver.h: ${srcdir}/ptserver.h
298         ${INSTALL} $? $@
299
300 ${DEST}/include/afs/ptserver.h: ${srcdir}/ptserver.h
301         ${INSTALL} $? $@
302
303 ${DEST}/include/afs/ptint.h: ptint.h
304         ${INSTALL} $? $@
305
306 ${DEST}/include/afs/pterror.h: pterror.h
307         ${INSTALL} $? $@
308
309 ${DEST}/include/afs/ptclient.h: ${srcdir}/ptclient.h
310         ${INSTALL} $? $@
311
312 ${DEST}/include/afs/ptuser.h: ${srcdir}/ptuser.h
313         ${INSTALL} $? $@
314
315 #
316 # Misc. targets
317 #
318 clean:
319         $(RM) -f *.a *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
320         libprot.a pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
321         core AFS_component_version_number.c Kptint.cs.c Kptint.h Kptint.xdr.c
322
323 include ../config/Makefile.version
324 ${DESTDIR}${afssrvlibexecdir}/ptserver: ptserver
325         ${INSTALL} $? $@
326
327 ${DESTDIR}${afssrvbindir}/pts: pts
328         ${INSTALL} $? $@
329
330 ${DESTDIR}${bindir}/pts: pts
331         ${INSTALL} $? $@
332
333 ${DESTDIR}${afssrvsbindir}/pt_util: pt_util
334         ${INSTALL} $? $@
335
336 ${DESTDIR}${afssrvsbindir}/prdb_check: db_verify
337         ${INSTALL} -f $? $@
338
339 ${DESTDIR}${libdir}/afs/libprot.a: libprot.a
340         ${INSTALL} $? $@
341
342 ${TOP_LIBDIR}/libprot.a: libprot.a
343         ${INSTALL} $? $@
344
345 ${DESTDIR}${includedir}/afs/prclient.h: ${srcdir}/ptclient.h
346         ${INSTALL} $? $@
347
348 ${TOP_INCDIR}/afs/prclient.h: ${srcdir}/ptclient.h
349         ${INSTALL} $? $@
350
351 ${DESTDIR}${includedir}/afs/prerror.h: pterror.h
352         ${INSTALL} $? $@
353
354 ${TOP_INCDIR}/afs/prerror.h: pterror.h
355         ${INSTALL} $? $@
356
357 ${DESTDIR}${includedir}/afs/print.h: ptint.h
358         ${INSTALL} $? $@
359
360 ${TOP_INCDIR}/afs/print.h: ptint.h
361         ${INSTALL} $? $@
362
363 ${DESTDIR}${includedir}/afs/prserver.h: ${srcdir}/ptserver.h
364         ${INSTALL} $? $@
365
366 ${TOP_INCDIR}/afs/prserver.h: ${srcdir}/ptserver.h
367         ${INSTALL} $? $@
368
369 ${DESTDIR}${includedir}/afs/ptclient.h: ${srcdir}/ptclient.h
370         ${INSTALL} $? $@
371
372 ${DESTDIR}${includedir}/afs/ptuser.h: ${srcdir}/ptuser.h
373         ${INSTALL} $? $@
374
375 ${TOP_INCDIR}/afs/ptclient.h: ${srcdir}/ptclient.h
376         ${INSTALL} $? $@
377
378 ${TOP_INCDIR}/afs/ptuser.h: ${srcdir}/ptuser.h
379         ${INSTALL} $? $@
380
381 ${DESTDIR}${includedir}/afs/pterror.h: pterror.h
382         ${INSTALL} $? $@
383
384 ${TOP_INCDIR}/afs/pterror.h: pterror.h
385         ${INSTALL} $? $@
386
387 ${DESTDIR}${includedir}/afs/ptint.h: ptint.h
388         ${INSTALL} $? $@
389
390 ${TOP_INCDIR}/afs/ptint.h: ptint.h
391         ${INSTALL} $? $@
392
393 ${DESTDIR}${includedir}/afs/ptserver.h: ${srcdir}/ptserver.h
394         ${INSTALL} $? $@
395
396 ${TOP_INCDIR}/afs/ptserver.h: ${srcdir}/ptserver.h
397         ${INSTALL} $? $@
398
399
400 dest: \
401         ${DEST}/root.server/usr/afs/bin/ptserver \
402         ${DEST}/root.server/usr/afs/bin/pts \
403         ${DEST}/bin/pts \
404         ${DEST}/root.server/usr/afs/bin/pt_util \
405         ${DEST}/etc/prdb_check \
406         ${DEST}/lib/afs/libprot.a \
407         ${DEST}/include/afs/prclient.h \
408         ${DEST}/include/afs/prerror.h \
409         ${DEST}/include/afs/print.h \
410         ${DEST}/include/afs/prserver.h \
411         ${DEST}/include/afs/ptclient.h \
412         ${DEST}/include/afs/ptuser.h \
413         ${DEST}/include/afs/pterror.h \
414         ${DEST}/include/afs/ptint.h \
415         ${DEST}/include/afs/ptserver.h
416