#
# ***************************************************************
# *                  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 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.
#
#    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/>.


# * Uses Check: a unit test framework for C
# * Copyright (C) 2001, 2002 Arien Malec
# https://libcheck.github.io/check/


all: check

# 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

include ../makefile.inc

check:  check_simusol_table.c  Makefile  ../src/simusol_table.c /usr/local/lib/libcheck.a ../src/simusol_table.h  
	@echo 
	@echo =====================================================
	@echo INSTALL gnuplot, ubuntu  sudo apt install gnuplot-x11
	@echo =====================================================
	@echo
	$(COMPILERC)  check_simusol_table.c   /usr/local/lib/libcheck.a   -lrt  -lpthread ../src/simusol_table.o ../src/rel2abs.o ../src/abs2rel.o  $(LINKER_OPT) -o check
#$(COMPILERC)  check_simusol_table.c   /usr/local/lib/libcheck.a   -lrt  -lpthread -lsimusol_table $(LINKER_OPT) -o check

clean::
	rm -f *.o *~ check gnudata.txt

