#
# makefile for VFlib 
#   by H.Kakugawa
#

# normal ..
#CC   = cc
COPT = -O

# gcc
#CC   = gcc
#COPT = -O2

all:	ZFlib.o JGlib.o VFlib.o VFlib.a

clean:
	rm -f *.o *.a core *~

VFlib.a: VFlib.o ZFlib.o JGlib.o VF.h config.h
	ar rcv VFlib.a VFlib.o ZFlib.o JGlib.o
	ranlib VFlib.a

VFlib.o: VFlib.c VF.h config.h
	$(CC) -c $(COPT) VFlib.c

ZFlib.o: ZFlib.c ZFlib.h
	$(CC) -c $(COPT) ZFlib.c

ZFlib-test.o: ZFlib.c ZFlib.h
	$(CC) -c $(COPT) -o ZFlib-test.o -DTEST ZFlib.c

JGlib-test.o: JGlib.c JGlib.h
	$(CC) -c $(COPT) -o JGlib-test.o -DTEST JGlib.c

JGlib.o: JGlib.c JGlib.h
	$(CC) -c $(COPT) JGlib.c

# test programs
test1:	test1.o VFlib.o
	$(CC) -o test1  test1.o VFlib.a $(FSLIB) -lX11 -lm

test2:	test2.o ZFlib-test.o
	$(CC) -o test2  test2.o ZFlib-test.o -lX11

test3:	test3.o JGlib-test.o
	$(CC) -o test3  test3.o JGlib-test.o -lX11

test1.o: test1.c 
	$(CC) -c $(COPT) test1.c

test2.o: test2.c 
	$(CC) -c $(COPT) test2.c

test3.o: test3.c 
	$(CC) -c $(COPT) test3.c



