]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Use nmake's inline file creation to automate .rsp files.
authorSimon Tatham <anakin@pobox.com>
Sun, 29 Nov 2015 08:39:50 +0000 (08:39 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 16 Dec 2015 18:46:38 +0000 (18:46 +0000)
This is noticeably faster than a sequence of 'echo' commands, because
the file gets created all in one go. The most natural approach to this
job would also hide the file's contents, but doing it this way with a
'type' command lets me see the file on nmake's standard output, so
that the build log should still contain everything useful for
debugging build problems.

mkfiles.pl

index 59ecfdc4952b6a033e55287cecf062e66b8f268e..683f4b1d1e69dcd087ad57d15f1f9f6d4e93bce7 100755 (executable)
@@ -648,27 +648,25 @@ if (defined $makefiles{'vc'}) {
     foreach $p (&prognames("G:C")) {
        ($prog, $type) = split ",", $p;
        $objstr = &objects($p, "X.obj", "X.res", undef);
-       print &splitline("$prog.exe: " . $objstr . " $prog.rsp"), "\n";
-       print "\tlink \$(LFLAGS) \$(XLFLAGS) -out:$prog.exe -map:$prog.map \@$prog.rsp\n\n";
-    }
-    foreach $p (&prognames("G:C")) {
-       ($prog, $type) = split ",", $p;
-       print $prog, ".rsp: \$(MAKEFILE)\n";
+       print &splitline("$prog.exe: " . $objstr), "\n";
+
        $objstr = &objects($p, "X.obj", "X.res", "X.lib");
+       $subsys = ($type eq "G") ? "windows" : "console";
+        $inlinefilename = "link_$prog";
+        print "\ttype <<$inlinefilename\n";
        @objlist = split " ", $objstr;
        @objlines = ("");
        foreach $i (@objlist) {
-           if (length($objlines[$#objlines] . " $i") > 50) {
+           if (length($objlines[$#objlines] . " $i") > 72) {
                push @objlines, "";
            }
            $objlines[$#objlines] .= " $i";
        }
-       $subsys = ($type eq "G") ? "windows" : "console";
-       print "\techo /nologo /subsystem:$subsys > $prog.rsp\n";
        for ($i=0; $i<=$#objlines; $i++) {
-           print "\techo$objlines[$i] >> $prog.rsp\n";
+           print "$objlines[$i]\n";
        }
-       print "\n";
+       print "<<\n";
+       print "\tlink \$(LFLAGS) \$(XLFLAGS) -out:$prog.exe -map:$prog.map -nologo -subsystem:$subsys \@$inlinefilename\n\n";
     }
     foreach $d (&deps("X.obj", "X.res", $dirpfx, "\\", "vc")) {
         $extradeps = $forceobj{$d->{obj_orig}} ? ["*.c","*.h","*.rc"] : [];