# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
# 
# This software has been released under the terms of the IBM Public
# License.  For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html

srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config

LIBOBJS = rxstat.cs.o rxstat.ss.o rxstat.xdr.o rxstat.o

all: depinstall ${TOP_LIBDIR}/librxstat.a 

depinstall: \
	${TOP_INCDIR}/rx/rxstat.h Krxstat.cs.c Krxstat.ss.c Krxstat.xdr.c

#
# Build targets
#
rxstat.cs.c: rxstat.xg
	${RXGEN} -x -C -o $@ ${srcdir}/rxstat.xg

rxstat.ss.c: rxstat.xg
	${RXGEN} -x -S -o $@ ${srcdir}/rxstat.xg

rxstat.xdr.c: rxstat.xg
	${RXGEN} -x -c -o $@ ${srcdir}/rxstat.xg

rxstat.h: rxstat.xg
	${RXGEN} -x -h -o $@ ${srcdir}/rxstat.xg

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 $@ ${srcdir}/rxstat.xg

Krxstat.ss.c: rxstat.xg
	${RXGEN} -x -k -S -o $@ ${srcdir}/rxstat.xg

Krxstat.xdr.c: 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} $? $@

#
# Misc. targets
#
clean:
	$(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

