# Makefile for the module providing the client side of the File Server
# and Cache Manager extended statistics gathering.
+
DESTDIR=@DESTDIR@
SRCDIR=@SRCDIR@
TOP_SRCDIR=@TOP_SRCDIR@
-I/usr/include ${XCFLAGS}
RPCINCLS=${SRCDIR}/include/lwp.h ${SRCDIR}/include/rx/rx.h
-FSINCLS=xstat_fs.h ${RPCINCLS}
-CMINCLS=xstat_cm.h ${RPCINCLS}
-AFSLIBS=${SRCDIR}/lib/afs/libafsint.a \
+LIBS= ${SRCDIR}/lib/afs/libafsint.a \
${SRCDIR}/lib/afs/libcmd.a \
${SRCDIR}/lib/librx.a \
${SRCDIR}/lib/liblwp.a \
${SRCDIR}/lib/afs/libsys.a \
${SRCDIR}/lib/afs/util.a
-LIBS = ${AFSLIBS}
-
-FSOBJS=xstat_fs.o \
- xstat_fs_callback.o
-
-CMOBJS=xstat_cm.o
-
-include ../config/Makefile.version
-
-all: libxstat_fs.a xstat_fs_test \
- libxstat_cm.a xstat_cm_test
+all: install
#
-# ------------------------------------------ File Server data collection
+# File Server data collection
#
-libxstat_fs.a: ${FSOBJS} AFS_component_version_number.o
- -rm -f libxstat_fs.a
- ${AR} rv libxstat_fs.a ${FSOBJS} AFS_component_version_number.o
- $(RANLIB) libxstat_fs.a
+FSINCLS=xstat_fs.h ${RPCINCLS}
+
+libxstat_fs.a: xstat_fs.o xstat_fs_callback.o AFS_component_version_number.o
+ -$(RM) -f $@
+ $(AR) crv $@ xstat_fs.o xstat_fs_callback.o AFS_component_version_number.o
+ $(RANLIB) $@
xstat_fs.o: xstat_fs.c ${FSINCLS}
${CC} ${CFLAGS} -o xstat_fs_test xstat_fs_test.o libxstat_fs.a ${LIBS} ${XLIBS}
#
-# ---------------------------------------- Cache Manager data collection
+# Cache Manager data collection
#
-libxstat_cm.a: ${CMOBJS} AFS_component_version_number.o
- -rm -f libxstat_cm.a
- ${AR} rv libxstat_cm.a ${CMOBJS} AFS_component_version_number.o
+CMINCLS=xstat_cm.h ${RPCINCLS}
+
+libxstat_cm.a: xstat_cm.o AFS_component_version_number.o
+ -$(RM) -f libxstat_cm.a
+ $(AR) crv libxstat_cm.a xstat_cm.o AFS_component_version_number.o
$(RANLIB) libxstat_cm.a
xstat_cm.o: xstat_cm.c ${CMINCLS}
${CC} ${CFLAGS} -o xstat_cm_test xstat_cm_test.o libxstat_cm.a ${LIBS} ${XLIBS}
#
-# Misc others
-
+# Installation targets
#
-system: install
+install: \
+ ${DESTDIR}/include/afs/xstat_fs.h \
+ ${DESTDIR}/include/afs/xstat_cm.h \
+ ${DESTDIR}/lib/afs/libxstat_fs.a \
+ ${DESTDIR}/lib/afs/libxstat_cm.a \
+ ${DESTDIR}/bin/xstat_fs_test \
+ ${DESTDIR}/bin/xstat_cm_test
+
+${DESTDIR}/include/afs/xstat_fs.h: xstat_fs.h
+ ${INSTALL} $? $@
+
+${DESTDIR}/include/afs/xstat_cm.h: xstat_cm.h
+ ${INSTALL} $? $@
+
+${DESTDIR}/lib/afs/libxstat_fs.a: libxstat_fs.a
+ ${INSTALL} $? $@
+
+${DESTDIR}/lib/afs/libxstat_cm.a: libxstat_cm.a
+ ${INSTALL} $? $@
+
+${DESTDIR}/bin/xstat_fs_test: xstat_fs_test
+ ${INSTALL} $? $@
-install: all
- ${INSTALL} xstat_fs.h ${DESTDIR}/include/afs
- ${INSTALL} xstat_cm.h ${DESTDIR}/include/afs
- ${INSTALL} libxstat_fs.a ${DESTDIR}/lib/afs
- ${INSTALL} libxstat_cm.a ${DESTDIR}/lib/afs
- ${INSTALL} xstat_fs_test ${DESTDIR}/bin
- ${INSTALL} xstat_cm_test ${DESTDIR}/bin
+${DESTDIR}/bin/xstat_cm_test: xstat_cm_test
+ ${INSTALL} $? $@
+#
+# Misc targets
+#
clean:
- rm -f *.o \
- xstat_fs_test \
- xstat_cm_test \
- libxstat_fs.a \
- libxstat_cm.a \
- core\
- AFS_component_version_number.c
+ $(RM) -f *.o *.a xstat_fs_test xstat_cm_test core AFS_component_version_number.c
+
+include ../config/Makefile.version
+