all: ../lib/Tabular/Swig_Tabular.pm ../blib/arch/auto/Tabular/Swig_Tabular/Swig_Tabular.so 

include ../../makefile.inc

#testu.o: testu.c
#	$(COMPILER) $(OPTIONS) -g -o $@ -c testu.c  

#LIBS=/usr/local/lib64
#LIBSP=/usr/lib64


LIBS=/usr/local/lib/x86_64-linux-gnu/
LIBSP=/usr/lib/x86_64-linux-gnu/

COMPILER=gcc

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

#edepclean: eclean
#	rm useexprtk.o libuseexprtk.so


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


#sacar el .h

../lib/Tabular/Swig_Tabular.pm Swig_Tabular_wrap.c:   Swig_Tabular.i  /usr/local/include/tabular1.h 
	swig -Wall -perl5 Swig_Tabular.i
	mkdir -p ../lib/Tabular
	mv Swig_Tabular.pm ../lib/Tabular


##-Dbool=char protesta gcc 7
#$(LIBS)/libtabular.so
Swig_Tabular_wrap.o: Swig_Tabular_wrap.c  Makefile
	$(COMPILER) -c -fPIC -o Swig_Tabular_wrap.o Swig_Tabular_wrap.c   -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$(LIBS)   -L$(LIBSP)
#libgslexprtk.so


#../blib/arch/auto/useexprtk/useexprtk.so: useexprtk.o useexprtk_wrap.o  Makefile gslexprtk.o
#	mkdir -p ../blib/arch/auto/useexprtk
#	c++ -shared -fPIC  -L. -Wl,-rpath=. -o ../blib/arch/auto/useexprtk/useexprtk.so useexprtk.o useexprtk_wrap.o  gslexprtk.o /home/dsa/svn/trabajos/simusoltabla/src/simusol_table.o -lgsl -lgslcblas -L/usr/lib -lstdc++ -lm 


# con simusol_table
../blib/arch/auto/Tabular/Swig_Tabular/Swig_Tabular.so:  Swig_Tabular_wrap.o  Makefile  $(LIBS)/libtabular.so
	mkdir -p ../blib/arch/auto/Tabular/Swig_Tabular
	$(COMPILER) -shared -fPIC  -L. -Wl,-rpath=. -o ../blib/arch/auto/Tabular/Swig_Tabular/Swig_Tabular.so  Swig_Tabular_wrap.o  -ltabular

#-ltabular  -L$(LIBSP) -L$(LIBS)

#-lsimusol_exprtk

#-lgslexprtk libgslexprtk.so


# ldd nm
