$D2CFLAGS         # added by update-libdirs
    = $d2c_runtime
    . ' -L../../common/collection-extensions'
    . ' -L../../common/table-ext'
    . ' -L../../common/string-ext'
    . ' -L../../common/regular-expressions'
    . ' -L../../common/streams'
    . ' -L../../common/standard-io'
    . ' -L../../common/print'
    . ' -L../../common/format'
    . ' -L../../common/getopt'
    . ' -L.';

if ($features{'compiled_for_win32'}) {
    $c_decl_lid = "win32-vc-decl";
} elsif ($features{'compiled_for_hpux'}) {
    $c_decl_lid = "hp-c-decl";
} elsif ($features{'compiled_for_solaris'}) {
    $c_decl_lid = "solaris-c-decl";
} elsif ($features{'compiled_for_linux'}
         || $features{'compiled_for_beos'}) {
    $c_decl_lid = "linux-c-decl";
} elsif ($features{'compiled_for_cygnus'}) {
    $c_decl_lid = "cygnus-c-decl";
} elsif ($features{'compiled_for_freebsd'}
         || $features{'compiled_for_bsdi'}) { # best guess for bsdi
    $c_decl_lid = "freebsd-c-decl";
} elsif ($features{'compiled_for_netbsd'}) {
    $c_decl_lid = "netbsd-c-decl";
} elsif ($features{'compiled_for_openbsd'}) {
    $c_decl_lid = "openbsd-c-decl";
} elsif ($features{'compiled_for_darwin'}) {
    $c_decl_lid = "macos-decl";
} elsif ($features{'compiled_for_irix'}) {
    $c_decl_lid = "irix-c-decl";
} else {
    &unknown_platform_error();
};

&emit_parsergen_rule('c-parse');

if ($build_tools_with_d2c) {
  &emit_library_rule
      ($c_decl_lid,
       '$(BUILDROOT)/force.timestamp', '',
       'compile'
       );
} else {
  &emit_library_rule
      ($c_decl_lid,
       '$(BUILDROOT)/force.timestamp', '',
       'no-d2c'
       );
};

&emit_parsergen_rule('int-parse');

if ($build_tools_with_d2c) {
  &emit_library_rule
      ('melange',
       '$(BUILDROOT)/force.timestamp melange-c.lib.du', '',
       'compile', 'install'
       );
} else {
  &emit_library_rule
      ('melange',
       '$(BUILDROOT)/force.timestamp', '',
       'no-d2c'
       );
  push(@compile_dependencies, 'melange.dbc');
};

&emit_dbc_link_rule('melange.dbc', 'melange-c-lib.dbc melange-lib.dbc');
