# $Idaemons: /home/cvs/pkgtools/lib/Makefile,v 1.5 2002/03/19 18:02:39 knu Exp $

BUILDDIR=	.build

FILES=	${BUILDDIR}/pkg.rb \
	${BUILDDIR}/pkgdb.rb \
	${BUILDDIR}/pkginfo.rb \
	${BUILDDIR}/pkgmisc.rb \
	${BUILDDIR}/pkgtools.rb \
	${BUILDDIR}/pkgtsort.rb \
	${BUILDDIR}/pkgversion.rb \
	${BUILDDIR}/portinfo.rb \
	${BUILDDIR}/ports.rb \
	${BUILDDIR}/portsdb.rb

FILESDIR?=	`${RUBY} -rrbconfig -e \
	'puts "%s/%s.%s" % Config::CONFIG.indices("sitedir", "MAJOR", "MINOR")'`

CLEANDIRS=	${BUILDDIR}

.for file in ${FILES}
${file}: ${file:T}
	${RUBY} -wc ${.ALLSRC}
	@mkdir -p ${BUILDDIR}
	${RUBY} -p \
		-e 'sub %r:/usr/local:, "${PREFIX}"' \
		${.ALLSRC} > ${.TARGET}
.endfor

.include <bsd.prog.mk>

.include "${.CURDIR}/../Makefile.compat"
