# SConstruct for building balder2d with scons
includepath = ['include']
env = Environment(
    CPPPATH=includepath,
    CCFLAGS='-march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -O3 -fomit-frame-pointer -ffast-math'
)

#avoid leaving .sconsign files all over the place, put all signatures in:
env.SConsignFile("scons-signatures")

debug = ARGUMENTS.get('debug', 0)
if int(debug):
    env.Append(CCFLAGS = ' -g')

import glob
files = glob.glob("src/*.cpp") + glob.glob("src/*/*.cpp") + glob.glob("src/menu/*/*.cpp")+ glob.glob("src/*/*.c")
libs = Split('guichan_sdl guichan SDL SDL_image SDL_mixer SDL_gfx physfs')

env.ParseConfig('sdl-config --cflags --libs')
env.Program('bin/balder2d',files, LIBS=libs)

SConscript('bin/scripts/test/SConscript')
