Commits

Andrew Dunstan committed e583ffe

Unbreak MSVC builds after recent Makefile refactoring.

Based on a suggestion by Peter Eisentraut.

  • Participants
  • Parent commits 4816d2e

Comments (0)

Files changed (2)

src/tools/msvc/pgbison.pl

 local $/ = undef;
 $make = <$mf>;
 close($mf);
-my $headerflag = ($make =~ /\$\(BISON\)\s+-d/ ? '-d' : '');
+my $basetarg = basename($output);
+my $headerflag = ($make =~ /^$basetarg:\s+BISONFLAGS\b.*-d/m ? '-d' : '');
 
 system("bison $headerflag $input -o $output");
 exit $? >> 8;

src/tools/msvc/pgflex.pl

 local $/ = undef;
 $make = <$mf>;
 close($mf);
-my $flexflags = ($make =~ /^\s*FLEXFLAGS\s*=\s*(\S.*)/m ? $1 : '');
+my $basetarg = basename($output);
+my $flexflags = ($make =~ /^$basetarg:\s*FLEXFLAGS\s*=\s*(\S.*)/m ? $1 : '');
 
 system("flex $flexflags -o$output $input");
 if ($? == 0)