[Scons-users] Don't understand why scons doesn't rebuild my program
    Andrew McLean 
    am577 at aiomclean.plus.com
       
    Fri Oct  4 05:59:23 EDT 2013
    
    
  
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])
    
    
More information about the Scons-users
mailing list