Protein Behavior After Two Runs in a Row

I am trying to configure as convenient a configuration as possible. My build script works fine, but I still have problems with one thing.

With make, if I run "make" twice in a row, it won’t do anything a second time because it will detect that the target has been updated (because I just built it).

How can I make sure that the sons behave the same? Right now, if I run scons a second time, he thinks that the goal should be built again, and besides, it cannot be built due to the conflicting dependencies of all the remaining .o files (since cleaning was not called at first).

How can I get scons to handle this on its own, i.e. to discover that the goal is out of date and if so rebuilt?

In addition, I noticed that if I call

scons
scons -q

a build, and then DIRECTLY the question, the exit status is still always 1. If I understood correctly, it should be 0, because the target has been updated.

Any help appreciated!

EDIT:

Here is my SConstruct file. If I do something wrong, refer to my attention:

import os

env = Environment(CXX = "C:/MinGW/bin/g++", CCFLAGS = "-g")
env.Tool("mingw")

sourceList = list('./src/' + x for x in os.listdir("./src"))

pathList = ['./include',
            'C:/boost',
            'C:/frameworks/SFML/include',
            'C:/Python27/include']

libPathList = ['C:/boost/stage/lib', 'C:/frameworks/SFML/lib', 'C:/Python27/libs']
libList = ['boost_thread-mgw45-mt-1_46_1',
           'boost_python-mgw45-mt-1_46_1', 
           'sfml-system',
           'sfml-window',
           'sfml-graphics',
           'python27']

env.Append(CPPPATH=pathList)
env.Append(LIBPATH=libPathList)
env.Append(LIBS=libList)

t = env.Program(target='./bin/build_result.exe', source=sourceList)
Default(t)

Yes, I know that I have to add the correct debugging options in general, but I can refine the file later. However, I do not know if there are any problems associated with what I am experiencing. In addition, this file works exactly for a smaller test project:

import os

env = Environment(CXX = "C:/MinGW/bin/g++", CCFLAGS = "-g")
env.Tool("mingw")

sourceList = os.listdir('.')
sourceList = list(x for x in sourceList if x[-3:] == 'cpp')

t = env.Program(target='./result.exe', source=sourceList)
Default(t)

"scons -q" works as expected. Any idea what is going on?

+3
source share
2 answers

A more general way of specifying the source files to be compiled into SCons is as follows:

sourceList = Glob('#/src/*.cpp')
t = env.Program(target='#/bin/build_result.exe', source=sourceList)

'#' . SCons , SConstruct. Glob(). SConstruct.

, SConstruct SConscript() SConscript src, env, SConstruct, , . , , SConscript. SCons.

+2

, . :

sourceList = list('./src/' + x for x in os.listdir("./src"))

sourceList = list(x for x in sourceList if x[-3:] == 'cpp')

build.o . /src, . .

+1

All Articles