# Generated automatically from Makefile.in by configure.
################################################################
#	Makefile for CFEngine's bin directory
################################################################

prefix = /usr/local
exec_prefix = ${prefix}

bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin

datadir = ${prefix}/share
acdatadir = ${datadir}/cfengine

INSTALL = /local/gnu/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}

MKINSTALLDIR = ../bin/mkinstalldirs

PERL = /local/bin/perl
SCRIPTS = cfdaily cfwrap cfmail noseyparker editquotas cfbackup cfbg

RM = rm -f

all: ${SCRIPTS} backup.exclude
	echo "All scripts built"

install: all
	${MKINSTALLDIR} ${sbindir} ${acdatadir}
	for x in ${SCRIPTS}; \
	do \
	${INSTALL_PROGRAM} $$x ${sbindir}; \
	done
	${INSTALL_DATA} backup.exclude ${acdatadir}

cfdaily:
	echo "#!${SHELL}" > cfdaily
	echo "" >> cfdaily
	echo "CFINPUTS=${acdatadir}" >> cfdaily
	echo "export CFINPUTS" >> cfdaily
	echo "${bindir}/cfengine" >> cfdaily
	chmod 0755 cfdaily

cfwrap: cfwrap.h cfwrap.t
	echo "#!${PERL}" > cfwrap
	cat cfwrap.h >> cfwrap
	echo "\$$prefix =  ${prefix};" >> cfwrap
	echo "\$$datadir = ${acdatadir};" >> cfwrap
	echo "\$$bindir = ${bindir};" >> cfwrap
	echo "\$$sbindir = ${sbindir};" >> cfwrap
	cat cfwrap.t >> cfwrap
	chmod 0755 cfwrap

cfmail: cfmail.t
	echo "#!${PERL}" > cfmail
	cat cfmail.t >> cfmail
	chmod 0755 cfmail

noseyparker: noseyparker.h noseyparker.t
	echo "#!${PERL}" > noseyparker
	cat noseyparker.h >> noseyparker
	echo "\$$cfbindir = ${bindir};" >> noseyparker
	cat noseyparker.t >> noseyparker
	chmod 0755 noseyparker

editquotas: editquotas.t
	echo "#!${PERL}" > editquotas
	cat editquotas.t >> editquotas
	chmod 0755 editquotas

cfbackup: cfbackup.t
	echo "#!${PERL}" > cfbackup
	echo "" >> cfbackup
	echo "\$$prefix = ${prefix};" >> cfbackup
	echo "\$$datadir = ${acdatadir};" >> cfbackup
	cat cfbackup.t >> cfbackup
	chmod 0755 cfbackup

cfrestore: cfrestore.t
	echo "#!${PERL}" > cfrestore
	cat cfrestore.t >> cfrestore
	chmod 0755 cfrestore

cfbg: cfbg.t
	echo "#!${PERL}" > cfbg
	cat cfbg.t >> cfbg
	chmod 0755 cfbg

distclean:
	${RM} ${SCRIPTS} cf-install

clean: distclean
