#-----------------------------------------------------------------------------# # vim: ts=8 sw=8 noexpandtab ft=make #-----------------------------------------------------------------------------# # # This file is included in the Mmakefile of both ../valid and ../valid_seq. # Both those directories contain test cases for which we check only that # compilation succeeds, and don't test what its result is. The difference # is that in the valid directory, each test file is self-contained and # may be compiled in parallel, while the test cases valid_seq each consist of # more than one module (some separate, some nested), and thus must be compiled # sequentially, without parallelism. # # The Mmakefiles in both directories should define the following make variables # beyond those required by ../Mmake.common. # # AGC_PROGS: # The test cases testing the accurate gc system. # TRAIL_PROGS: # The test cases that only work in trailing grades. # TYPECLASS_PROGS: # The test cases testing the handling of typeclasses. # C_PROGS: # The test cases for which we should only produce a `.c' file. # C_INTERFACE_PROGS: # The test cases that test the operation of the foreign language interface # with C. # SOLVER_PROGS: # The test cases that test the handling of solver type variables. # DEEP_PROF_CAPABLE_PROGS: # The test cases that test compilation with deep profiling enabled. # LLDS_PROGS: # The test cases that require debugging, which hasn't been implemented # for the MLDS backend. # TABLE_PROGS: # The test cases that only work in grades that support tabling. # PAR_CONJ_PROGS: # The test cases that only work in grades that support parallel conjunction. # CTGC_PROGS: # The test cases that only work in grades that support compile-time # garbage collection. Debugging is incompatible with ctgc. # CONSTRAINT_TYPECHECK_PROGS: # Tests that use constraint based type checking. # XXX These are never enabled. # NON_DECLDEBUG_PROGS: # Test that do not work in .decldebug grades # OTHER_PROGS: # All the other test cases. # The agc.* tests don't work in --high-level-code grades, # except hl*.agc*, because they require grade-specific header # files to be installed. ifeq "$(findstring hl,$(GRADE))$(findstring .agc,$(GRADE))" "hl" PROGS1 = $(TYPECLASS_PROGS) $(OTHER_PROGS) else # The agc.* tests don't work in the java or csharp grades. # The agc.* tests also don't work in minimal model grades, # because the collector doesn't scan the copied areas of the stacks. ifneq "$(filter java% csharp%,$(GRADE))$(findstring mm,$(GRADE))" "" PROGS1 = $(TYPECLASS_PROGS) $(OTHER_PROGS) else PROGS1 = $(AGC_PROGS) $(TYPECLASS_PROGS) $(OTHER_PROGS) endif endif ifneq "$(findstring mm,$(GRADE))" "" PROGS2 = $(PROGS1) else ifeq "$(filter java% csharp%,$(GRADE))" "" PROGS2 = $(PROGS1) $(TRAIL_PROGS) else PROGS2 = $(PROGS1) endif endif ifneq "$(filter java% csharp%,$(GRADE))$(findstring profdeep,$(GRADE))" "" PROGS3 = $(PROGS2) else PROGS3 = $(PROGS2) $(TABLE_PROGS) endif ifeq "$(filter hl% java% csharp%,$(GRADE))" "" PROGS4 = $(PROGS3) $(C_INTERFACE_PROGS) $(SOLVER_PROGS) \ $(DEEP_PROF_CAPABLE_PROGS) else PROGS4 = $(PROGS3) endif ifeq "$(filter hl% java% csharp%,$(GRADE))$(findstring par,$(GRADE))" "" PROGS5 = $(PROGS4) $(LLDS_PROGS) else PROGS5 = $(PROGS4) endif ifneq "$(findstring decldebug,$(GRADE))" "" PROGS6 = $(PROGS5) else PROGS6 = $(PROGS5) $(PAR_CONJ_PROGS) endif ifeq "$(findstring debug,$(GRADE))" "" PROGS7 = $(PROGS6) $(CTGC_PROGS) else PROGS7 = $(PROGS6) endif ifeq "$(filter hl% java% csharp%,$(GRADE))$(findstring par,$(GRADE))$(findstring decldebug,$(GRADE))" "" PROGS8 = $(PROGS7) $(NON_DECLDEBUG_PROGS) else PROGS8 = $(PROGS7) endif OBJ_PROGS = $(PROGS8) ifneq "$(findstring tsw,$(GRADE))$(findstring tsc,$(GRADE))" "" PROGS = $(OBJ_PROGS) $(C_PROGS) else PROGS = $(OBJ_PROGS) $(C_PROGS) endif # `mmc --make' doesn't expect subdirectories to appear in targets. ifeq ($(MMAKE_USE_MMC_MAKE),yes) OS_SUBDIR = DLLS_SUBDIR = CLASSES_SUBDIR = else OS_SUBDIR = $(os_subdir) DLLS_SUBDIR = $(dlls_subdir) CLASSES_SUBDIR = $(classes_subdir) endif ifeq ($(findstring csharp,$(GRADE)),csharp) # XXX We should produce DLLs but currently that invokes the IL backend. # XXX The above comment is long obsolete. TARGET_OBJ_EXT = cs TARGET_OBJ_SUBDIR = $(DLLS_SUBDIR) else ifeq ($(findstring java,$(GRADE)),java) TARGET_OBJ_EXT = class TARGET_OBJ_SUBDIR = $(CLASSES_SUBDIR) else TARGET_OBJ_EXT = $(O) TARGET_OBJ_SUBDIR = $(OS_SUBDIR) endif endif OBJS = $(OBJ_PROGS:%=$(TARGET_OBJ_SUBDIR)%.$(TARGET_OBJ_EXT)) #-----------------------------------------------------------------------------# # When compiling using the installed libraries, setting GRADEFLAGS # may cause mgnuc to look for the `.mih' files for a non-installed grade. # test_mercury runs the tests using the installed libraries, so GRADEFLAGS # won't be set, but test_mercury runs the tests in at least one `.tr' grade # on all machines, so it isn't a problem. ifneq ($(origin WORKSPACE),undefined) GRADEFLAGS_TRAIL = --use-trail else GRADEFLAGS_TRAIL = endif # Make sure GRADEFLAGS_TRAIL is passed to `mmc --make'. export GRADEFLAGS_TRAIL 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 $(OBJ_PROGS:%=%.runtest): %.runtest: %.$(TARGET_OBJ_EXT) ; $(C_PROGS:%=%.runtest): %.runtest: %.c ; #-----------------------------------------------------------------------------# objs: $(OBJS) printtests: @echo $(PROGS) printobjs: @echo $(OBJS) clean_local: clean_valid clean_valid: rm -f *.err *.h #-----------------------------------------------------------------------------#