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