
&makegen_include("../common-Makegen");
@potential_targets
    = &d2c_library('Main', 
		   '-L../base -L../front -L../optimize -L../parser '
		   . '-L../convert -L../cback');

&emit_dbc_link_rule
    ('d2c.dbc', 
     '../base/compiler-base-lib.dbc ../front/compiler-front-lib.dbc'
     . ' ../optimize/compiler-optimize-lib.dbc '
     . ' ../parser/compiler-parser-lib.dbc ../convert/compiler-convert-lib.dbc'
     . ' ../cback/compiler-cback-lib.dbc compiler-main-lib.dbc');

if ($stage2) {
    &install_executable($bindir, $potential_targets[0]);
} else {
    push(@compile_dependencies, 'd2c.dbc');
}

open(FILELOC,">$srcdir/file-locations.dylan");

## double any backslashes that might for some reason appear in the destdir.
$munged_destdir = $default_DYLANDIR || $destdir;
$munged_destdir =~ s/\\/\\\\/g;
print FILELOC <<"EOF"
Module: main
Note: this file is generated by gen-makefile from Makegen

define constant \$default-dylan-dir = "$munged_destdir";
define constant \$default-target-name = #"$target_name";
EOF
;

close(FILELOC);
