18434c4d07ac4d576db16c8772d30a54ec4dc3c5
[openafs.git] / src / ptserver / 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 srcdir=@srcdir@
8 include @TOP_OBJDIR@/src/config/Makefile.config
9
10 INCLS=${TOP_INCDIR}/ubik.h \
11         ${TOP_INCDIR}/lock.h  \
12         ${TOP_INCDIR}/lwp.h \
13         ${TOP_INCDIR}/rx/rx.h \
14         ${TOP_INCDIR}/rx/xdr.h \
15         ${TOP_INCDIR}/afs/keys.h \
16         ${TOP_INCDIR}/afs/cellconfig.h \
17         ptserver.h ptclient.h ptint.h ptopcodes.h pterror.h map.h
18
19 LINCLS=${TOP_INCDIR}/ubik.h \
20         ${TOP_INCDIR}/lock.h \
21         ${TOP_INCDIR}/rx/rx.h \
22         ${TOP_INCDIR}/rx/xdr.h  \
23         ${TOP_INCDIR}/rx/rxkad.h \
24         ${TOP_INCDIR}/afs/auth.h \
25         ${TOP_INCDIR}/afs/cellconfig.h \
26         ptclient.h ptint.h pterror.h
27
28 LIBS=${TOP_LIBDIR}/libubik.a \
29         ${TOP_LIBDIR}/libauth.a \
30         ${TOP_LIBDIR}/librxkad.a \
31         ${TOP_LIBDIR}/librxstat.a \
32         ${TOP_LIBDIR}/librx.a \
33         ${TOP_LIBDIR}/liblwp.a \
34         ${TOP_LIBDIR}/libdes.a \
35         ${TOP_LIBDIR}/libcmd.a \
36         ${TOP_LIBDIR}/libcom_err.a \
37         ${TOP_LIBDIR}/util.a \
38         ${TOP_LIBDIR}/libsys.a \
39         ${TOP_LIBDIR}/libafsutil.a
40
41
42 all: ptserver pts pt_util db_verify ${TOP_LIBDIR}/libprot.a \
43         depinstall readgroup readpwd testpt
44
45 depinstall: \
46         ptint.cs.c ptint.xdr.c \
47         ${TOP_INCDIR}/afs/prclient.h \
48         ${TOP_INCDIR}/afs/prerror.h \
49         ${TOP_INCDIR}/afs/print.h \
50         ${TOP_INCDIR}/afs/prserver.h \
51         ${TOP_INCDIR}/afs/ptclient.h \
52         ${TOP_INCDIR}/afs/pterror.h \
53         ${TOP_INCDIR}/afs/ptint.h \
54         ${TOP_INCDIR}/afs/ptserver.h
55
56 #
57 # Build targets
58 #
59 ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${TOP_LIBDIR}/libaudit.a map.o
60         $(CC) ${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
61
62 ptserver.o: ptserver.c ${INCLS} AFS_component_version_number.c
63
64 ptutils.o: ptutils.c ${INCLS}
65
66 ptprocs.o: ptprocs.c ${INCLS}
67
68 utils.o: utils.c ${INCLS} 
69
70 map.o: map.c ${INCLS}
71
72 ptint.ss.o: ptint.ss.c ptint.xdr.c ptint.xg
73 ptint.cs.o: ptint.cs.c ptint.xdr.c ptint.xg
74 ptint.xdr.o: ptint.xdr.c ptint.h ptint.xg
75
76 ptint.cs.c: ptint.xg
77         ${RXGEN} -x -C -o $@ ${srcdir}/ptint.xg
78
79 ptint.ss.c: ptint.xg
80         ${RXGEN} -x -S -o $@ ${srcdir}/ptint.xg
81
82 ptint.xdr.c: ptint.xg
83         ${RXGEN} -x -c -o $@ ${srcdir}/ptint.xg
84
85 ptint.h: ptint.xg
86         ${RXGEN} -x -h -o $@ ${srcdir}/ptint.xg
87
88 ptint.cs.c: ptint.h
89 ptint.ss.c: ptint.h
90 ptint.xdr.c: ptint.h
91
92 Kptint.cs.c: ptint.xg Kptint.h
93         ${RXGEN} -x -k -C -o Kptint.cs.c ${srcdir}/ptint.xg
94  
95 Kptint.xdr.c: ptint.xg
96         ${RXGEN} -x -k -c -o Kptint.xdr.c ${srcdir}/ptint.xg
97  
98 Kptint.h: ptint.xg
99         ${RXGEN} -x -k -h -o Kptint.h ${srcdir}/ptint.xg
100
101 display.o: display.c ${INCLS}
102
103 db_verify.o: db_verify.c ${INCLS} AFS_component_version_number.c
104
105 db_verify: db_verify.o pterror.o display.o $(LIBS)
106         $(CC) ${CFLAGS} -o db_verify db_verify.o display.o pterror.o $(LIBS) ${XLIBS}
107
108 ptclient: ptclient.o display.o libprot.a $(LIBS)
109         $(CC) ${CFLAGS} -o ptclient ptclient.o display.o libprot.a $(LIBS) ${XLIBS}
110
111 ptclient.o: ptclient.c ${INCLS} AFS_component_version_number.c
112
113 ptuser.o: ptuser.c ${LINCLS}
114
115 pterror.h pterror.c: pterror.et
116         $(RM) -f pterror.h pterror.c
117         ${COMPILE_ET} -p ${srcdir} pterror
118
119 libprot.a: ptuser.o pterror.o ptint.cs.o ptint.xdr.o AFS_component_version_number.o
120         $(RM) -f $@
121         $(AR) crv $@ ptuser.o pterror.o ptint.cs.o ptint.xdr.o AFS_component_version_number.o
122         $(RANLIB) $@
123
124 pts: pts.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
125         $(CC) ${CFLAGS} -o pts pts.o ${TOP_LIBDIR}/libcmd.a libprot.a ${LIBS} ${XLIBS}
126
127 pts.o: pts.c ${LINCLS} ${TOP_INCDIR}/afs/cmd.h AFS_component_version_number.c
128
129 readgroup: readgroup.o libprot.a $(LIBS)
130         $(CC) ${CFLAGS} -o readgroup readgroup.o libprot.a ${LIBS} ${XLIBS}
131
132 readgroup.o: readgroup.c ${LINCLS} AFS_component_version_number.c
133
134 readpwd: readpwd.o libprot.a $(LIBS)
135         $(CC) ${CFLAGS} -o readpwd readpwd.o libprot.a ${LIBS} ${XLIBS}
136
137 readpwd.o: readpwd.c ${LINCLS} AFS_component_version_number.c
138
139 testpt: testpt.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
140         case "$(SYS_NAME)" in \
141         ppc_darwin_12 ) \
142                 $(CC) ${CFLAGS} -o testpt testpt.o ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ;; \
143         * ) \
144                 $(CC) ${CFLAGS} -o testpt testpt.o -lm ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ${XLIBS} ;; \
145         esac
146
147 testpt.o: testpt.c ${INCLS} ${TOP_INCDIR}/afs/cmd.h AFS_component_version_number.c
148
149 pt_util: pt_util.o ptutils.o ubik.o utils.o map.o libprot.a $(LIBS)
150         $(CC) ${CFLAGS} -o pt_util pt_util.o ptutils.o ubik.o utils.o map.o libprot.a $(LIBS) ${XLIBS}
151
152 ubik.o: ubik.c ${INCLS}
153
154 prerror.h: pterror.h
155         ${INSTALL} $? $@
156         echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_PT' >> $@
157
158 #
159 # Installation targets
160 #
161 install: \
162         ${DESTDIR}${afssrvlibexecdir}/ptserver \
163         ${DESTDIR}${afssrvbindir}/pts \
164         ${DESTDIR}${bindir}/pts \
165         ${DESTDIR}${afssrvsbindir}/pt_util \
166         ${DESTDIR}${afssrvsbindir}/prdb_check \
167         ${DESTDIR}${libdir}/afs/libprot.a \
168         ${DESTDIR}${includedir}/afs/prclient.h \
169         ${DESTDIR}${includedir}/afs/prerror.h \
170         ${DESTDIR}${includedir}/afs/print.h \
171         ${DESTDIR}${includedir}/afs/prserver.h \
172         ${DESTDIR}${includedir}/afs/ptclient.h \
173         ${DESTDIR}${includedir}/afs/pterror.h \
174         ${DESTDIR}${includedir}/afs/ptint.h \
175         ${DESTDIR}${includedir}/afs/ptserver.h
176
177 ${DEST}/root.server/usr/afs/bin/ptserver: ptserver
178         ${INSTALL} $? $@
179
180 ${DEST}/bin/pts ${DEST}/root.server/usr/afs/bin/pts: pts
181         ${INSTALL} $? $@
182
183 ${DEST}/root.server/usr/afs/bin/pt_util: pt_util
184         ${INSTALL} $? $@
185
186 ${DEST}/lib/afs/libprot.a: libprot.a
187         ${INSTALL} $? $@
188
189 ${DEST}/etc/prdb_check: db_verify
190         ${INSTALL} -f $? $@
191
192 ${DEST}/include/afs/prclient.h: ptclient.h
193         ${INSTALL} $? $@
194
195 ${DEST}/include/afs/prerror.h: pterror.h
196         ${INSTALL} $? $@
197
198 ${DEST}/include/afs/print.h: ptint.h
199         ${INSTALL} $? $@
200
201 ${DEST}/include/afs/prserver.h: ptserver.h
202         ${INSTALL} $? $@
203
204 ${DEST}/include/afs/ptserver.h: ptserver.h
205         ${INSTALL} $? $@
206
207 ${DEST}/include/afs/ptint.h: ptint.h
208         ${INSTALL} $? $@
209
210 ${DEST}/include/afs/pterror.h: pterror.h
211         ${INSTALL} $? $@
212
213 ${DEST}/include/afs/ptclient.h: ptclient.h
214         ${INSTALL} $? $@
215
216 #
217 # Misc. targets
218 #
219 clean:
220         $(RM) -f *.a *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
221         libprot.a pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
222         core AFS_component_version_number.c Kptint.cs.c Kptint.h Kptint.xdr.c
223
224 include ../config/Makefile.version
225 ${DESTDIR}${afssrvlibexecdir}/ptserver: ptserver
226         ${INSTALL} $? $@
227
228 ${DESTDIR}${afssrvbindir}/pts: pts
229         ${INSTALL} $? $@
230
231 ${DESTDIR}${bindir}/pts: pts
232         ${INSTALL} $? $@
233
234 ${DESTDIR}${afssrvsbindir}/pt_util: pt_util
235         ${INSTALL} $? $@
236
237 ${DESTDIR}${afssrvsbindir}/prdb_check: db_verify
238         ${INSTALL} -f $? $@
239
240 ${DESTDIR}${libdir}/afs/libprot.a: libprot.a
241         ${INSTALL} $? $@
242
243 ${TOP_LIBDIR}/libprot.a: libprot.a
244         ${INSTALL} $? $@
245
246 ${DESTDIR}${includedir}/afs/prclient.h: ptclient.h
247         ${INSTALL} $? $@
248
249 ${TOP_INCDIR}/afs/prclient.h: ptclient.h
250         ${INSTALL} $? $@
251
252 ${DESTDIR}${includedir}/afs/prerror.h: pterror.h
253         ${INSTALL} $? $@
254
255 ${TOP_INCDIR}/afs/prerror.h: pterror.h
256         ${INSTALL} $? $@
257
258 ${DESTDIR}${includedir}/afs/print.h: ptint.h
259         ${INSTALL} $? $@
260
261 ${TOP_INCDIR}/afs/print.h: ptint.h
262         ${INSTALL} $? $@
263
264 ${DESTDIR}${includedir}/afs/prserver.h: ptserver.h
265         ${INSTALL} $? $@
266
267 ${TOP_INCDIR}/afs/prserver.h: ptserver.h
268         ${INSTALL} $? $@
269
270 ${DESTDIR}${includedir}/afs/ptclient.h: ptclient.h
271         ${INSTALL} $? $@
272
273 ${TOP_INCDIR}/afs/ptclient.h: ptclient.h
274         ${INSTALL} $? $@
275
276 ${DESTDIR}${includedir}/afs/pterror.h: pterror.h
277         ${INSTALL} $? $@
278
279 ${TOP_INCDIR}/afs/pterror.h: pterror.h
280         ${INSTALL} $? $@
281
282 ${DESTDIR}${includedir}/afs/ptint.h: ptint.h
283         ${INSTALL} $? $@
284
285 ${TOP_INCDIR}/afs/ptint.h: ptint.h
286         ${INSTALL} $? $@
287
288 ${DESTDIR}${includedir}/afs/ptserver.h: ptserver.h
289         ${INSTALL} $? $@
290
291 ${TOP_INCDIR}/afs/ptserver.h: ptserver.h
292         ${INSTALL} $? $@
293
294 dest: \
295         ${DEST}/root.server/usr/afs/bin/ptserver \
296         ${DEST}/root.server/usr/afs/bin/pts \
297         ${DEST}/bin/pts \
298         ${DEST}/root.server/usr/afs/bin/pt_util \
299         ${DEST}/etc/prdb_check \
300         ${DEST}/lib/afs/libprot.a \
301         ${DEST}/include/afs/prclient.h \
302         ${DEST}/include/afs/prerror.h \
303         ${DEST}/include/afs/print.h \
304         ${DEST}/include/afs/prserver.h \
305         ${DEST}/include/afs/ptclient.h \
306         ${DEST}/include/afs/pterror.h \
307         ${DEST}/include/afs/ptint.h \
308         ${DEST}/include/afs/ptserver.h