# Copyright (c) 1998 by Wayne C. Gramlich.
# All rights reserved.

# Permission to use, copy, modify, distribute, and sell this software
# for any purpose is hereby granted without fee provided that the above
# copyright notice and this permission are retained.  The author makes
# no representations about the suitability of this software for any purpose.
# It is provided "as is" without express or implied warranty.

all: everything

ROOT = ../..

include $(ROOT)/Makefile_common.mk
include $(ROOT)/Makefile_private.mk

TEST_BASES =			\
	calls			\
	enumeration		\
	fib			\
	hello			\
	loop			\
	multi			\
	params			\
	procvar			\
	record			\
	switch			\
	variant
TEST_STS = ${TEST_BASES:%=%.sts}
TEST_REFS = ${TEST_BASES:%.%.ref}
OTHER_STS =			\
	array.sts		\
	misc.sts		\
	sort_test.sts
ALL_STS =			\
	${TEST_STS}		\
	${OTHER_STS}
HTMLS =				\
	index.html
SOURCES =			\
	${ALL_STS}		\
	${HTMLS}		\
	Makefile


# Some Targets:

.PHONY: all clean copy everything site

everything: ${SOURCES} $(WAIT) source.html

clean:

site:

copy: source.html
	if [ "$(COPY_DIRECTORY)" = "" ] ;			\
	  then							\
	    echo "Please set COPY_DIRECTORY in `pwd`" ;		\
	    exit 1 ;						\
	  fi
	rm -rf $(COPY_DIRECTORY)
	mkdir -p $(COPY_DIRECTORY)
	cp ${SOURCES} source.html $(COPY_DIRECTORY)

source.html: ${SOURCES} Makefile
	@echo -n "Generating $@..."
	@rm -f $@
	@echo '<HTML>' > $@
	@echo '<Head>' >> $@
	@echo '<Title>STIPPLE Compiler Test Files</Title>' >> $@
	@echo '</Head>' >> $@
	@echo '<Body>' >> $@
	@echo '<P>These are the source files for the' >> $@
	@echo '<A HRef="index.html">New STIPPLE Compiler</A>.</P>' >> $@
	@echo '<H1>' >> $@
	@echo 'STIPPLE Compiler Test Files' >> $@
	@echo '</H1>' >> $@
	@echo '<P>The following source files are available:</P>' >> $@
	@echo '<UL>' >> $@
	@for i in ${SOURCES} ; do			\
		echo "  <LI><A HRef='$$i'>$$i</A></LI>" >> $@ ;	\
		done
	@echo '</UL>' >> $@
	@echo '<HR>' >> $@
	@echo '<Address>' >> $@
	@echo '<A HRef="../../../copyright.html">' >> $@
	@echo 'Copyright</A> (c) 1998 by' >> $@
	@echo '<A HRef="../../../gramlich.html">' >> $@
	@echo 'Wayne Gramlich</A> All rights reserved.' >> $@
	@echo '</Address>' >> $@
	@echo '</Body>' >> $@
	@echo '</HTML>' >> $@
	@echo "Done"


