.SUFFIXES: .in .pl

MKDIR		=	mkdir -p
INSTALLDIR	=	${HOME}/bin
LIBDIR		=	@LIBDIR@

TARGET		=	tdf2html.pl

################################################################
all:    ${TARGET}


tdf2html.pl	:	tdf2html.pl.in
	sed 's!%PerlPath%!@PERL5@!g ; s!%LibDir%!${LIBDIR}!g; ' $? > $@

install:	tdf2html.pl
	${MKDIR} ${INSTALLDIR}
	# cp tdf2html.pl
	install -m755 tdf2html.pl ${INSTALLDIR}

	# cp Makefile(sample)
	@if [ -f ${INSTALLDIR}/Makefile ]; then \
		cp ${INSTALLDIR}/Makefile ${INSTALLDIR}/Makefile.bak ;\
	fi
	cp Makefile.sample ${INSTALLDIR}/Makefile

	# cp skelton.html(sample)
	@if [ -f ${INSTALLDIR}/skelton.html ]; then \
		cp ${INSTALLDIR}/skelton.html ${INSTALLDIR}/skelton.html.bak ;\
	fi
	cp skelton.html ${INSTALLDIR}

clean:
	rm -f ${TARGET} *~


