# Generated automatically from Makefile.in by configure.
SHELL = /bin/sh

prefix=/afs/sipb/project/amanda/dev/nocturne/install
exec_prefix=${prefix}
libexecdir=${exec_prefix}/libexec
confdir=/etc/amanda
sbindir=${exec_prefix}/sbin
mandir=${prefix}/man

srcdir=../../../sysadmin/amanda/client-src
top_srcdir=../../../sysadmin/amanda
BUILDTOP=..
# VPATH is used by GNU make to allow building outside the source tree
VPATH=../../../sysadmin/amanda/client-src
CC=gcc
ENSUREDIR=${top_srcdir}/ensure-dir.sh
INSTALL=/mit/gnu/arch/sgi_53/bin/ginstall -c
INSTALL_PROGRAM=${INSTALL}
INSTALL_DATA=${INSTALL} -m 644

DEBUG=-O
CFLAGS=${DEBUG} -DCONFDIR=\"${confdir}\" -I${BUILDTOP} -I${top_srcdir}/config -I${top_srcdir}/common-src 

LDFLAGS=${DEBUG} -L${BUILDTOP}/common-src 
LIBS=-lamanda 

SUF=
# This should have the suffix built into it. Or something.
SENDBACKUP_GNUTAR=
RUNTAR=

AMLIB=${BUILDTOP}/common-src/libamanda.a

CLIENTPROGS= amandad${SUF} sendsize${SUF} calcsize${SUF} \
	     sendbackup-dump${SUF} ${SENDBACKUP_GNUTAR} ${RUNTAR} \
	     selfcheck${SUF}
SUIDCLIENT=  calcsize${SUF} ${RUNTAR}

OBJS=	amandad.o calcsize.o sendsize.o selfcheck.o runtar.o \
	sendbackup-dump.o sendbackup-gnutar.o sendbackup-common.o \

all client: ${CLIENTPROGS}

amandad${SUF}: amandad.o ${AMLIB}
	${CC} ${LDFLAGS} -o $@ amandad.o ${LIBS}

calcsize${SUF}: calcsize.o ${AMLIB}
	${CC} ${LDFLAGS} -o $@ calcsize.o ${LIBS}

sendsize${SUF}: sendsize.o ${AMLIB}
	${CC} ${LDFLAGS} -o $@ sendsize.o ${LIBS}

selfcheck${SUF}: selfcheck.o ${AMLIB}
	${CC} ${LDFLAGS} -o $@ selfcheck.o ${LIBS}

sendbackup-dump${SUF}: sendbackup-dump.o sendbackup-common.o ${AMLIB}
	${CC} ${LDFLAGS} -o $@ sendbackup-dump.o sendbackup-common.o ${LIBS}

sendbackup-gnutar${SUF}: sendbackup-gnutar.o sendbackup-common.o ${AMLIB}
	${CC} ${LDFLAGS} -o $@ sendbackup-gnutar.o sendbackup-common.o ${LIBS}

runtar${SUF}: runtar.o ${AMLIB}
	${CC} ${LDFLAGS} -o $@ runtar.o ${LIBS}

install: install-client
install-server:
install-client: install-client-bin install-client-perms

install-client-bin:
	@echo "Installing Amanda client-side programs:"
	${ENSUREDIR} ${libexecdir} 755
	@for f in ${CLIENTPROGS}; do \
		echo " " ${INSTALL_PROGRAM} $$f ${libexecdir}; \
		${INSTALL_PROGRAM} $$f ${libexecdir}; \
	done

install-client-perms:
	@echo "Setting permissions for setuid-root client programs:"
	@for f in ${SUIDCLIENT}; do \
	   echo "  chown root $(libexecdir)/$$f" ;\
	   chown root $(libexecdir)/$$f || echo "Error: chown of $$f failed.";\
	   echo "  chmod u+s $(libexecdir)/$$f" ;\
	   chmod u+s $(libexecdir)/$$f || echo "Error: chmod of $$f failed.";\
	done

clean:
	-rm -f ${CLIENTPROGS} ${OBJS}

mostlyclean: clean

distclean: clean
	-rm -f Makefile

sendbackup-gnutar.o sendbackup-dump.o sendbackup-common.o: sendbackup-common.h
