import os, commands



# Get compiler from pkg-config
compiler = commands.getoutput('pkg-config --variable=compiler dolfin')

# Create a SCons Environment based on the main os environment
env = Environment(ENV=os.environ, CXX=compiler)

#Create output dir.
if not env.GetOption("clean"):
    print commands.getoutput('mkdir output')
    print 'scons: created output dir'

# Get compiler flags from pkg-config
env.ParseConfig('pkg-config --cflags --libs dolfin')

env.Append(CPPPATH = ['../../src'])

# Configure libraries
env.Append(LIBPATH = ['../../src'])
env.Append(LIBS    = ['dolfwave'])

# Program name
env.Program('real_harbour', ['main.cpp'])

cleanall=ARGUMENTS.get('cleanAll',0)
if bool(cleanall)!=0:
    print commands.getoutput('rm -rf output')
    print 'scons: removed output dir'
