
$D2C = '$(BUILDROOT)/d2c/compiler/main/d2c';

$D2CFLAGS = $d2c_runtime . '-p$(SRCROOT)/d2c/compiler/platforms.descr -L../common/streams -L../common/standard-io -L../common/print -L../common/format -L../d2c/runtime/random -L. -L../common/coll-ext -L../common/string-ext -L../common/table-ext -L../common/format-out -L../common/itime -L../common/regexp -L../common/matrix -L../common/time -L../common/getopt -L../d2c/runtime/melange';

$shared = 0;

do emit_library_rule(
    'dylan-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
do emit_library_rule(
    'regexp-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
do emit_library_rule(
    'stream-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
do emit_library_rule(
    'table-ext-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
do emit_library_rule(
    'random-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
do emit_library_rule(
    'matrix-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
do emit_library_rule(
    'coll-ext-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
do emit_library_rule(
    'print-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
do emit_library_rule(
    'format-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
do emit_library_rule(
    'format-out-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);
#do emit_library_rule(
#    'itime-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
#);
do emit_library_rule(
    'getopt-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
);

unless ($features{'no_time'}) { 
	do emit_library_rule(
	    'time-test', '$(BUILDROOT)/force.timestamp', '', 'compile', 'compile-mindy'
	);
}

print <<"EOF"

DYLANPATH=../common/transcendental:../mindy/libraries/dylan:../common/coll-ext:../common/table-ext:../common/string-ext:../common/standard-io:../common/streams:../mindy/libraries/random:../common/print:../common/format:../common/matrix::../common/format-out:../common/time:../common/regexp:../common/getopt

EOF
;

if ($features{compiled_for_win32}) {
    $run_mindy = 'set DYLANPATH=$(DYLANPATH) && $(MINDY)';
} else {
    $run_mindy = 'DYLANPATH=$(DYLANPATH); export DYLANPATH ; $(MINDY)';
}
    
# I only wrote this function because of the .\ for win32 vs. ./ for
# Unix issue.
sub emit_run_tests_rule {
    local (@tests) = @_;
    local ($test);
    print "run_tests : ";
    foreach $test (@tests) {
	print "$test$dot_exe " if ($enable_d2c);
	print "$test-lib.dbc " if ($enable_mindy);
    }
    print "\n";

    foreach $test (@tests) {
	local ($test) = &convert_path_separator("./$test");
	print "\t$run_mindy -f $test-lib.dbc\n" if ($enable_mindy);
	print "\t$test\n" if ($enable_d2c);
    }
    push(@compile_dependencies, "run_tests");
}

do emit_run_tests_rule('dylan-test', 'regexp-test', 'stream-test', 
		       'table-ext-test', 'random-test', 'matrix-test', 
		       'coll-ext-test', 'print-test', 'format-test', 
		       'format-out-test');
# time-test removed because it is broken.
