+"\t-del *.obj\n".
+"\t-del *.exe\n".
+"\t-del *.res\n".
+"\t-del *.pch\n".
+"\t-del *.aps\n".
+"\t-del *.il*\n".
+"\t-del *.pdb\n".
+"\t-del *.rsp\n".
+"\t-del *.tds\n".
+"\t-del *.\$\$\$\$\$\$\n";
+select STDOUT; close OUT;
+
+##-- Visual C++ makefile
+open OUT, ">Makefile.vc"; select OUT;
+print
+"# Makefile for PuTTY under Visual C.\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";
+print $help;
+print
+"\n".
+"# If you rename this file to `Makefile', you should change this line,\n".
+"# so that the .rsp files still depend on the correct makefile.\n".
+"MAKEFILE = Makefile.vc\n".
+"\n".
+"# C compilation flags\n".
+"CFLAGS = /nologo /W3 /O1 /D_WINDOWS /D_WIN32_WINDOWS=0x401 /DWINVER=0x401\n".
+"LFLAGS = /incremental:no /fixed\n".
+"\n".
+".c.obj:\n".
+"\tcl \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) /c \$*.c\n".
+".rc.res:\n".
+"\trc \$(FWHACK) \$(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 \$*.rc\n".
+"\n";
+print &splitline("all:" . join "", map { " $_.exe" } &prognames("GC"));
+print "\n\n";
+foreach $p (&prognames("GC")) {
+ $objstr = &objects($p, "X.obj", "X.res", undef);
+ print &splitline("$p.exe: " . $objstr . " $p.rsp"), "\n";
+ print "\tlink \$(LFLAGS) -out:$p.exe -map:$p.map \@$p.rsp\n\n";
+}
+foreach $p (&prognames("GC")) {
+ print $p, ".rsp: \$(MAKEFILE)\n";
+ $objstr = &objects($p, "X.obj", "X.res", "X.lib");
+ @objlist = split " ", $objstr;
+ @objlines = ("");
+ foreach $i (@objlist) {
+ if (length($objlines[$#objlines] . " $i") > 50) {
+ push @objlines, "";
+ }
+ $objlines[$#objlines] .= " $i";
+ }
+ $subsys = ($types{$p} eq "G") ? "windows" : "console";
+ print "\techo /nologo /subsystem:$subsys > $p.rsp\n";
+ for ($i=0; $i<=$#objlines; $i++) {
+ print "\techo$objlines[$i] >> $p.rsp\n";
+ }
+ print "\n";
+}
+&deps("X.obj", "X.res", "", "\\");
+print
+"\n".
+"# Hack to force version.o to be rebuilt always\n".
+"version.obj: *.c *.h *.rc\n".
+"\tcl \$(FWHACK) \$(VER) \$(CFLAGS) /c version.c\n\n".
+"clean: tidy\n".
+"\t-del *.exe\n\n".
+"tidy:\n".
+"\t-del *.obj\n".
+"\t-del *.res\n".
+"\t-del *.pch\n".
+"\t-del *.aps\n".
+"\t-del *.ilk\n".
+"\t-del *.pdb\n".
+"\t-del *.rsp\n".
+"\t-del *.dsp\n".
+"\t-del *.dsw\n".
+"\t-del *.ncb\n".
+"\t-del *.opt\n".
+"\t-del *.plg\n".
+"\t-del *.map\n".
+"\t-del *.idb\n".
+"\t-del debug.log\n";
+select STDOUT; close OUT;
+
+##-- X/GTK/Unix makefile
+open OUT, ">unix/Makefile.gtk"; select OUT;
+print
+"# Makefile for PuTTY under X/GTK and Unix.\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
+($_ = $help) =~ s/=\/D/=-D/gs;
+print $_;
+print
+"\n".
+"# You can define this path to point at your tools if you need to\n".
+"# TOOLPATH = /opt/gcc/bin\n".
+"CC = \$(TOOLPATH)cc\n".
+"\n".
+&splitline("CFLAGS = -Wall -g -I. -I.. `gtk-config --cflags`")."\n".
+"LDFLAGS = `gtk-config --libs`\n".
+"\n".
+".SUFFIXES:\n".
+"\n".
+"%.o:\n".
+"\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) -c \$<\n".
+"\n";
+print &splitline("all:" . join "", map { " $_" } &prognames("X"));
+print "\n\n";
+foreach $p (&prognames("X")) {
+ $objstr = &objects($p, "X.o", undef, undef);
+ print &splitline($p . ": " . $objstr), "\n";
+ $libstr = &objects($p, undef, undef, "-lX");
+ print &splitline("\t\$(CC)" . $mw . " \$(LDFLAGS) -o \$@ " .
+ $objstr . " $libstr", 69), "\n\n";
+}
+&deps("X.o", undef, "../", "/");
+print
+"\n".
+"version.o: FORCE;\n".
+"# Hack to force version.o to be rebuilt always\n".
+"FORCE:\n".
+"\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) \$(VER) -c version.c\n".
+"clean:\n".
+"\trm -f *.o *.exe\n".
+"\n";