# Copyright 2023 Kevin Ryde

# This file is part of pari-primecount.

# pari-primecount 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.
#
# pari-primecount 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 pari-primecount.  See the file COPYING.  If not, see
# <http://www.gnu.org/licenses/>.

VERSION = 1

GP = gp
GPFLAGS = -f --quiet
CFLAGS = -O -Wall -fPIC
LOADLIBES = -lprimecount

all: test-c.so pc

test: test-c.so
	$(GP) $(GPFLAGS) <test-c.gp
	$(GP) $(GPFLAGS) <test-slow.gp

test-c.so: test-c.c ../pari_primecount.c
	$(CC) $(CFLAGS) -shared test-c.c -o test-c.so
	
clean:
	rm -f pc test-c.so

.PHONY: clean default
