Files
mercury/tests/Mmake.common
Mark Brown 784dc26cab Fix bugs that were stopping *.res and *.out files being cleaned up properly.
Estimated hours taken: 0.5

Fix bugs that were stopping *.res and *.out files being cleaned up properly.

tests/Mmake.common:
tests/general/accumulator/Mmakefile:
tests/invalid/Mmakefile:
tests/misc_tests/Mmakefile:
tests/tabling/Mmakefile:
tests/term/Mmakefile:
tests/valid/Mmakefile:
tests/warnings/Mmakefile:
	Make cleaning tasks depend on (real)clean_local rather than
	(real)clean.  This is because tests/startup and tests/shutdown
	use the *_local targets.

tests/general/Mmakefile:
	Fix bugs in the recursive mmake calls.
1999-07-14 17:04:41 +00:00

75 lines
2.0 KiB
Plaintext

#-----------------------------------------------------------------------------#
#
# Note: Mmake lets you override MCFLAGS for a particular file by setting
# MCFLAGS-foo. Similarly, you can override GRADEFLAGS for a particular
# file by setting both GRADEFLAGS-foo and (for compiling the foo_init.c
# file) GRADEFLAGS-foo_init.
#
# override this with `mmake HAVE_NUPROLOG=yes'
# if you want to rebuild the `.exp' files.
HAVE_NUPROLOG=no
DIFF_OPTS=-c
#-----------------------------------------------------------------------------#
# .PRECIOUS: %.mod %.c %.o %_init.c %.no %.nu %_init.nl %_init.no
%_init.c: Entry
%.out: %
{ [ -f $*.inp ] && cat $*.inp; } | ./$< > $@ 2>&1;
#
# For some test cases, there is more than one valid output.
# We try matching the output with the `.exp' file, and if that
# doesn't succeed, and there is a `.exp2' file, then we try matching
# against that too.
#
%.res: %.exp %.out
-rm -f $@
diff $(DIFF_OPTS) $*.exp $*.out > $@ || \
{ [ -f $*.exp2 ] && diff $(DIFF_OPTS) $*.exp2 $*.out > $@; }
#-----------------------------------------------------------------------------#
clean_local: clean_out clean_res
clean_mc: clean_c clean_o clean_out clean_res
clean_out:
rm -f *.out
clean_exp:
rm -f *.exp
clean_res:
rm -f *.res
#
# The `foo' targets make `foo_local' in the current directory before
# recursively making `foo' in all subdirectories. The recursive part
# is handled in individual Mmakefiles.
#
.PHONY: check_local dep_local depend_local all_local
.PHONY: check_subdirs dep_subdirs depend_subdirs realclean_subdirs \
clean_subdirs all_subdirs
check: check_local check_subdirs
dep: dep_local dep_subdirs
depend: depend_local depend_subdirs
realclean: realclean_subdirs
clean: clean_subdirs
all: all_local all_subdirs
SUBDIR_MMAKE = mmake \
GRADE='$(GRADE)' \
EXTRA_CFLAGS='$(EXTRA_CFLAGS)' \
EXTRA_MCFLAGS='$(EXTRA_MCFLAGS)'
#-----------------------------------------------------------------------------#