# src/bsd/jhs/bin/public/tidy/Makefile
# See also ../date/Makefile

THING=	tidy
PROG=   ${THING}
.include <berklix_no_man.mk>

all:

cleandir obj:
	true

clean:
	rm -f  test.tmp fixed.tmp

install:
.if !exists(/site)	#{	Public & CDROM targets
	echo "Not installing as no /site so probably within a chroot"
.else			#}{	My exported web servers
	@# apache-1.3
	-install -c -m 755 ${.CURDIR}/${THING}.sh \
	 	${DESTDIR}/usr/local/www/cgi-bin/${THING}
	@# apache-2.2
	-install -c -m 755 ${.CURDIR}/${THING}.sh \
		${DESTDIR}/usr/local/www/apache22/cgi-bin/${THING}
.endif                  #}

check:	${TIDY}           Makefile
	@echo "Ensuring TMPJ exists for ./tidy.sh"
	mkdir -p /usr/local/www/data/tmp
	@# -./tidy.sh | grep -v Content-type: | \
		grep -v \\'^$\\' > ${.CURDIR}/tidy.tmp	
	-./tidy.sh | grep -v Content-type: > ${.CURDIR}/tidy.tmp	
	@# - to avoid 6 x error on
	@#	/usr/local/www/data/tmp/after.errors: Permission denied
	@#	/usr/local/www/data/tmp/after.html: Permission denied
	@#	/usr/local/www/data/tmp/after.lines: Permission denied
	@#	/usr/local/www/data/tmp/before.errors: Permission denied
	@#	/usr/local/www/data/tmp/before.html: Permission denied
	@#	/usr/local/www/data/tmp/before.lines: Permission denied

.include <berklix.mk>   # Needed to support recursive make html from above.
