I have an SConscript that constructs targets using the m4 and sed utilities included with Cygwin.
Overall, the build takes about 42 seconds to construct 16 targets from 8 sources, but the same build only takes Make about 4 seconds! That's a tenfold time difference for what is a fairly trivial build! I know SCons has to run through the Python interpreter, so of course it won't be as fast as a native executable like Make, but still, I have to assume that with such a basic build as mine, I must be doing something really silly to be seeing such a massive time difference. Any ideas or suggestions?
Based on some suggestions in the comments, I have replaced my custom m4 builder with SCons in-built one, and I have gotten rid of the sed one altogether just to reduce the number of potential causes, and the total build time is now down to 22 seconds. You can now see the entirety of my code below:
SConstruct:
env = DefaultEnvironment(tools=['m4'])
env['ENV']['PATH'] = ['C:/cygwin/bin']
SConscript('sources/SConscript', exports = 'env', variant_dir='build', duplicate = 0,)
sources\SConscript:
from ntpath import basename # Gets a file's basename from it's pathname.
Import('env')
M4FLAGS = '-DVV_SUBDERIVATIVE_NAME=5777C -DM4_USER_MODE_CONFIGURATION=true'
for file in Glob("*.xdm"):
env.M4(target=basename(str(file))+'.orig', source=file, M4FLAGS=M4FLAGS)