
#
# **************************************************************
# *                  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)

#LINKER_OPT       = -L/usr/lib -lstdc++ -lm


all: libsimusol_gsl.so

include ../makefile.inc
OPTIONS          = 

install: /usr/local/lib/libsimusol_gsl.so 

clean: 
	rm -f *_wrap.c  *_wrap.o libgslexprtk.so  gslexprtk.o *.o *~

edepclean: eclean
	rm libuseexprtk.so

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

############################################################################ libsimusol_gsl

#	gcc -fpic  -std=c11   -Dbool=char  -Wl,-rpath=.   -I$(ARCHLIB)/CORE $(CCFLAG)   -c testu_wrap.c -o testu_wrap.o 


simusol_gsl.o: simusol_gsl.c simusol_gsl.h
	$(COMPILER) $(OPTIONS) -g -fpic -o simusol_gsl.o -c simusol_gsl.c  


# llama a evaluate que esta en exprtk
#mas granular pero complica la instalacion con makemaker, antes se hacian dos .so ahora todo en uno
libsimusol_gsl.so: simusol_gsl.o
	$(COMPILER) -g -shared -o libsimusol_gsl.so simusol_gsl.o -lgsl -lgslcblas




/usr/local/lib/libsimusol_gsl.so:  # libsimusol_gsl.so Makefile  sacados porque sino archivos root si no hay make antes o sino no usar nunca sudo, si el makefile no lo tiene
	echo Primero haga make
	sudo install  libsimusol_gsl.so /usr/local/lib
	sudo install  simusol_gsl.h /usr/local/include
	sudo ldconfig

#	sudo ln -fs   /usr/local/lib/libsimusol_table.so.1.0.1  /usr/local/lib/libsimusol_table.so
#	sudo ln -fs   /usr/local/lib/libsimusol_table.so.1.0.1  /usr/local/lib/libsimusol_table.so.1


