This is how to do what you have in your Makefile in SCons. You should put this Python code in a file at the root of the project called SConstruct
, and just simply execute scons
. To clean, execute scons -c
env = Environment()
env.Append(CPPFLAGS=['-Wall', '-ansi', '-pedantic', '-O2', '-lGL', '-lGLU', '-lX11'])
# Determine compiler and linker flags for SDL
env.ParseConfig('sdl-config --cflags')
env.ParseConfig('sdl-config --libs')
# Remember that the SCons Glob() function is not recursive
env.Program(target='project1',
source=[Glob('engine/core/*.cpp'),
Glob('engine/objects3d/*.cpp'),
Glob('engine/display/*.cpp)',
Glob('engine/io/*.cpp'),
Glob('engine/math/*.cpp'),
Glob('engine/messages/*.cpp'),
Glob('*.cpp')])
Here is a link for using SDL with SCons.
And here is info on the SCons ParseConfig() function.