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