Subject: Re: F'up: /etc/rc.d/sendmail weirdness: more info
To: None <>
From: Andrew Brown <>
List: current-users
Date: 08/29/2004 23:24:14
On Sun, Aug 29, 2004 at 01:06:57PM -0500, Frederick Bruckman wrote:
>	cp -p
>	${M4} ${.ALLSRC} >
>	cp -p
>	${M4} ${.ALLSRC} >
>Season to taste. Note, you have to add
>define(`_CF_DIR_', `/usr/share/sendmail/')
>to the top of your MC file to permit it to build anywhere, as the
>default is to take "_CF_DIR_" as the current working directory.

no, you don't.  all you have to do is specify the full path to cf.m4
(eg /usr/share/sendmail/m4/cf.m4) on the m4 line, like so:
		cp -p
		${M4} /usr/share/sendmail/m4/cf.m4 ${.ALLSRC} >
and the m4 "magic" in cf.m4 will figure out where _CF_DIR_ is.  :)

as an aside (more seasoning), i'd suggest using install ("install -B"
actually) instead of cp there.  then you get backups made each time
you rebuild instead of just the one in .old.  eg:

	M4?=		m4
	RM?=		rm -f
	CFDIR?=		/usr/share/sendmail
	CHMOD?=		chmod
	ROMODE?=	444
	DATE!=		date +%Y%m%d
	.SUFFIXES: .cf .mc
		[ ! -f $@ ] || ${INSTALL} -m${ROMODE} -cB.%02d $@ $@.${DATE}
		${RM} $@
		${M4} ${CFDIR}/m4/cf.m4 ${.CURDIR}/${@:R}.mc > $@
		${CHMOD} ${ROMODE} $@
	.PHONY: all

that gives me this:

	# cd /etc/mail
	# for i in 1 2 3; do sleep 1; touch; make; done
	[output elided]
	# ls*    

adding implicit dependencies on the other files under ${CFDIR}
shouldn't be too hard either, and would be a good idea, since after
you update you probably want to rebuild your cf.

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."