X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c1b71b1c52473fefe61d9263689ce423ec6d4818..HEAD:/mkfiles.pl diff --git a/mkfiles.pl b/mkfiles.pl index 830de491..a8574bfc 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -46,7 +46,7 @@ open IN, "Recipe" or do { # HACK: One of the source files in `charset' is auto-generated by # sbcsgen.pl. We need to generate that _now_, before attempting # dependency analysis. -eval 'chdir "charset"; require "sbcsgen.pl"; chdir ".."'; +eval 'chdir "charset"; require "sbcsgen.pl"; chdir ".."; select STDOUT;'; @srcdirs = ("./"); @@ -88,7 +88,9 @@ while () { } if ($_[0] eq "!forceobj") { $forceobj{$_[1]} = 1; next; } if ($_[0] eq "!begin") { - if (&mfval($_[1])) { + if ($_[1] =~ /^>(.*)/) { + $divert = \$auxfiles{$1}; + } elsif (&mfval($_[1])) { $sect = $_[2] ? $_[2] : "end"; $divert = \($makefile_extra{$_[1]}->{$sect}); } else { @@ -145,6 +147,12 @@ while () { close IN; +foreach $aux (sort keys %auxfiles) { + open AUX, ">$aux"; + print AUX $auxfiles{$aux}; + close AUX; +} + # Now retrieve the complete list of objects and resource files, and # construct dependency data for them. While we're here, expand the # object list for each program, and complain if its type isn't set. @@ -425,7 +433,7 @@ if (defined $makefiles{'cygwin'}) { ##-- CygWin makefile open OUT, ">$makefiles{'cygwin'}"; select OUT; print - "# Makefile for $project_name under cygwin.\n". + "# Makefile for $project_name under Cygwin, MinGW, or Winelib.\n". "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n". "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n"; # gcc command line option is -D not /D @@ -445,7 +453,7 @@ if (defined $makefiles{'cygwin'}) { "# RCINC = --include-dir c:\\cygwin\\include\\\n". "\n". &splitline("CFLAGS = -mno-cygwin -Wall -O2 -D_WINDOWS -DDEBUG -DWIN32S_COMPAT". - " -D_NO_OLDNAMES -DNO_MULTIMON -DNO_HTMLHELP " . + " -D_NO_OLDNAMES -DNO_MULTIMON -DNO_HTMLHELP -DNO_SECUREZEROMEMORY " . (join " ", map {"-I$dirpfx$_"} @srcdirs)) . "\n". "LDFLAGS = -mno-cygwin -s\n". @@ -476,7 +484,7 @@ if (defined $makefiles{'cygwin'}) { join " ", @{$d->{deps}})), "\n"; } if ($d->{obj} =~ /\.res\.o$/) { - print "\t\$(RC) \$(RCFL) \$(RCFLAGS) ".$d->{deps}->[0]." ".$d->{obj}."\n\n"; + print "\t\$(RC) \$(RCFL) \$(RCFLAGS) ".$d->{deps}->[0]." -o ".$d->{obj}."\n\n"; } else { print "\t\$(CC) \$(COMPAT) \$(CFLAGS) \$(XFLAGS) -c ".$d->{deps}->[0]."\n\n"; } @@ -484,7 +492,7 @@ if (defined $makefiles{'cygwin'}) { print "\n"; print $makefile_extra{'cygwin'}->{'end'}; print "\nclean:\n". - "\trm -f *.o *.exe *.res.o *.map\n". + "\trm -f *.o *.exe *.res.o *.so *.map\n". "\n". "FORCE:\n"; select STDOUT; close OUT; @@ -1147,7 +1155,10 @@ if (defined $makefiles{'am'}) { $objtosrc{$d->{obj}} = $d->{deps}->[0]; } - @amcflags = ("\$(COMPAT)", "\$(XFLAGS)", map {"-I$dirpfx$_"} @srcdirs); + print &splitline(join " ", "AM_CPPFLAGS", "=", + map {"-I$dirpfx$_"} @srcdirs), "\n"; + + @amcflags = ("\$(COMPAT)", "\$(XFLAGS)", "\$(WARNINGOPTS)"); print "if HAVE_GTK\n"; print &splitline(join " ", "AM_CFLAGS", "=", "\$(GTK_CFLAGS)", @amcflags), "\n";