#-----------------------------------------------------------------------------#
# Copyright (C) 1997-2000, 2003-2004, 2011 The University of Melbourne.
# This file may only be copied under the terms of the GNU Library General
# Public License - see the file COPYING.LIB in the Mercury distribution.
#-----------------------------------------------------------------------------#

MAIN_TARGET = all

# We need to use a grade with trailing
GRADEFLAGS += --use-trail --trail-segments

EXTRA_LIB_DIRS = $(INSTALL_PREFIX)/extras/lib/mercury
EXTRA_LIBRARIES = global

#-----------------------------------------------------------------------------#

PROGS	=	ref_test glob_test glob_test_2

DEPENDS =	$(PROGS:%=%.depend)
CS	=	$(PROGS:%=%.c)
RESS	=	$(PROGS:%=%.res)

#-----------------------------------------------------------------------------#

$(PROGS): ../global.init

%.out: %
	./$< > $@ 2>&1;

%.res: %.exp %.out
	diff -c $*.exp $*.out > $@

#-----------------------------------------------------------------------------#

.PHONY: depend
depend: $(DEPENDS)

.PHONY: all
all: $(PROGS)

.PHONY: check
check: $(RESS)

.PHONY: cs
cs: $(CS)

.PHONY: clean_local
clean_local:
	rm -f *.out *.res

#-----------------------------------------------------------------------------#
