CC = g++
CCFLAGS = -Wall -O3 -finline

# ----- Example programs --------------------------------------------------------

PROG_SRC = LinearAlgebra.cpp Matrix.cpp Vector.cpp Quaternion.cpp Ray.cpp Tuple.cpp
PROG_OBJ = LinearAlgebra.o Matrix.o Vector.o Quaternion.o Ray.o Tuple.o
TARGET = libUsefulMath.a

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

all:    Makefile $(TARGET)

$(TARGET): $(PROG_OBJ)
	rm -f $(TARGET)
	ar cqs $(TARGET) $(PROG_OBJ)


LinearAlgebra.o: LinearAlgebra.cpp
	$(CC) $(CCFLAGS) -c LinearAlgebra.cpp -o LinearAlgebra.o -I.

Matrix.o: Matrix.cpp
	$(CC) $(CCFLAGS) -c Matrix.cpp -o Matrix.o -I.

Vector.o: Vector.cpp
	$(CC) $(CCFLAGS) -c Vector.cpp -o Vector.o -I.

Quaternion.o: Quaternion.cpp
	$(CC) $(CCFLAGS) -c Quaternion.cpp -o Quaternion.o -I.

Ray.o: Ray.cpp
	$(CC) $(CCFLAGS) -c Ray.cpp -o 	Ray.o -I.

Tuple.o: Tuple.cpp
	$(CC) $(CCFLAGS) -c Tuple.cpp -o Tuple.o -I.	

clean:
	rm $(TARGET) LinearAlgebra.o Matrix.o Vector.o Quaternion.o Ray.o Tuple.o

