# Copyright 2021, 2022 Kevin Ryde

# This file 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, or (at your option) any later
# version.
# 
# This file 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 this file.  See the file COPYING.  If not, see
# <http://www.gnu.org/licenses/>.


GP = gp
GPFLAGS =

default:
all:

test:
	# test_is_gnil, if possible
	-cd .. && $(MAKE) -$(MAKEFLAGS) test_is_gnil.so

	for i in *-test.gp test-*.gp; do \
	  echo $$i; \
	  $(GP) $(GPFLAGS) -f --quiet $$i </dev/null || exit 1; \
	done

clean:

tt: a331692-test
a331692-test:
	-ispell-batch-gp.pl \
	  --localwords "sqrts,sqrtint,Colijn,Plazzotta,Ryde,www,org,PARI,GP,frac,len,rem,contfrac,QUADs,nfinit,POLMOD" \
	  a331692-contfrac-sqrt-phi.gp
	../..//shared/my-check-gp.pl \
	  a331692-contfrac-sqrt-phi.gp \
	  a331692-contfrac-sqrt-phi--test.gp
	cat a331692-contfrac-sqrt-phi.gp \
	    a331692-contfrac-sqrt-phi--test.gp \
	    >/tmp/a331692-contfrac-sqrt-phi--both.gp
	../..//shared/my-check-gp.pl \
	    /tmp/a331692-contfrac-sqrt-phi--both.gp
	rm -f /tmp/a331692-contfrac-sqrt-phi--both.gp
	set -ex; \
	for GP in $(GP); do \
	  echo =========; \
	  $$GP $(GPFLAGS) -f --quiet <a331692-contfrac-sqrt-phi.gp; \
	  $$GP $(GPFLAGS) -f --quiet <a331692-contfrac-sqrt-phi--test.gp; \
	done

#------------------------------------------------------------------------------
.PHONY: default all test clean version
