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

all: /usr/local/lib/libsimusol_table.so.1.0.1


include ../makefile.inc


install: /usr/local/lib/libsimusol_table.so.1.0.1

/usr/local/lib/libsimusol_table.so.1.0.1:  libsimusol_table.so.1.0.1  # override target in makeile.inc
	sudo install  libsimusol_table.so.1.0.1 /usr/local/lib
	sudo install  simusol_table.h /usr/local/include
	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
	sudo ldconfig

simusol_table.o :simusol_table.c simusol_table.h  simusol_table_internal.h  Makefile
	$(COMPILERC) $(OPTIONS) -c  -fPIC -g -o simusol_table.o simusol_table.c #$(LINKER_OPT)

libsimusol_table.a :
	$(AR) rcs libsimusol_table.a  simusol_table.o

libsimusol_table.so.1.0.1: simusol_table.o
	$(COMPILERC) $(OPTIONS)  -g -shared -Wl,-soname=libsimusol_table.so.1 -o  libsimusol_table.so.1.0.1  simusol_table.o


#strip_bin :
#	@for f in $(BUILD_LIST) $(BUILD_LIST_C); do if [ -f $$f ]; then strip -s $$f; echo $$f; fi done;

#valgrind :
#	@for f in $(BUILD_LIST) $(BUILD_LIST_C); do \
#		if [ -f $$f ]; then \
#			cmd="valgrind --leak-check=full --show-reachable=yes --track-origins=yes --log-file=$$f.log -v ./$$f"; \
#			echo $$cmd; \
#			$$cmd; \
#		fi done;


clean:
	rm -f core.* *~ *.o *.bak *stackdump gmon.out *.gcda *.gcno *.gcnor *.gch  libsimusol_table.so.1.0.1 libsimusol_table.a
