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