#! /usr/bin/env python
# encoding: utf-8
import os


def build(bld):
	HOMEDIR = os.getenv("HOME")+"/"

	# --------------------------------------------------
	# features

	lag = bld.new_task_gen(
		features = 'cxx cshlib',
		source = 'features/Lag.cpp',
		target = 'Lag',
		install_path = HOMEDIR+".cebl/plugins/features/",
		uselib = 'LAPACK')

	lag.env['CPPPATH'] += ['../src']  + ['../src/cppR']

	incsvd = bld.new_task_gen(
		features = 'cxx cshlib',
		source = 'features/IncrementalSVD.cpp',
		target = 'IncrementalSVD',
		install_path = HOMEDIR+".cebl/plugins/features/",
		uselib = 'LAPACK')

	incsvd.env['CPPPATH'] += ['../src']  + ['../src/cppR']

	windowedsvd = bld.new_task_gen(
		features = 'cxx cshlib',
		source = 'features/WindowedSVD.cpp',
		target = 'WindowedSVD',
		install_path = HOMEDIR+".cebl/plugins/features/",
		uselib = 'LAPACK')

	windowedsvd.env['CPPPATH'] += ['../src']  + ['../src/cppR']

	# --------------------------------------------------
	# classifiers

	lda = bld.new_task_gen(
		features = 'cxx cshlib',
		source = 'classifiers/LDA.cpp ../model/EEGTrainingData.cpp ../model/EEGData.cpp',
		target = 'LDA',
		install_path = HOMEDIR+".cebl/plugins/classifiers/",
		uselib = 'LAPACK')

	lda.env['CPPPATH'] += ['../src']  + ['../src/cppR']


	qda = bld.new_task_gen(
		features = 'cxx cshlib',
		source = 'classifiers/QDA.cpp ../model/EEGTrainingData.cpp ../model/EEGData.cpp',
		target = 'QDA',
		install_path = HOMEDIR+".cebl/plugins/classifiers/",
		uselib = 'LAPACK')

	qda.env['CPPPATH'] += ['../src']  + ['../src/cppR']



	# --------------------------------------------------
	# filters
	mnf = bld.new_task_gen(
		features = 'cxx cshlib',
		source = 'filters/MNF.cpp',
		target = 'MNF',
		install_path = HOMEDIR+".cebl/plugins/filters/",
		uselib = 'LAPACK')

	mnf.env['CPPPATH'] += ['../src']  + ['../src/cppR']

	# --------------------------------------------------
	# decision processes

	MSPRT = bld.new_task_gen(
		features = 'cxx cshlib',
		source = 'decision/MSPRT.cpp',
		target = 'MSPRT',
		install_path = HOMEDIR+".cebl/plugins/decision/",
		uselib = 'LAPACK')

	MSPRT.env['CPPPATH'] += ['../src']  + ['../src/cppR']


	SimpleMax = bld.new_task_gen(
		features = 'cxx cshlib',
		source = 'decision/SimpleMax.cpp',
		target = 'SimpleMax',
		install_path = HOMEDIR+".cebl/plugins/decision/",
		uselib = 'LAPACK')

	SimpleMax.env['CPPPATH'] += ['../src']  + ['../src/cppR']


def configure(conf):
    return
