import os

def defaultEnvironment():
    env = Environment(ENV = os.environ)
    env.Append(CCFLAGS = ['-g3'])
    return env

def allegroLibrary():
    env = defaultEnvironment()
    env.VariantDir('build-allegro', 'allegro4')
    return env.StaticLibrary(Split("""
build-allegro/allegro.c
build-allegro/math3d.c
build-allegro/math.c
"""))

def stars():
    env = defaultEnvironment()
    env.ParseConfig('pkg-config allegro-5.1 allegro_primitives-5.1 --cflags --libs')
    env.Append(LIBS = [allegroLibrary()])
    env.Append(CPPPATH = ['allegro4'])
    return env.Program('stars', 'exstars.c')

stars()
