all: interpol.c spline.c nrutil.c splint.c
	gcc -o splineinterpol -lm interpol.c spline.c nrutil.c splint.c 

install: splineinterpol /home/celltest/convert-tables/userfiles /home/celltest/convert-tables/mv_to_temp /home/celltest/convert-tables/temp_to_mv
	cp splineinterpol /usr/local/bin/
	cp -R convert-tables /home/celltest/

clean:
	rm -rf *o splineinterpol
	rm -rf *~

splineinterpol: interpol.c spline.c nrutil.c splint.c
	gcc -o splineinterpol -lm interpol.c spline.c nrutil.c splint.c 

update: splineinterpol /home/celltest/convert-tables/userfiles /home/celltest/convert-tables/mv_to_temp /home/celltest/convert-tables/temp_to_mv
	cp splineinterpol /usr/local/bin/
	cp convert-tables/* /home/celltest/convert-tables/

/home/celltest/convert-tables:
	test -d /home/celltest/convert-tables/ || mkdir /home/celltest/convert-tables

/home/celltest/convert-tables/userfiles: /home/celltest/convert-tables
	test -d /home/celltest/convert-tables/userfiles || mkdir /home/celltest/convert-tables/userfiles
	chmod 777 /home/celltest/convert-tables/userfiles

/home/celltest/convert-tables/mv_to_temp: /home/celltest/convert-tables
	test -d /home/celltest/convert-tables/mv_to_temp || mkdir /home/celltest/convert-tables/mv_to_temp
	chmod 777 /home/celltest/convert-tables/mv_to_temp

/home/celltest/convert-tables/temp_to_mv: /home/celltest/convert-tables
	test -d /home/celltest/convert-tables/temp_to_mv || mkdir /home/celltest/convert-tables/temp_to_mv
	chmod 777 /home/celltest/convert-tables/temp_to_mv
