import os

Import('env')

test_env = env.Clone()

progs = []

test_env.Append(CPPDEFINES = 'AJ_MAIN')
test_env.Append(CPPPATH = './inc')

test_env.Append(LIBPATH = '#dist/lib')
test_env.Prepend(LIBS = 'ajtcl_services')

common_srcs = [ s for s in Glob('common/*.c')
                if test_env['enable_onboarding'] or not s.name == 'OnboardingSample.c' ]

common_objs = test_env.Object(common_srcs)

build_tests = [
    'ACServer',
    'AllInOneServer'
]

for test in build_tests:
    objs = test_env.Object(Glob(test + '/*.c'))
    progs.append(test_env.Program(test + 'Test', common_objs + objs))

test_env.Install('#dist/bin', progs)
