[Scons-users] C++ header file dependency handling in Scons Vs Makefile

Bill Deegan bill at baddogconsulting.com
Tue Sep 29 11:43:41 EDT 2015


One other item of note.
Often build systems using make will over specify header file dependencies,
so while only  a,b,c are affected by myglobal.h, the makefile may specify
a,b,c,d,e,f  because either the developer wasn't sure, or perhaps there was
at some point such a dependency which changed and is no longer valid.

Also, it's harder to get cross directory dependencies correct with Make (Go
and google "recursive make considered harmful")
It's quite hard to get non-recursive make setup properly, and also
maintaining it can be challenging.
(At least compared with how easy it is to do with SCons).

That said, you should move forward from the ancient version of SCons you
are using.
If you have larger builds a change in 2.4.0 may have significant run time
and memory improvements for you.

-Bill



On Tue, Sep 29, 2015 at 8:15 AM, Jonathon Reinhart <
jonathon.reinhart at gmail.com> wrote:

> SCons is slightly superior in this case, but not why you would expect.
>
> Let's say you make a change to the header file, and do an incremental
> (update) build. Here's what happens:
> - The header file changed, and thus its dependencies get re-built.  This
> is unavoidable in any make system,
>   unless you separate header pre-processing from compilation.
> - The default MD5 decider looks at the (recently re-compiled) object
> files, and realizes that some of the have
>   not actually changed (even though their timestamps have been updated).
> - The binaries that depend on those object files *need not be rebuilt*.
> And therein lies the advantage.
>
> Basically, where GNU Make allows changes to "trickle" through the entire
> project, the default MD5 decider
> in SCons "stops" the trickle at the earliest point.
>
> On Tue, Sep 29, 2015 at 8:49 AM, Saurabh Bhatnagar <
> saurabh.b.bhatnagar at oracle.com> wrote:
>
>> Hi
>>
>> We are on scons0.96.
>>
>>
>>
>> There is another very large project that uses Makefiles/gmake/NMAKE.
>>
>> They have a set of header files that impact a bunch of sources.
>>
>> Hence if that header is changed(even for a redundant change) gmake thinks
>> it should build that and off we go!
>>
>> All of that was built incremental is still redundant.
>>
>>
>>
>> Q:
>>
>> How does the dynamic dependency model of scons handle this scenario?
>>
>> Is it superior to the make in this case?
>>
>>
>>
>> --
>> Warm Regards
>>
>> Saurabh Bhatnagar
>>
>> Oracle is committed to developing practices and products that help
>> protect the environment
>>
>> [image: cid:image003.gif at 01CE683C.999F3F40]"Please consider your
>> environmental responsibility before printing this e-mail"
>>
>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>
>
> --
> Computers are incredibly fast, accurate and stupid. Human beings are
> incredibly slow, inaccurate and brilliant. Together they are powerful
> beyond imagination.
>                                     A. Einstein
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150929/09d8e091/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1194 bytes
Desc: not available
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150929/09d8e091/attachment-0001.gif>


More information about the Scons-users mailing list