#good doc #https://scons.org/doc/production/HTML/scons-user.html#app-functions

#Library('',[])
#Library('Test01SharedLib', ['../src_shared/test01_shared.c'])
#Library('Test01SharedLib', ['../src_shared/test01_shared.c'] ,CPPPATH=['../include'])

#Program('',[])

#Program('test01' ,['../src/test01.c' ,CPPPATH=['../src' ,'../scr_shared' ,'../include'] ,['../src/say_hello_01.c'] ,LIBS=['Test01SharedLib'] ,LIBPATH=['.'])
#Program('test01' ,['../src/test01.c' ,'../src/say_hello_01.c'] ,CPPPATH=['../include'] ,LIBS=['Test01SharedLib'] ,LIBPATH=['.'])

#SConstruct

#env = Environment(CC='gcc' ,CCFLAGS=' -O2 -Wall -g' ,CPPDEFINES=['MyDefine01'])
#
#env = Environment(CC='gcc')
env = Environment(CC='g++')
env.Replace(CC='clang')
#env.Append(CCFLAGS=' -Wall -g')
env.Append(CCFLAGS=' -O2 -Wall -g')
#
env.Prepend(CPPDEFINES=['MyFirstDefine00'])
env.Append(CPPDEFINES=['MyDefine02'])
env.Append(MyVariableAdded01=['MyVariableAdded01'])
print("MyVariableAdded01 = %s" % env['MyVariableAdded01'])
#
opt = env.Clone(CCFLAGS=[' -O2'])
dbg = env.Clone(CCFLAGS=[' -Wall -g'])
#
#env.Program('test01' ,['foo.c'])
#
#o = opt.Object('test01-o' ,['foo.c'])
#opt.Program(o)
##
#d = dbg.Object('test01-d' ,['foo.c'])
#dbg.Program(d)

Export ('env')
#Export ("opt", "dbg")
#Export ('opt dbg')
Export ('opt', 'dbg')
#Export ('dbg')


#SConscript(['src_shared/SConscript']
#            , variant_dir='build_sc_shared'
#            , duplicate=False
#          )
#SConscript(['src/SConscript']
#            , variant_dir='build_sc'
#            , duplicate=False
#          )


SConscript(['shared/src/SConscript']
#            , variant_dir='build_sc_shared'
          )
SConscript(['src/SConscript']
#            , variant_dir='build_sc'
          )
