Another bit on this subject; spent a good bit of time poking at the 
.dsp files.

        Seems to make sense to have both the "Output_Dir" and "Intermediate_Dir"
        settings in *.dsp to be modified similarly.

        I'd recommend for Debug builds:

# PROP BASE Output_Dir "Debug\$(ProjectName)_"
# PROP BASE Intermediate_Dir "Debug\$(ProjectName)_"

        ..and for Release builds:

# PROP BASE Output_Dir "Release\$(ProjectName)_"
# PROP BASE Intermediate_Dir "Release\$(ProjectName)_"

        This way both builds behave similarly; all junk for each project ends up
        in either "Release\<PROJECTDIR>_" or "Debug\<ProjectDir>_".
        (Currently, Debug and Release builds behave differently)

        So blowing away those two dirs will always remove project detritus.

        Microsoft documents these two build settings:

* * *
Output Directory

    Specifies the directory where tools such as the linker will place all
    final output files that are created during the build process. Typically,
    this includes the output of tools such as the linker, librarian, or BSCMake.

Intermediate Directory

    Specifies the directory where tools such as the compiler will place
    all intermediate files created during the build process. Typically,
    this includes the output of tools such as the C/C++ compiler, MIDL,
    and the resource compiler.
* * *

        These sound like more or less like the same thing;
        where all the build crap goes.

        I've set all my dsp files similarly with the above, and builds OK
        in parallel mode under VS2008. I'd think VS7 can digest this as well,
        I'll check.

        With these changes, it makes more use of disk space during builds
        because the common files don't get overwritten. But that's bad for
        parallel builds, and would seem to go against MS's design intentions,
        which seem to want to keep these files separate.

        Here's the diff for e.g. "keyboard.dsp" with those changes applied,
        followed by the modified 'fixem' perl script that implements the
        changes to both settings.

______________________________________________________________________

--- keyboard.dsp        (revision 7575)
+++ keyboard.dsp        (working copy)
@@ -33,13 +33,13 @@

 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"                               << old: bad for 
parallel builds, tmp files overwrite
-# PROP BASE Intermediate_Dir "Release"                         << old: ""
+# PROP BASE Output_Dir "Release\$(ProjectName)_"               << new: good 
for parallel builds, tmp files end up in Release\<Project>_\*
+# PROP BASE Intermediate_Dir "Release\$(ProjectName)_"         << new: ""
 # PROP BASE Target_Dir ""
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"                                    << old: same as 
above
-# PROP Intermediate_Dir "Release"                              << old: ""
+# PROP Output_Dir "Release\$(ProjectName)_"                    << new: ""
+# PROP Intermediate_Dir "Release\$(ProjectName)_"              << new: ""
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX 
/FD /c
 @@ -60,13 +60,13 @@

 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "keyboard_"                             << old: OK for 
parallel, but creates many dirs in ide\VisualC6\*
-# PROP BASE Intermediate_Dir "keyboard_"                       << old: ""
+# PROP BASE Output_Dir "Debug\$(ProjectName)_"                 << new: OK for 
parallel, creates all the dirs under ide\VisualC6\[Release/Debug]\*
+# PROP BASE Intermediate_Dir "Debug\$(ProjectName)_"           << new: ""
 # PROP BASE Target_Dir ""
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries 1
-# PROP Output_Dir "keyboard_"                                  << old: same as 
above
-# PROP Intermediate_Dir "keyboard_"                            << old: ""
+# PROP Output_Dir "Debug\$(ProjectName)_"                      << new: ""
+# PROP Intermediate_Dir "Debug\$(ProjectName)_"                << new: ""
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D 
"_WINDOWS" /YX /FD /c
______________________________________________________________________

#!/usr/bin/perl -w
use strict;
#
# Fix FLTK's ide/VisualC/*.dsp files for parallel builds
# erco 2.00 05/01/2010
#
my $outdir = "./new-dsp";
if ( ! -d $outdir ) {
   unless(mkdir($outdir)) { die "mkdir($outdir): $!\n"; }
}
foreach my $dsp ( glob("*.dsp") ) {
   my $modedir = "";
   print STDERR "-- Reading $dsp, Writing $outdir/$dsp\n";
   unless (open(DSP, "<$dsp")) { die "$dsp: $!\n"; }
   unless (open(OUT, ">$outdir/$dsp")) { die "$outdir/$dsp: $!\n"; }
   while (<DSP>) {
       s/[\r\n]*//g;
       # DETECT RELEASE/DEBUG MODE
       #     Empirical evidence shows that the "Use_Debug_Libraries" line
       #     has a 0 or 1 value that defines the build mode (release|debug)
       #     for the "Intermediate_Dir" and "Output_Dir" lines that follow it, 
e.g.:
       #
       #     # PROP Use_Debug_Libraries [0|1]    <-- sets mode for lines that 
follow
       #     # PROP Output_Dir ".."
       #     # PROP Intermediate_Dir "[Release|Debug]\$(ProjectName)"
       #
       if ( /Use_Debug_Libraries\s+0/ ) { $modedir = "Release"; }
       if ( /Use_Debug_Libraries\s+1/ ) { $modedir = "Debug"; }
       # CHANGE "INTERMEDIATE DIR" ACCORDING TO BUILD MODE
       if ( $_ =~ /Intermediate_Dir/ ) {
           my $before = $_;
           $_ =~ s%Intermediate_Dir.*%Intermediate_Dir 
"$modedir\\\$(ProjectName)_"%;
           my $after = $_;
           printf(STDERR "%30s: %-50s %s\n", $dsp, $before, $after);
       }
       # CHANGE "OUTPUT DIR" ACCORDING TO BUILD MODE
       if ( $_ =~ /Output_Dir/ ) {
           my $before = $_;
           $_ =~ s%Output_Dir.*%Output_Dir "$modedir\\\$(ProjectName)_"%;
           my $after = $_;
           printf(STDERR "%30s: %-50s %s\n", $dsp, $before, $after);
       }
       print OUT $_ . "\n";
   }
   close(OUT);
   close(DSP);
}
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to