Files
mercury/tests/warnings/Mmakefile
Peter Wang 524f4d72e2 Delete references to Erlang backend in makefiles.
Mmake.workspace:
Mmakefile:
*/Mmakefile:
tests/*/Mmakefile:
tests/valid/Mmake.valid.common:
trace/Mmakefile:
    As above.
2020-10-27 11:10:11 +11:00

142 lines
3.6 KiB
Makefile

#-----------------------------------------------------------------------------#
# vim: ts=8 sw=8 noexpandtab ft=make
#-----------------------------------------------------------------------------#
TESTS_DIR = ..
THIS_DIR = warnings
MAYBE_J1 =
#-----------------------------------------------------------------------------#
COMPILE_PROGS = \
arg_order_rearrangment \
foreign_term_invalid \
non_term_user_special \
pragma_term_conflict \
term_indirect_warning \
warn_dead_procs \
warn_dead_procs_trace
ERRORCHECK_PROGS = \
ambiguous_overloading \
bug311 \
bug412 \
bug477 \
det_infer_warning \
double_underscore \
duplicate_call \
duplicate_const \
gh85 \
inconsistent_pred_order \
inf_recursion_lambda \
inference_test \
infinite_recursion \
inst_with_no_type \
missing_if \
non_contiguous_decls \
non_stratification \
occurs \
pragma_source_file \
purity_warnings \
save \
simple_code \
singleton_test \
singleton_test_state_var \
spurious_obsolete \
state_vars_test \
suspicious_foreign_code \
suspicious_recursion \
table_with_inline \
unify_f_g \
unify_x_f_x \
unknown_warning \
unsigned_zero_cmp \
unused_args_test \
unused_import \
unused_interface_import \
warn_contiguous_foreign \
warn_non_contiguous \
warn_non_contiguous_foreign \
warn_non_contiguous_foreign_group \
warn_return \
warn_self_import \
warn_stubs \
warn_succ_ind
# We don't yet pass (or even have a .exp file for) these tests.
# missing_singleton_warning
# trace_goal_dupl_defn
#
ifeq ($(MMAKE_USE_MMC_MAKE),yes)
ERRORCHECK_PROGS += unused_args_analysis
endif
PROGS = $(COMPILE_PROGS) $(ERRORCHECK_PROGS) up_to_date
TESTS = $(sort $(PROGS))
include ../Mmake.common
# Module-specific options should go in Mercury.options so they
# can be found by `mmc --make'.
include Mercury.options
# With `mmc --make', the errors should only go to the
# `.err' files, not stderr.
MCFLAGS += --output-compile-error-lines 0
MCFLAGS += --infer-all
$(COMPILE_PROGS:%=%.runtest): %.runtest: %.res_compile ;
$(ERRORCHECK_PROGS:%=%.runtest): %.runtest: %.res_error ;
# Build the `.analysis' file for unused_args_analysis2
# before building unused_args_analysis.c.
unused_args_analysis.c: unused_args_analysis2.c
unused_args_analysis.err: unused_args_analysis.c
# Check that `mmc --make up_to_date.m' generates a warning.
up_to_date.runtest:
$(MCM) up_to_date.m > up_to_date.err_make 2>&1
diff $(DIFF_OPTS) up_to_date.exp up_to_date.err_make \
> up_to_date.res_make || \
{ cat up_to_date.err_make; cat up_to_date.res_make; exit 1; }
#-----------------------------------------------------------------------------#
%.res_error: %.exp %.err
-rm -f $@
diff $(DIFF_OPTS) $*.exp $*.err > $@ || \
{ [ -f $*.exp2 ] && \
diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \
{ [ -f $*.exp3 ] && \
diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \
{ [ -f $*.exp4 ] && \
diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \
{ cat $*.err; cat $@; exit 1; }
%.res_compile: %.exp %.c
-rm -f $@
diff $(DIFF_OPTS) $*.exp $*.err > $@ || \
{ [ -f $*.exp2 ] && \
diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \
{ [ -f $*.exp3 ] && \
diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \
{ [ -f $*.exp4 ] && \
diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \
{ cat $*.err; cat $@; exit 1; }
ifeq ($(MMAKE_USE_MMC_MAKE),yes)
%.c: %.m
$(MCM) $@ 2>&1 | grep -v "^Making" > $*.err
endif
#-----------------------------------------------------------------------------#
clean_local: clean_err clean_res
clean_err:
rm -f *.err up_to_date.err_make
#-----------------------------------------------------------------------------#