# Makefile for building imath library and test program
# imath is available at https://github.com/creachadair/imath
# The code here is from https://github.com/creachadair/imath/commit/b7271d04621449a07355b9b7272335fd5030b0ae

CC= gcc -std=c99
CFLAGS= -pedantic -Wall -Wextra -O3 $(PIC) -Wno-unused-parameter -funroll-loops -finline-functions -DNDEBUG
L= imath.o
T= pi

all:	$L

imath.o: imath.c imath.h macros.c
	$(CC) $(CFLAGS) -c imath.c

test:	$T
	./$T 1598

$T:	$T.c $L
	$(CC) $(CFLAGS) -o $T $T.c $L

clean:
	-rm -f *.o *.a $T
