# ======================================================================
# This Amiga Makefile runs the makeindex on several test files, *.idx.
# The output from each file foo.* is compared with correct output saved
# in files ok-foo.*.  As new bugs are discovered and fixed, test files
# that exhibit them should be incorporated in this directory.
# [01-Apr-1994]
#
# ======================================================================

FILES		=	b209a b209b b209c b209d b209e b209f \
			b211a b211d b211e b211f b211g b211h \
			book test tort

# These files have private MakeIndex styles (*.ist) with the same base name
# The German ones must be run with -g

GERMAN_FILES	=	b211b

STYLE_FILES	=	b210a b211c

MAKEINDEX	=	makeindex

RM		=	delete

all:	
	@echo "==================================================================="
	@echo "If makeindex has compiled correctly, there should be no differences"
	@echo "output by these tests, except possibly in the version lines"
	@echo "in the *.ilg files."
	@echo "==================================================================="

	@echo  "*N=================================================="
	@echo  "Test file = b209a*N"
	$(MAKEINDEX) b209a
	@echo "Comparing ok-b209a.ind b209a.ind"
	@diff ok-b209a.ind b209a.ind >>amigadiffs.txt
	@echo Comparing ok-b209a.ilg b209a.ilg
	@diff ok-b209a.ilg b209a.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b209b*N"
	$(MAKEINDEX) b209b
	@echo "Comparing ok-b209b.ind b209b.ind"
	@diff ok-b209b.ind b209b.ind >>amigadiffs.txt
	@echo "Comparing ok-b209b.ilg b209b.ilg"
	@diff ok-b209b.ilg b209b.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b209c*N"
	$(MAKEINDEX) b209c
	@echo "Comparing ok-b209c.ind b209c.ind"
	@diff ok-b209c.ind b209c.ind >>amigadiffs.txt
	@echo "Comparing ok-b209c.ilg b209c.ilg"
	@diff ok-b209c.ilg b209c.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b209d*N"
	$(MAKEINDEX) b209d
	@echo "Comparing ok-b209d.ind b209d.ind"
	@diff ok-b209d.ind b209d.ind >>amigadiffs.txt
	@echo "Comparing ok-b209d.ilg b209d.ilg"
	@diff ok-b209d.ilg b209d.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b209e*N"
	$(MAKEINDEX) b209e
	@echo "Comparing ok-b209e.ind b209e.ind"
	@diff ok-b209e.ind b209e.ind >>amigadiffs.txt
	@echo "Comparing ok-b209e.ilg b209e.ilg"
	@diff ok-b209e.ilg b209e.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b209f*N"
	$(MAKEINDEX) b209f
	@echo "Comparing ok-b209f.ind b209f.ind"
	@diff ok-b209f.ind b209f.ind >>amigadiffs.txt
	@echo "Comparing ok-b209f.ilg b209f.ilg"
	@diff ok-b209f.ilg b209f.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b211a*N"
	$(MAKEINDEX) b211a
	@echo "Comparing ok-b211a.ind b211a.ind"
	@diff ok-b211a.ind b211a.ind >>amigadiffs.txt
	@echo "Comparing ok-b211a.ilg b211a.ilg"
	@diff ok-b211a.ilg b211a.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b211d*N"
	$(MAKEINDEX) b211d
	@echo "Comparing ok-b211d.ind b211d.ind"
	@diff ok-b211d.ind b211d.ind >>amigadiffs.txt
	@echo "Comparing ok-b211d.ilg b211d.ilg"
	@diff ok-b211d.ilg b211d.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b211e*N"
	$(MAKEINDEX) b211e
	@echo "Comparing ok-b211e.ind b211e.ind"
	@diff ok-b211e.ind b211e.ind >>amigadiffs.txt
	@echo "Comparing ok-b211e.ilg b211e.ilg"
	@diff ok-b211e.ilg b211e.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b211f*N"
	$(MAKEINDEX) b211f
	@echo "Comparing ok-b211f.ind b211f.ind"
	@diff ok-b211f.ind b211f.ind >>amigadiffs.txt
	@echo "Comparing ok-b211f.ilg b211f.ilg"
	@diff ok-b211f.ilg b211f.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b211g*N"
	$(MAKEINDEX) b211g
	@echo "Comparing ok-b211g.ind b211g.ind"
	@diff ok-b211g.ind b211g.ind >>amigadiffs.txt
	@echo "Comparing ok-b211g.ilg b211g.ilg"
	@diff ok-b211g.ilg b211g.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b211h*N"
	$(MAKEINDEX) b211h
	@echo "Comparing ok-b211h.ind b211h.ind"
	@diff ok-b211h.ind b211h.ind >>amigadiffs.txt
	@echo "Comparing ok-b211h.ilg b211h.ilg"
	@diff ok-b211h.ilg b211h.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = book*N"
	$(MAKEINDEX) book
	@echo "Comparing ok-book.ind book.ind"
	@diff ok-book.ind book.ind >>amigadiffs.txt
	@echo "Comparing ok-book.ilg book.ilg" >>amigadiffs.txt
	@diff ok-book.ilg book.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = test*N"
	$(MAKEINDEX) test
	@echo "Comparing ok-test.ind test.ind"
	@diff ok-test.ind test.ind >>amigadiffs.txt
	@echo "Comparing ok-test.ilg test.ilg"
	@diff ok-test.ilg test.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = tort*N"
	$(MAKEINDEX) tort
	@echo "Comparing ok-tort.ind tort.ind"
	@diff ok-tort.ind tort.ind >>amigadiffs.txt
	@echo "Comparing ok-tort.ilg ok-tort.ilg"
	@diff ok-tort.ilg tort.ilg >>amigadiffs.txt

	@echo "==================================================================="

	@echo  "*N=================================================="
	@echo  "Test file = b211b (German sort option) *N"
	$(MAKEINDEX) -s b211b.ist -g b211b
	@echo "Comparing ok-b211b.ind b211b.ind"
	@diff ok-b211b.ind b211b.ind >>amigadiffs.txt
	@echo "Comparing ok-b211b.ilg b211b.ilg"
	@diff ok-b211b.ilg b211b.ilg >>amigadiffs.txt

	@echo "==================================================================="

	@echo  "*N=================================================="
	@echo  "Test file = b210a (Private style file) *N"
	$(MAKEINDEX) -s b210a.ist b210a
	@echo "Comparing ok-b210a.ind b210a.ind"
	@diff ok-b210a.ind b210a.ind >>amigadiffs.txt
	@echo "Comparing ok-b210a.ilg b210a.ilg"
	@diff ok-b210a.ilg b210a.ilg >>amigadiffs.txt

	@echo  "*N=================================================="
	@echo  "Test file = b211c (Private style file) *N"
	$(MAKEINDEX) -s b211c.ist b211c
	@echo "Comparing ok-b211c.ind b211c.ind"
	@diff ok-b211c.ind b211c.ind >>amigadiffs.txt
	@echo "Comparing ok-b211c.ilg b211c.ilg"
	@diff ok-b211c.ilg b211c.ilg >>amigadiffs.txt

	@echo "==================================================================="
	@echo "see the amigadiffs.txt file for the differences"

clean mostlyclean:
	$(RM) b2???.ind b2???.ilg book.ind book.ilg test.ind test.ilg \
              tort.ind tort.ilg amigadiffs.txt

clobber distclean realclean reallyclean veryclean:	clean
