# License. For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html
-DESTDIR=@DESTDIR@
-SRCDIR=@SRCDIR@
+DEST=@DEST@
+TOP_INCDIR=@TOP_INCDIR@
+TOP_LIBDIR=@TOP_LIBDIR@
+TOP_OBJDIR=@TOP_OBJDIR@
+srcdir=@srcdir@
+VPATH=${srcdir}
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+libdir=@libdir@
+includedir=@includedir@
+mandir=@mandir@
+afssrvbindir=@afssrvbindir@
+afssrvsbindir=@afssrvsbindir@
+afssrvlibexecdir=@afssrvlibexecdir@
+COMPILE_ET=${TOP_OBJDIR}/src/comerr/compile_et
TOP_SRCDIR=@TOP_SRCDIR@
SYS_NAME=@AFS_SYSNAME@
SHELL = /bin/sh
include ../config/Makefile.${SYS_NAME}
-include ../config/Makefile.version
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
-RXGEN=${SRCDIR}bin/rxgen
-MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
+RXGEN=${TOP_OBJDIR}/src/rxgen/rxgen
KSRCS=rxstat.c rxstat.h Krxstat.ss.c Krxstat.xdr.c
-CFLAGS = $(DBUG) -I${TOP_SRCDIR}/config -I${SRCDIR}include ${XCFLAGS}
+CFLAGS=-I. -I${srcdir} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS}
LIBOBJS = rxstat.cs.o rxstat.ss.o rxstat.xdr.o rxstat.o
-all: librxstat.a includes
+all: kinstall ukinstall ${TOP_INCDIR}/rx/rxstat.h ${TOP_LIBDIR}/librxstat.a
-rxstat.cs.c rxstat.ss.c rxstat.xdr.c rxstat.h: rxstat.xg
- ${RXGEN} -x rxstat.xg
+#
+# Build targets
+#
+rxstat.cs.c: rxstat.xg
+ ${RXGEN} -x -C -o $@ ${srcdir}/rxstat.xg
-librxstat.a: ${LIBOBJS} AFS_component_version_number.o
- -rm -f $@
- $(AR) rv $@ AFS_component_version_number.o ${LIBOBJS}
- $(RANLIB) $@
+rxstat.ss.c: rxstat.xg
+ ${RXGEN} -x -S -o $@ ${srcdir}/rxstat.xg
+
+rxstat.xdr.c: rxstat.xg
+ ${RXGEN} -x -c -o $@ ${srcdir}/rxstat.xg
-kinstall: ${KSRCS}
- set ${KERNELDIR}afsint; $(MKDIR_IF_NEEDED)
- ${INSTALL} ${KSRCS} ${KERNELDIR}afsint
+rxstat.h: rxstat.xg
+ ${RXGEN} -x -h -o $@ ${srcdir}/rxstat.xg
-ukinstall webinstall: ${KSRCS}
- set ${UKERNELDIR}afsint; $(MKDIR_IF_NEEDED)
- ${INSTALL} ${KSRCS} ${UKERNELDIR}afsint
+rxstat.xdr.c: rxstat.h
+rxstat.cs.c: rxstat.h
+rxstat.ss.c: rxstat.h
+
+librxstat.a: ${LIBOBJS} AFS_component_version_number.o
+ -$(RM) -f $@
+ $(AR) crv $@ ${LIBOBJS} AFS_component_version_number.o
+ $(RANLIB) $@
Krxstat.cs.c: rxstat.xg
- ${RXGEN} -x -k -C -o $@ rxstat.xg
+ ${RXGEN} -x -k -C -o $@ ${srcdir}/rxstat.xg
Krxstat.ss.c: rxstat.xg
- ${RXGEN} -x -k -S -o $@ rxstat.xg
+ ${RXGEN} -x -k -S -o $@ ${srcdir}/rxstat.xg
Krxstat.xdr.c: rxstat.xg
- ${RXGEN} -x -k -c -o $@ rxstat.xg
+ ${RXGEN} -x -k -c -o $@ ${srcdir}/rxstat.xg
+
+#
+# Install targets
+#
+install: ${DESTDIR}${includedir}/rx/rxstat.h ${DESTDIR}${libdir}/librxstat.a
+
+${DEST}/lib/librxstat.a: librxstat.a
+ ${INSTALL} $? $@
+
+${DEST}/include/rx/rxstat.h: rxstat.h
+ ${INSTALL} $? $@
+
+kinstall: ${KERNELDIR}/afsint \
+ ${KERNELDIR}/afsint/rxstat.c \
+ ${KERNELDIR}/afsint/rxstat.h \
+ ${KERNELDIR}/afsint/Krxstat.ss.c \
+ ${KERNELDIR}/afsint/Krxstat.xdr.c
+
+${KERNELDIR}/afsint:
+ mkdir -p $?
+
+${KERNELDIR}/afsint/rxstat.c: rxstat.c
+ ${INSTALL} $? $@
+
+${KERNELDIR}/afsint/rxstat.h: rxstat.h
+ ${INSTALL} $? $@
-install: librxstat.a includes kinstall ukinstall
- ${INSTALL} librxstat.a ${DESTDIR}lib
+${KERNELDIR}/afsint/Krxstat.ss.c: Krxstat.ss.c
+ ${INSTALL} $? $@
-includes: rxstat.h
- ${INSTALL} rxstat.h ${DESTDIR}include/rx
+${KERNELDIR}/afsint/Krxstat.xdr.c: Krxstat.xdr.c
+ ${INSTALL} $? $@
+ukinstall: ${UKERNELDIR}/afsint \
+ ${UKERNELDIR}/afsint/rxstat.c \
+ ${UKERNELDIR}/afsint/rxstat.h \
+ ${UKERNELDIR}/afsint/Krxstat.ss.c \
+ ${UKERNELDIR}/afsint/Krxstat.xdr.c
+
+${UKERNELDIR}/afsint:
+ mkdir -p $?
+
+${UKERNELDIR}/afsint/rxstat.c: rxstat.c
+ ${INSTALL} $? $@
+
+${UKERNELDIR}/afsint/rxstat.h: rxstat.h
+ ${INSTALL} $? $@
+
+${UKERNELDIR}/afsint/Krxstat.ss.c: Krxstat.ss.c
+ ${INSTALL} $? $@
+
+${UKERNELDIR}/afsint/Krxstat.xdr.c: Krxstat.xdr.c
+ ${INSTALL} $? $@
+
+#
+# Misc. targets
+#
clean:
- rm -f rxstat.h *.xdr.c *.cs.c *.ss.c *.o *.a core *_component_version_number.c
+ $(RM) -f rxstat.h *.xdr.c *.cs.c *.ss.c *.o *.a core AFS_component_version_number.c
+
+include ../config/Makefile.version
+${DESTDIR}${includedir}/rx/rxstat.h: rxstat.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/rx/rxstat.h: rxstat.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${libdir}/librxstat.a: librxstat.a
+ ${INSTALL} $? $@
+
+${TOP_LIBDIR}/librxstat.a: librxstat.a
+ ${INSTALL} $? $@
+
+dest: ${DEST}/include/rx/rxstat.h ${DEST}/lib/librxstat.a
+