afsconfig-updates-20010515
[openafs.git] / src / libafsrpc / Makefile
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 # This is a pthread safe library containing rx, rxkad and des.
9
10 SHELL = /bin/sh
11 COMPONENT=libafsrpc
12 include ../config/Makefile.${SYS_NAME}
13
14 CC=${MT_CC}
15 INCLUDES = -I${SRCDIR}include -I.. -I../rx
16 CFLAGS = ${OPTMZ} ${DBG} ${INCLUDES} -DRXDEBUG ${MT_CFLAGS} -I${TOP_SRCDIR}/config
17 SFLAGS=-P -I${SRCDIR}include
18 RX = ../rx
19 CCRULE = ${CC} ${CFLAGS} -c $?
20 RXKAD = ../rxkad
21 RXSTAT = ../rxstat
22 FSINT = ../fsint
23 DES = ../des
24 COMERR = ../comerr
25 UTIL = ../util
26 SYS = ../sys
27
28 SYSOBJS =\
29         syscall.o
30
31 UTILOBJS =\
32         casestrcpy.o \
33         base64.o
34
35 COMERROBJS =\
36         error_msg.o \
37         et_name.o \
38         com_err.o
39
40 XDROBJS =\
41         xdr_arrayn.o \
42         xdr_rx.o \
43         xdr_int64.o \
44         xdr_afsuuid.o \
45         AFS_component_version_number.o
46
47 RXOBJS =\
48         rx_event.o \
49         rx_user.o \
50         rx_pthread.o \
51         rx.o \
52         rx_null.o \
53         rx_conncache.o \
54         rx_globals.o \
55         rx_getaddr.o \
56         rx_misc.o \
57         rx_packet.o \
58         rx_rdwr.o \
59         rx_trace.o \
60         rx_multi.o
61
62 RXSTATOBJS =\
63         rxstat.o \
64         rxstat.ss.o \
65         rxstat.xdr.o \
66         rxstat.cs.o
67
68 FSINTOBJS =\
69         afsint.cs.o \
70         afsint.xdr.o \
71         afscbint.cs.o \
72         afscbint.xdr.o \
73         afsaux.o
74
75 RXKADOBJS =\
76         rxkad_client.o \
77         rxkad_server.o \
78         rxkad_common.o \
79         ticket.o \
80         fcrypt.o \
81         crypt_conn.o
82
83 DESOBJS =\
84         des.o \
85         cbc_encrypt.o \
86         pcbc_encrypt.o \
87         cksum.o \
88         new_rnd_key.o \
89         key_sched.o \
90         debug_decl.o \
91         quad_cksum.o \
92         key_parity.o \
93         weak_key.o \
94         strng_to_key.o \
95         misco.o \
96         util.o
97
98 LIBOBJS = \
99         ${RXOBJS} \
100         ${DESOBJS} \
101         ${XDROBJS} \
102         ${RXKADOBJS} \
103         ${COMERROBJS} \
104         ${UTILOBJS} \
105         ${SYSOBJS} \
106         ${CRYPT_OBJ} \
107         ${RXSTATOBJS} \
108         ${FSINTOBJS}
109
110 system install:
111         if [ -f "../des/Makefile" ] ; then \
112                 $(MAKE) install.lib ; \
113         else \
114                 $(MAKE) libstub ; \
115         fi
116
117 install.lib: ${DESTDIR}lib/libafsrpc.a
118
119
120 ${DESTDIR}lib/libafsrpc.a: libafsrpc.a
121         ${INSTALL} libafsrpc.a ${DESTDIR}lib/libafsrpc.a
122
123 libafsrpc.a: ${LIBOBJS}
124         rm -f libafsrpc.a
125         ${AR} -r libafsrpc.a ${LIBOBJS}
126         ${RANLIB} libafsrpc.a
127         case "${SYS_NAME}" in                                   \
128             rs_aix*)                                            \
129                 ${AR} r libafsrpc.a ../sys/afsl.exp;;           \
130         esac
131
132 rx_event.o: ${RX}/rx_event.c
133         ${CCRULE};
134
135 rx_user.o: ${RX}/rx_user.c
136         ${CCRULE};
137
138 rx_pthread.o: ${RX}/rx_pthread.c
139         ${CCRULE};
140
141 rx.o: ${RX}/rx.c
142         ${CCRULE};
143
144 rx_conncache.o: ${RX}/rx_conncache.c
145         ${CCRULE};
146
147 rx_null.o: ${RX}/rx_null.c
148         ${CCRULE};
149
150 rx_globals.o: ${RX}/rx_globals.c
151         ${CCRULE};
152
153 rx_getaddr.o: ${RX}/rx_getaddr.c
154         ${CCRULE};
155
156 rx_misc.o: ${RX}/rx_misc.c
157         ${CCRULE};
158
159 rx_packet.o: ${RX}/rx_packet.c
160         ${CCRULE};
161
162 rx_rdwr.o: ${RX}/rx_rdwr.c
163         ${CCRULE};
164
165 rx_trace.o: ${RX}/rx_trace.c
166         ${CCRULE};
167
168 rx_multi.o: ${RX}/rx_multi.c
169         ${CCRULE};
170
171 rxkad_client.o: ${RXKAD}/rxkad_client.c
172         ${CCRULE};
173
174 rxkad_server.o: ${RXKAD}/rxkad_server.c
175         ${CCRULE};
176
177 rxkad_common.o: ${RXKAD}/rxkad_common.c
178         ${CCRULE};
179
180 ticket.o: ${RXKAD}/ticket.c
181         ${CCRULE};
182
183 fcrypt.o: ${RXKAD}/fcrypt.c
184         ${CCRULE};
185
186 crypt_conn.o: ${RXKAD}/crypt_conn.c
187         ${CCRULE};
188
189 AFS_component_version_number.o: ${RX}/AFS_component_version_number.c
190         ${CCRULE};
191
192 xdr.o: ${RX}/xdr.c
193         ${CCRULE};
194
195 xdr_int64.o: ${RX}/xdr_int64.c
196         ${CCRULE};
197
198 xdr_array.o: ${RX}/xdr_array.c
199         ${CCRULE};
200
201 xdr_arrayn.o: ${RX}/xdr_arrayn.c
202         ${CCRULE};
203
204 xdr_float.o: ${RX}/xdr_float.c
205         ${CCRULE};
206
207 xdr_mem.o: ${RX}/xdr_mem.c
208         ${CCRULE};
209
210 xdr_rec.o: ${RX}/xdr_rec.c
211         ${CCRULE};
212
213 xdr_refernce.o: ${RX}/xdr_refernce.c
214         ${CCRULE};
215
216 xdr_rx.o: ${RX}/xdr_rx.c
217         ${CCRULE};
218
219 xdr_update.o: ${RX}/xdr_update.c
220         ${CCRULE};
221
222 xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
223         ${CCRULE};
224
225 # Note that the special case statement for compiling des.c is present
226 # simply to work around a compiler bug on HP-UX 11.0.  The symptom of
227 # the problem is that linking the pthread fileserver fails with messages
228 # such as
229 #
230 #   pxdb internal warning: cu[84]: SLT_SRCFILE[411] out of synch
231 #   Please contact your HP Support representative
232 #   pxdb internal warning: cu[84]: SLT_SRCFILE[442] out of synch
233 #   pxdb internal warning: cu[84]: SLT_SRCFILE[450] out of synch
234 #   pxdb internal warning: cu[84]: SLT_SRCFILE[529] out of synch
235 #   pxdb internal warning: cu[84]: SLT_SRCFILE[544] out of synch
236 #   ...
237 #   pxdb32: internal error. File won't be debuggable (still a valid executable)
238 #   *** Error exit code 10
239 #
240 # The problematic version of pxdb is:
241 #
242 #   $ what /opt/langtools/bin/pxdb32
243 #   /opt/langtools/bin/pxdb32:
244 #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision$
245 #
246 # The problem occurs when -g and -O are both used when compiling des.c.
247 # The simplest way to work around the problem is to leave out either -g or -O.
248 # Since des.c is relatively stable I've chosen to eliminate -g rather
249 # than take any hit in performance.
250
251 des.o: ${DES}/des.c
252         set -x; \
253         case ${SYS_NAME} in \
254         hp_ux11*) \
255                 set X `echo ${CCRULE} | sed s/-g//`; shift; \
256                 "$$@" \
257                 ;; \
258         *) \
259                 ${CCRULE} \
260                 ;; \
261         esac
262
263 crypt.o: ${DES}/crypt.c
264         ${CCRULE};
265
266 cbc_encrypt.o: ${DES}/cbc_encrypt.c
267         ${CCRULE};
268
269 pcbc_encrypt.o: ${DES}/pcbc_encrypt.c
270         ${CCRULE};
271
272 cksum.o: ${DES}/cksum.c
273         ${CCRULE};
274
275 new_rnd_key.o: ${DES}/new_rnd_key.c
276         ${CCRULE};
277
278 key_sched.o: ${DES}/key_sched.c
279         ${CCRULE};
280
281 debug_decl.o: ${DES}/debug_decl.c
282         ${CCRULE};
283
284 quad_cksum.o: ${DES}/quad_cksum.c
285         ${CCRULE};
286
287 key_parity.o: ${DES}/key_parity.c
288         ${CCRULE};
289
290 weak_key.o: ${DES}/weak_key.c
291         ${CCRULE};
292
293 strng_to_key.o: ${DES}/strng_to_key.c
294         ${CCRULE};
295
296 misco.o: ${DES}/misco.c
297         ${CCRULE} -DDONT_INCL_MAIN;
298
299 util.o: ${DES}/util.c
300         ${CCRULE};
301
302 error_msg.o: ${COMERR}/error_msg.c
303         ${CCRULE};
304
305 et_name.o: ${COMERR}/et_name.c
306         ${CCRULE};
307
308 com_err.o: ${COMERR}/com_err.c
309         ${CCRULE};
310
311 casestrcpy.o: ${UTIL}/casestrcpy.c
312         ${CCRULE};
313
314 base64.o: ${UTIL}/base64.c
315         ${CCRULE};
316
317 syscall.o: ${SYS}/syscall.s
318         case "$(SYS_NAME)" in \
319              sun4x_5*) \
320                 /usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
321                 as -o syscall.o syscall.ss;             \
322                 rm syscall.ss;;                         \
323          sgi_* | ppc_darwin* ) \
324                 ${CC} ${CFLAGS} -c ${SYS}/syscall.s;;          \
325          alpha_dux?? ) \
326                 ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER ${SYS}/syscall.s; \
327                 ${AS} -o syscall.o syscall.i; \
328                 rm -f syscall.ss syscall.i;; \
329          *fbsd* ) \
330                 touch syscall.o ;; \
331          *) \
332                 /lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
333                 as -o syscall.o syscall.ss;             \
334                 rm syscall.ss;;                         \
335         esac
336
337 rxstat.o: ${RXSTAT}/rxstat.c
338         ${CCRULE};
339
340 rxstat.cs.o: ${RXSTAT}/rxstat.cs.c
341         ${CCRULE};
342
343 rxstat.ss.o: ${RXSTAT}/rxstat.ss.c
344         ${CCRULE};
345
346 rxstat.xdr.o: ${RXSTAT}/rxstat.xdr.c
347         ${CCRULE};
348
349 afsint.cs.o: ${FSINT}/afsint.cs.c
350         ${CCRULE};
351
352 afsint.xdr.o: ${FSINT}/afsint.xdr.c
353         ${CCRULE};
354
355 afscbint.cs.o: ${FSINT}/afscbint.cs.c
356         ${CCRULE};
357
358 afscbint.xdr.o: ${FSINT}/afscbint.xdr.c
359         ${CCRULE};
360
361 afsaux.o: ${FSINT}/afsaux.c
362         ${CCRULE};
363
364 clean:
365         rm -f *.o libafsrpc*
366
367
368
369 RM     = /bin/rm
370 DESPAR =../../../DESLIB/dest/
371 libstub:
372         echo "Installing libafsrpc stubs from ${DESPAR}:" `(csh -c 'cd ${DESPAR};pwd')`
373         ${RM} -f ${DESTDIR}lib/libafsrpc.a
374         ${INSTALL} ${DESPAR}lib/libafsrpc.a ${DESTDIR}lib/libafsrpc.a