all:	html

types.txt.echo:
	@# find -s www* -type f -exec file {} \;
	@echo "Run this manually: find -s www* -type f -exec file {} \\;"

BLA!= find www* -type f -print

links.lmth: 	${BLA} Makefile
	echo "<HTML><HEAD><TITLE>" 				>  ${.CURDIR}/$@
	echo "Julian H. Stacey's ~jhs/harries/archive/links.html</TITLE></HEAD>"	>> ${.CURDIR}/$@
	echo "<BODY><H1><a href=http://www.berklix.com/~jhs/>Julian H. Stacey</a>'s"	>> ${.CURDIR}/$@
	echo '<BR>Index of <a href="./">~jhs/harries/archive/</A>www*</H1>' 		>> ${.CURDIR}/$@
	echo "<P><B>Generated `date` by "			>> ${.CURDIR}/$@
	echo "<a href=Makefile>Makefile</a></B><P>"		>> ${.CURDIR}/$@
	echo "<MENU>"						>> ${.CURDIR}/$@
	@# Cant use ${BLA} in next line as need filenames one per line.
	(cd ${.CURDIR}; find www* -type f \( ! -name links.html.tmp \) \
		-print ) | sort 		> ${HOME}/tmp/$@.tmp
	for i in `cat ${HOME}/tmp/$@.tmp` ; do \
        	echo "<li><a href=$$i>$$i</a><PRE>" 		>> ${.CURDIR}/$@ ; \
		ls -l $$i | 	\
			sed -e s/-r--r--r--// | \
			sed -e s/jhs// |	\
			sed -e s/staff// |	\
			sed -e s/1//		\
								>> ${.CURDIR}/$@ ; \
		file -b $$i					>> ${.CURDIR}/$@ ; \
        	echo "</PRE>" 					>> ${.CURDIR}/$@ ; \
        	done
	-rm ${HOME}/tmp/$@.tmp
	echo '</MENU><HR>'					>> ${.CURDIR}/$@
	echo '<a href="../../txt/footer.html"><img src="/gifs/footer.gif"></a>' >> ${.CURDIR}/$@
	echo '</BODY></HTML>' 					>> ${.CURDIR}/$@
	chmod 644 $@

.include <berklix.mk>
