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

THIS_DIR = general/accumulator

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

# Any program added here should also be added to the `.cvsignore' file.

ACCUMULATOR_PROGS= \
		base		\
		call_in_base	\
		chain		\
		commutative	\
		construct_test	\
		deconstruct_test\
		dcg		\
		disj		\
		func		\
		highorder	\
		heuristic	\
		identity	\
		inter		\
		ite		\
		nonrec		\
		out_to_in	\
		qsort		\
		simple		\
		split		\
		swap

# We currently don't do any testing in grade java on this directory.
ifneq "$(findstring java,$(GRADE))" ""
	PROGS=
else
	PROGS=$(ACCUMULATOR_PROGS)
endif


SUBDIRS=
TESTS = $(PROGS)
TESTS_DIR=../..
include $(TESTS_DIR)/Mmake.common

# Module-specific options should go in Mercury.options so they
# can be found by `mmc --make'.
include Mercury.options

%.runtest: %.res ;

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

ACC_FLAGS = -d accum --introduce-accumulators --optimize-constructor-last-call \
		--intermodule-optimization

	# Optimizations to turn off/on.
	# Deforestation optimizes away the opportunities for accumulator
	# introduction in many of the test cases, so turn it off.
OPT_FLAGS = --trace-optimized --excess-assign --common-struct \
		--no-deforestation

	# Ensure that the accumulator introduction flags are passed
	# after EXTRA_MCFLAGS, so that we can override things set in
	# EXTRA_MCFLAGS.
ALL_MCFLAGS += $(OPT_FLAGS) $(ACC_FLAGS)

    # programs which aren't working.
NOT_WORKING =

EXPS=	$(PROGS:%=%.exp)

exp:	$(EXPS)

realclean_local: clean_hlds_dump

clean_hlds_dump:
	-rm -f *hlds_dump*

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