#
# **************************************************************
# *                  SIMUSOL PROYECT                           *
# *                                                            *
# *         Table extension for:                               *
# *         C++ Mathematical Expression Toolkit Library        *
# *         which is located in:                               *
# * URL: http://www.partow.net/programming/exprtk/index.html   *
# *                                                            *
# *   The extension was developed by                           *
# *   Diego.Saravia@gmail.com, 2016                            *
# *   and could be used in the same terms of the toolkit       *
# *   or every free license with copyleft needed.              *
# *   http://www.simusol.org                                   *
# **************************************************************
# This file is part of Table.
#
#    Table 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 3 of the License, or
#    (at your option) any later version.
#
#    Table 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 Table.  If not, see <http://www.gnu.org/licenses/>.


COMPILER         = -c++
OPTIMIZATION_OPT = -O1
BASE_OPTIONS     = -pedantic-errors -Wall -Wextra -Werror -Wno-long-long
OPTIONS          = $(BASE_OPTIONS) $(OPTIMIZATION_OPT)
OPTIONS          = 
LINKER_OPT       = -L/usr/lib -lstdc++ -lm
PERL_INC	=	`perl -e 'use Config; print $$Config{archlib};'`/CORE


all: ../lib/Simusol/Swig_GSL.pm  ../blib/arch/auto/Simusol/Swig_GSL/Swig_GSL.so

clean: 
	rm -f *_wrap.c  *_wrap.o
	rm -rf blib
	rm -rf lib

#edepclean: eclean
#	rm libuseexprtk.so

# OJO libSwig_GSL.so debe ser compilado con c++ para poder linkear con otros programas con c++ como exprtk, estudiar!!!

############################################################################ libSwig_GSL


###############################################################################  SWIG  useSwig_GSL_wrap.pm y so


../lib/Simusol/Swig_GSL.pm Swig_GSL_wrap.c:   Swig_GSL.i ../../src/simusol_gsl.h 
	swig -Wall -perl5 Swig_GSL.i
	mkdir -p ../lib/Simusol
	mv Swig_GSL.pm ../lib/Simusol/


Swig_GSL_wrap.o: Swig_GSL_wrap.c  Makefile /usr/local/lib/libsimusol_gsl.so
	$(COMPILER) -c -fPIC Swig_GSL_wrap.c -Dbool=char  -L. -Wl,-rpath=. -I$(PERL_INC) -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -L/usr/lib -L/usr/local/lib -lm  -lsimusol_gsl 



../blib/arch/auto/Simusol/Swig_GSL/Swig_GSL.so: Swig_GSL_wrap.o  Makefile /usr/local/lib/libsimusol_gsl.so /usr/local/lib/libsimusol_exprtk.so /usr/local/lib/libsimusol_table.so
	mkdir -p ../blib/arch/auto/Simusol/Swig_GSL
	$(COMPILER) -shared -fPIC  -L. -Wl,-rpath=. -o ../blib/arch/auto/Simusol/Swig_GSL/Swig_GSL.so  Swig_GSL_wrap.o    -lsimusol_gsl -lsimusol_exprtk -lsimusol_table  -lgsl -lgslcblas -L/usr/lib -L/usr/local/lib  -lm 

#../../../ExprTk/src/simusol_exprtk.o



#-lgslexprtk libgslexprtk.so


# ldd nm
