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

main_target: check

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

PROGS=	\
	double_underscore \
	duplicate_call \
	inf_recursion_lambda \
	infinite_recursion \
	missing_if \
	pragma_source_file \
	simple_code \
	singleton_test \
	unused_args_test \
	unused_import

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

# some files need to be compiled with special options

MCFLAGS = $(MCFLAGS-$*) $(EXTRA_MCFLAGS)

MCFLAGS-duplicate_call		= --warn-duplicate-calls
MCFLAGS-unused_args_test	= --warn-unused-args
MCFLAGS-unused_import		= --warn-interface-imports

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

%.res:	%.exp %.err
	-rm -f $@
	diff -c $*.exp $*.err > $@

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

DEPENDS=$(PROGS:%=%.depend)
ERRS=	$(PROGS:%=%.err)
RESS=	$(PROGS:%=%.res)

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

depend:	$(DEPENDS)

check:	$(ERRS) $(RESS)

all:	$(PROGS)

clean:	clean_err clean_res

clean_mc: clean_c clean_o clean_err clean_res

clean_err:
	rm -f *.err

clean_res:
	rm -f *.res

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