[Scons-users] Don't understand why scons doesn't rebuild my program

Bill Deegan bill at baddogconsulting.com
Fri Oct 4 17:31:02 EDT 2013


Also,

run : scons --tree=prune to see the dependency tree that SCons constructs
for your project.

-Bill


On Fri, Oct 4, 2013 at 3:32 AM, Dirk Bächle <tshortik at gmx.de> wrote:


> Hi Andrew,

>

> I apologize in advance for asking such a seemingly stupid question, but do

> you change your code in a way that really changes its behaviour?

> Since SCons usually does its change detection based on MD5 sums, it

> wouldn't relink your newer object files after you've only edited comments.

> SCons would see that the linking inputs didn't change their content

> signatures...and stop right there with nothing further to do.

>

> From your current description of the problem this might be the case, can

> you confirm?

> Else, I would try to look into this some more...

>

> Final questions:

>

> 1. How exactly do you call "scons"? Is the problem the same for "scons"

> and "scons install" ?

> 2. Have you tried to specify your program target explicitly on the

> command-line as in

>

> scons mp0

>

> ?

>

> Best regards,

>

> Dirk

>

>

>

> On 04.10.2013 11:59, Andrew McLean wrote:

>

>> I will append my simple SConstruct file, and an 'opts.py' which it

>> includes.

>> If I do 'scons -c' and 'scons' it compiles the source and builds the

>> executable

>> as expected.

>> But if I then edit the source and do 'scons', it recompiles, but doesn't

>> go on

>> to rebuild the executable, even though the .o file is now newer than the

>> executable.

>> How do I make that dependency work ?

>> TIA...

>> AM

>> ------------------------------**------------------

>> #!/usr/bin/env python

>> # SCONS control file for the PA Program

>>

>> # Import shared opts

>> import AM_opts

>>

>> # Create Environment for building normal programs

>> env = Environment(CPPPATH = ['.'])

>> AM_opts.add_opts(env)

>> env.Append(CCFLAGS=['-O3'])

>>

>> # Create Environment for the debug program

>> dbg = env.Clone()

>> dbg.Append(CCFLAGS=['-DDEBUG', '-g', '-O0'])

>>

>> Repository('/home/andrew/src/**include')

>>

>> m2o = env.Object('mbprint.o', 'mbprint.c')

>> m2to = dbg.Object('mbprint.to', 'mbprint.c')

>>

>> # ol4 makes MBPRINT

>> ol4 = m2o

>> # Now the T versions...

>> ol4t = m2to

>>

>> # Programs

>> mp0 = env.Program('mp0', ol4, LIBS=['Xext', 'X11', 'm', 'jpeg',

>> 'pthread', 'mb'], LIBPATH=['/usr/local/lib'])

>> mp0t = dbg.Program('mp0t', ol4t, LIBS=['Xext', 'X11', 'm', 'jpeg',

>> 'pthread', 'mbt'], LIBPATH=['/usr/local/lib'])

>>

>> # Installation

>> im0 = env.Install('/usr/local/bin', mp0)

>> im0t = dbg.Install('/usr/local/bin', mp0t)

>>

>> ------------------------------**----------------------------

>> # AM's scons_funcs.py.

>>

>> def add_opts(env):

>> env['STATIC_AND_SHARED_**OBJECTS_ARE_THE_SAME']=1

>> env.Append(CCFLAGS=['-Wall','-**Wno-unused','-W','-ggdb3','--**fast-math','-march=core2'])

>>

>> env.Append(CCFLAGS=['-D_GNU_**SOURCE', '-pthread'])

>>

>> env.Alias('install', [im0, im0t])

>>

>>

>> ______________________________**_________________

>> Scons-users mailing list

>> Scons-users at scons.org

>> http://four.pairlist.net/**mailman/listinfo/scons-users<http://four.pairlist.net/mailman/listinfo/scons-users>

>>

>>

> ______________________________**_________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/**mailman/listinfo/scons-users<http://four.pairlist.net/mailman/listinfo/scons-users>

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131004/c6d9fadc/attachment-0001.htm


More information about the Scons-users mailing list