SUBDIRS = $(glob D, *)

.PHONY: system-test
system-test: $(TJSIM)
    perl harness

.SUBDIRS: $(SUBDIRS)
    # The default main file is the name of the test directory
    MAIN = $(basename $(absname $(CWD)))

    # The default root file can be overriden if the test directory contains
    # a file named root.om with a line "MAIN = xxxx"
    if $(file-exists main.om)
        include main.om
        export

    FILES = $(rootname $(glob *.mod))

    LPProgram($(MAIN), $(FILES))
    system-test: $(MAIN).lp
