
RANLIB=true

PINC_BASE= ../inc
INC_BASE= ../../include/GL

INC=	$(PINC_BASE)/rot.h $(PINC_BASE)/vvector.h $(INC_BASE)/gutil.h

OBJS= 	rotate_f.o rotate_d.o rot_prince_f.o rot_prince_d.o	\
	urotate_f.o urotate_d.o view_f.o view_d.o

CC=	cc -O  -I.  -I$(INC_BASE) -I$(PINC_BASE) -I../../../../include

# CC=	cc -p

all: libmatrix.a 

# --------------------------------------------------------- #

libmatrix.a: $(OBJS)
	-rm -f libmatrix.a
	ar vru libmatrix.a $(OBJS)
	$(RANLIB) libmatrix.a
	mv libmatrix.a ../../lib/libmatrix.a
	touch libmatrix.a

# --------------------------------------------------------- #

rotate_f.o:	rotate.c $(PINC_BASE)/port.h
	$(CC) -c rotate.c
	mv rotate.o rotate_f.o

rotate_d.o:	rotate.c $(PINC_BASE)/port.h
	$(CC) -c rotate.c -D__GUTIL_DOUBLE
	mv rotate.o rotate_d.o

# --------------------------------------------------------- #

rot_prince_f.o:	rot_prince.c $(PINC_BASE)/rot.h $(PINC_BASE)/port.h
	$(CC) -c rot_prince.c
	mv rot_prince.o rot_prince_f.o

rot_prince_d.o:	rot_prince.c $(PINC_BASE)/rot.h $(PINC_BASE)/port.h
	$(CC) -c rot_prince.c -D__GUTIL_DOUBLE
	mv rot_prince.o rot_prince_d.o

# --------------------------------------------------------- #

urotate_f.o:	urotate.c $(PINC_BASE)/port.h $(INC_BASE)/gutil.h
	$(CC) -c urotate.c
	mv urotate.o urotate_f.o


urotate_d.o:	urotate.c $(PINC_BASE)/port.h $(INC_BASE)/gutil.h
	$(CC) -c urotate.c -D__GUTIL_DOUBLE
	mv urotate.o urotate_d.o

# --------------------------------------------------------- #

view_f.o:	view.c $(INC)
	$(CC) -c view.c
	mv view.o view_f.o

view_d.o:	view.c $(INC)
	$(CC) -c view.c  -D__GUTIL_DOUBLE
	mv view.o view_d.o

# --------------------------------------------------------- #

clean:
	-rm -f *.o junk core a.out

realclean:
	-rm -f junk core a.out *.o *.a
# --------------------------------------------------------- #

