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