# -*-Python-*-

##
## Standard SCons template for software directory builds.  Walks the list of
## subdirectories and builds them, then builds all sources in this directory.
##
## Returns a list of the objects to the parent.
##

import os
import string
import sys

from @ROOT_DIR_MODEL@ import  *

Import('*')


SUBDIRS = '@SUBDIRS@'
CSRCS = '@CSRCS@'

CWD_REL = sw_env['DEFS']['CWD_REL']

##
## Build subdirectories and collect the built objects
##
APM_FILE = sw_env['DEFS']['APM_FILE']

all_builds = []
for s in SUBDIRS.split():
    sw_env['DEFS']['CWD_REL'] = CWD_REL + '/' + s
    sd = SConscript([s + '/SConscript'])
    all_builds += sd

##
## Build all sources in this directory
##

for s in CSRCS.split():
    all_builds += sw_env.Object(s)

Return('all_builds')
