# This is a comment
import os.path

env = Environment(CPPPATH='vendor/cii20/src')   # Create an environmnet
env.Append(CCFLAGS = ['-g','-O3' ,'-Wall'])

def filtered_glob(env, pattern, omit=[],
  ondisk=True, source=False, strings=False):
    return filter(
      lambda f: os.path.basename(f.path) not in omit,
      env.Glob(pattern))

env.AddMethod(filtered_glob, "FilteredGlob");

ciifiles = env.Object(env.FilteredGlob('vendor/cii20/src/*.c',
  ['SpeciallyTreatedFile.cc', 'thread-nt.c','thread.c']))

libcommon_target = "common"
libcommon_sources = [ Glob("src/common/*.c"), "libcii.a" ]
libcommon = env.StaticLibrary(target = libcommon_target, source = libcommon_sources)

libcii_target = "cii"
libcii_sources = [ Glob("vendor/cii20/src/*.c") ]
libcii = env.StaticLibrary(target = libcii_target, source = ciifiles)

singletontest = env.Program(source = [ Glob("src/Behavioral/Chain_Of_Responsibility/*.c") ,"libcii.a" ], 
	target = "src/Behavioral/Chain_Of_Responsibility/test")

singletontest = env.Program(source = [ Glob("src/Behavioral/Command/*.c"), "libcommon.a","libcii.a" ], 
	target = "src/Behavioral/Command/test")

singletontest = env.Program(source = [ Glob("src/Behavioral/Interpreter/*.c"), "libcommon.a","libcii.a"  ], 
	target = "src/Behavioral/Interpreter/test")

singletontest = env.Program(source = [ Glob("src/Behavioral/Iterator/*.c"), "libcommon.a","libcii.a" ], 
	target = "src/Behavioral/Iterator/test")

singletontest = env.Program(source = [ Glob("src/Behavioral/Mediator/*.c") ,"libcii.a" ], 
	target = "src/Behavioral/Mediator/test")

singletontest = env.Program(source = [ Glob("src/Behavioral/Memento/*.c"), "libcommon.a","libcii.a"  ], 
	target = "src/Behavioral/Memento/test")

singletontest = env.Program(source = [ Glob("src/Behavioral/Observer/*.c"), "libcii.a" ], 
	target = "src/Behavioral/Observer/test")

singletontest = env.Program(source = [ Glob("src/Behavioral/State/*.c"), "libcommon.a", "libcii.a" ], 
	target = "src/Behavioral/State/test")

singletontest = env.Program(source = [ Glob("src/Behavioral/Strategy/*.c"), "libcommon.a","libcii.a"  ], 
	target = "src/Behavioral/Strategy/test")

singletontest = env.Program(source = [ Glob("src/Behavioral/Template_Method/*.c"), "libcommon.a","libcii.a"  ], 
	target = "src/Behavioral/Template_Method/test")


singletontest = env.Program(source = [ Glob("src/Behavioral/Visitor/*.c"),"libcii.a"  ], 
	target = "src/Behavioral/Visitor/test")




singletontest = env.Program(source = [ Glob("src/Creational/Abstract_Factory/*.c"), "libcommon.a" , "libcii.a" ], 
	target = "src/Creational/Abstract_Factory/test")

singletontest = env.Program(source = [ Glob("src/Creational/Builder/*.c"), "libcommon.a", "libcii.a" ], 
	target = "src/Creational/Builder/test")


singletontest = env.Program(source = [ Glob("src/Creational/Factory_Method/*.c"), "libcommon.a" , "libcii.a" ], 
	target = "src/Creational/Factory_Method/test")

singletontest = env.Program(source = [ Glob("src/Creational/Prototype/*.c") , "libcii.a" ], 
	target = "src/Creational/Prototype/test")

singletontest = env.Program(source = [ Glob("src/Creational/Singleton/*.c") , "libcii.a" ], 
	target = "src/Creational/Singleton/test")




singletontest = env.Program(source = [ Glob("src/Structural/Adapter/*.c") , "libcii.a" ], 
	target = "src/Structural/Adapter/test")

singletontest = env.Program(source = [ Glob("src/Structural/Bridge/*.c") , "libcii.a" ], 
	target = "src/Structural/Bridge/test")


singletontest = env.Program(source = [ Glob("src/Structural/Composite/*.c"), "libcii.a" ], 
	target = "src/Structural/Composite/test")


singletontest = env.Program(source = [ Glob("src/Structural/Decorator/*.c") , "libcommon.a" , "libcii.a" ], 
	target = "src/Structural/Decorator/test")

singletontest = env.Program(source = [ env.Glob("src/Structural/Facade/*.c"), "libcommon.a" , "libcii.a" ], 
	target = "src/Structural/Facade/test")


singletontest = env.Program(source = [ Glob("src/Structural/Flyweight/*.c") , "libcii.a" ], 
	target = "src/Structural/Flyweight/test")

singletontest = env.Program(source = [ Glob("src/Structural/Proxy/*.c") , "libcii.a" ], 
	target = "src/Structural/Proxy/test")
