#
# ***************************************************************
# *                  Tabular - SIMUSOL PROYECT                  *
# *                                                             *
# *   Table extension for SIMUSOL PROYECT, for use with:        *                
# *       +  C++ Mathematical Expression Toolkit Library        *
# *          which is located in URL:                           *
# *          http://www.partow.net/programming/exprtk/index.html*
# *          used in Siru/Simusol                               *
# *       +  SCEPTRE (System for Circuit Evaluation             *
# *          and Prediction of Transient Radiation Effects)     *
# *          http://alpha.fh-friedberg.de/iem/84.html           *
# *          used in Simusol                                    *
# *   The extension was developed by                            *
# *   Diego.Saravia@ututo.org, 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 Tabular
#
#    Tabular is free software: you can redistribute it and/or modify
#    it under the terms of
#
#     1)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.
#
#    2) Any other free licence with copyleft recognized by the FSF
#
#    Tabular 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 Tabular.  If not, see <http://www.gnu.org/licenses/>.


# For use with:
# **************************************************************
# *         C++ Mathematical Expression Toolkit Library        *
# *                                                            *
# * Author: Arash Partow (1999-2017)                           *
# * URL: http://www.partow.net/programming/exprtk/index.html   *
# *                                                            *
# * Copyright notice:                                          *
# * Free use of the Mathematical Expression Toolkit Library is *
# * permitted under the guidelines and in accordance with the  *
# * most current version of the MIT License.                   *
# * http://www.opensource.org/licenses/MIT                     *
# *                                                            *
# **************************************************************



# exprtk.hpp va dentro del paquete, no se baja a /tmp/down ni se espera
# instalado en el sistema: asi el tarball compila en cualquier maquina.
# Es la copia de psicro (fecha 20250101), identica al exprtk.hpp de upstream.

all: exprtk_table
compila: exprtk_table

install:

# ojo con ..
define findfirstSB
$(shell $(shellpath) if test -s ../$1 ; then \
                   echo ..;\
                 elif test -s ~/$1 ; then \
                    echo ~;\
                 elif test -s /usr/local/$1 ; then \
                   echo /usr/local;\
                 elif  test -s /usr/$1 ; then \
                    echo /usr;\
                 fi;)
endef
PREFIXMLIB=$(call findfirstSB,share/summapack/data/makefile.lib)
$(info MAKELIB: ${PREFIXMLIB}) 
include $(PREFIXMLIB)/share/summapack/data/makefile.lib
$(info MAKELIB FIN) 


include ../makefile.inc

#http://www.partow.net/downloads/exprtk.zip
#https://svn.apache.org/repos/asf/jakarta/cactus/trunk/descriptors/licenses/cpl-1.0.txt

exprtk_table:  exprtk_table.cpp exprtk.hpp ../libs/tabular.o Makefile ../makefile.inc  ../libs/rel2abs.o ../libs/abs2rel.o
	time  $(COMPILER) $(CPPOPTIONS) -std=gnu++14 -I. -g -o exprtk_table    exprtk_table.cpp ../libs/tabular.o ../libs/rel2abs.o ../libs/abs2rel.o  $(LINKER_OPT)



#-f "time: %E"

exprtk_table_static:  exprtk_table.cpp exprtk.hpp ../libs/tabular.o ../libs/tabular.h  tabular_internal.h  Makefile  
	time -f "time: %E" $(COMPILER) $(CPPOPTIONS) std=gnu++14 -I. -g -o exprtk_table ../libs/tabular.o ../libs/rel2abs.o ../libs/abs2rel.o  exprtk_table.cpp $(LINKER_OPT)

#  /usr/local/include/simusol_table.h  
#	time -f "time: %E" $(COMPILER) $(CPPOPTIONS) -g -o exprtk_table simusol_table.o ../tests/finddir.o  exprtk_table.cpp $(LINKER_OPT)

clean::
	rm -f *~ *.o  exprtk_table_static exprtk_table


#	rm -f exprtk.hpp

