# $Id: Makefile.athena,v 1.1.1.4 1999/04/01 00:02:18 nathanw Exp $

SHELL=/bin/sh

prepare:
	rm -f config.sh
	./Configure -ds -E -Dprefix=/usr/athena -Dcc="$$COMPILER" \
		-Dperladmin=bugs@mit.edu
	sed -e "s,^install\(.*\)=',install\1='$$SRVD," \
		config.sh > config.sh.new
	mv config.sh.new config.sh
	./Configure -S

clean:
	${MAKE} clean

all:
	${MAKE} depend
	${MAKE} all

check:
	PERL_SKIP_TTY_TEST=true ${MAKE} check

install:
	${MAKE} install "DESTDIR=$$SRVD"
	dir=`pwd`; \
	sed -e '/^chdir/d' -e "s:/usr:$$SRVD/usr:" utils/h2ph > h2phsrvd; \
	chmod 755 h2phsrvd; \
	(cd /os/usr/include && find . -type f -print | xargs \
	 "$$dir/perl" "-I$$SRVD/usr/athena/lib/perl5" "$$dir/h2phsrvd"); \
	(cd "$$SRVD/usr/athena/include" && find . -type f -print | xargs \
	 "$$dir/perl" "-I$$SRVD/usr/athena/lib/perl5" "$$dir/h2phsrvd")
