# Makefile for building fi_lib library and test program
# fi_lib is available at https://www2.math.uni-wuppertal.de/wrswt/software/filib.html
# The code here is from https://www2.math.uni-wuppertal.de/wrswt/software/fi_lib/fi_lib-1.2.tgz

CC= gcc
CFLAGS= -pedantic -Wall -Wextra $(PIC)
MYCFLAGS= $(CFLAGS) -O1
L= fi_lib.a
T= fi_test

all:	$L

$L:	?_*.c *.h
	$(CC) $(MYCFLAGS) -c ?_*.c
	ar rcu $L *.o
	-rm -f *.o

test:	$T
	echo 1 | ./$T

$T:	$T.c $L
	$(CC) $(MYCFLAGS) -o $T $T.c $L -lm

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