initial-linux24-support-20001105
[openafs.git] / src / rx / 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 SHELL = /bin/sh
9 COMPONENT=rx
10 include ../config/Makefile.${SYS_NAME}
11
12 KERNELDIR = ../libafs/
13 UKERNELDIR = ../libuafs/
14 INSTALL=${SRCDIR}bin/install
15 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
16
17 #CC=pcc
18 CFLAGS = ${OPTMZ} -I${SRCDIR}include -DRXDEBUG ${XCFLAGS}
19
20 #
21 # Generic xdr objects (or, at least, xdr stuff that's not newly defined for rx).
22 # Really the xdr stuff should be in its own directory.
23 #
24 XDROBJS = xdr_arrayn.o xdr_rx.o xdr_afsuuid.o
25
26 RXOBJS = rx_clock.o rx_event.o rx_user.o rx_lwp.o rx.o rx_null.o rx_globals.o \
27         rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o  rx_trace.o rx_conncache.o
28
29 MULTIOBJS = rx_multi.o
30
31 LIBOBJS = ${RXOBJS} ${MULTIOBJS} ${XDROBJS}
32
33 BASICINCLS = ${SRCDIR}include/lwp.h ${SRCDIR}include/lock.h \
34              rx_clock.h rx_queue.h rx_event.h
35
36 LIBS = librx.a ${SRCDIR}lib/liblwp.a ${SRCDIR}lib/afs/libcmd.a \
37                ${SRCDIR}lib/afs/util.a 
38
39 LINK = ${CC} ${CFLAGS} -o $@ $@.o ${LIBS} ${SRCDIR}lib/afs/libsys.a ${XLIBS}
40
41 KSRCS = rx.c rx.h rx_clock.c rx_clock.h rx_event.c rx_event.h \
42         rx_globals.c rx_globals.h rx_kernel.h \
43         rx_null.c rx_null.h rx_queue.h rx_getaddr.c rx_packet.c rx_packet.h \
44         rx_multi.h rx_kcommon.h rx_kcommon.c \
45         xdr.c xdr.h xdr_array.c xdr_arrayn.c xdr_rx.c rx_misc.c rx_rdwr.c \
46         xdr_afsuuid.c rx_trace.h
47 UKSRCS = $(KSRCS) rx_conncache.c
48
49 include ../config/Makefile.version
50
51 test tests: install ${DESTDIR}etc/rxdebug rxdumptrace 
52 #       DEST/bin/washtool object rx/test; cd test; $(MAKE) all DESTDIR=${DESTDIR} SRCDIR=${SRCDIR}
53
54 RX_component_version_number.c: AFS_component_version_number.c
55         sed 's/cml_version/rx_cml_version/' <AFS_component_version_number.c >RX_component_version_number.c
56
57 RX_component_version_number.o: RX_component_version_number.c
58
59 xdrs: ${XDROBJS}
60
61 ${RXOBJS}: ${BASICINCLS} rx.h rx_user.h rx_globals.h
62
63 ${MULTIOBJS}: rx.h rx_multi.h
64
65 ${XDROBJS}: xdr.h
66
67 rx_user.o: rx.h rx_user.h
68
69 rxdebug.o: rxdebug.c
70
71 rx_packet.o: rx_packet.c rx_packet.h
72
73 rx_rdwr.o: rx_rdwr.c rx.h
74 #       $(CC) -c -O -I${SRCDIR}include -DRXDEBUG ${XCFLAGS} rx_rdwr.c
75
76 rx.o: rx.h rx_user.h
77
78 rx_conncache.o: rx.h
79
80 rx_trace.o: rx_trace.h 
81
82 rxdumptrace: rx_trace.c
83         rm -f rxdumptrace
84         $(CC) $(CFLAGS) -DDUMPTRACE -o rxdumptrace rx_trace.c  ${LIBS} ${XLIBS}
85         rm -f rx_trace.o
86
87 rx_getaddr.o: rx.h rx_getaddr.c
88
89 rx_globals.o: rx.h rx_user.h rx_globals.h
90
91 xdr_rx.o: xdr.h rx.h
92
93 xdr_refernce.o: xdr_refernce.c xdr.h
94
95 #rx_vab.o: rx_vab.c rx_vab.h rx_user.h ${BASICINCLS}
96
97 librx.a: ${LIBOBJS} RX_component_version_number.o
98         -rm -f $@
99         ar rv $@ RX_component_version_number.o ${LIBOBJS}
100         $(RANLIB) $@
101
102 ${DESTDIR}etc/rxdebug: rxdebug
103         ${INSTALL} rxdebug ${DESTDIR}etc/rxdebug
104
105 rxdebug: rxdebug.o ${DESTDIR}lib/afs/util.a ${DESTDIR}lib/afs/libsys.a
106         ${LINK}
107
108 install.noversion noversion install all system: librx.a includes kinstall ukinstall
109         ${INSTALL} librx.a ${DESTDIR}lib
110
111 includes: rx.h rx_user.h rx_event.h rx_queue.h rx_clock.h xdr.h rx_null.h rx_globals.h
112         set ${DESTDIR}include/rx; $(MKDIR_IF_NEEDED)
113         ${INSTALL} rx_packet.h rx.h rx_user.h rx_event.h rx_queue.h \
114         rx_globals.h \
115         rx_clock.h rx_multi.h ${DESTDIR}include/rx
116         ${INSTALL} xdr.h rx_null.h ${DESTDIR}include/rx
117         ${INSTALL} rx_pthread.h rx_lwp.h rx_misc.h ${DESTDIR}include/rx
118
119 kinstall: includes
120         set $(KERNELDIR)rx; $(MKDIR_IF_NEEDED)
121         $(INSTALL) $(KSRCS) $(KERNELDIR)rx
122         @case ${SYS_NAME} in \
123         alpha_dux4* ) \
124                 $(INSTALL) DUX/*.[ch] $(KERNELDIR)rx;; \
125         hp_ux* ) \
126                 $(INSTALL) HPUX/*.[ch] $(KERNELDIR)rx;; \
127         *_linux* ) \
128                 $(INSTALL) LINUX/*.[ch] $(KERNELDIR)rx;; \
129         rs_aix* ) \
130                 $(INSTALL) AIX/*.[ch] $(KERNELDIR)rx;; \
131         sgi_* ) \
132                 $(INSTALL) IRIX/*.[ch] $(KERNELDIR)rx;; \
133         sun4x_5* ) \
134                 $(INSTALL) SOLARIS/*.[ch]  $(KERNELDIR)rx;; \
135         * ) \
136                 echo WARNING: No kernel RX code for sys ${SYS_NAME};; \
137         esac
138
139 ukinstall webinstall: includes
140         set $(UKERNELDIR)rx; $(MKDIR_IF_NEEDED)
141         $(INSTALL) $(UKSRCS) $(UKERNELDIR)rx
142         $(INSTALL) UKERNEL/*.[ch] $(UKERNELDIR)rx
143
144 clean:
145         rm -f *.o *.a core *_component_version_number.c