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