#  Copyright (C) 2008 Gilles Hennenfent and Sean Ross-Ross
#  
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from os.path import abspath,join
from slabcore import *
#import slabdev

env = Environment( )
env.Tool('slabroot')
env.Tool('slab_cc')

#import pdb
#pdb.set_trace()

srcdir = Dir('.').srcnode( ).abspath
srcincdir = join( srcdir, "../includes" )
env.Append( CPPPATH=join(Dir('.').srcnode( ).abspath,"../includes") , LIBPATH=['.'] )


SOURCES = ['error.c','environment.c','options.c','Dictionary.c',
                          'file_utils.c',
                          'file_io.c',
                          'file_output.c',
                          'file_input.c',
                          'header_utils.c',
                          'Iterator.c',
                          'stringtype.c',
                          'list.c',
                          'platform_specific/unix/filesys.c' 
                          ]


objs = env.SharedObject( SOURCES )
env.Append( LINKFLAGS="-install_name=${TARGET.file}" )
slabc = env.SharedLibrary('slab_c', objs , )
#slabc_shared = env.SharedLibrary('c', objs )

mn = env.Program( 'mn.c', LIBS=[slabc])
p = env.Program( 'c_api_tests.c', LIBS=[slabc])

#t = env.Command('test', p,'./$SOURCE hi')
#m = env.Command('mains', mn,' ./$SOURCE input=f.rsf')
#
#Alias('run',[t,m])

core = env.InstallLibrary( slabc )
#core = env.InstallLibrary( slabc_shared )

