CPP = C:\cs455\MinGW32\bin\g++.exe
CPPFLAGS = -Wall -Igl
LIBS = -lopengl32 -lglu32 -lglut32
OBJ  = GLUTCallbacks.o GLUTMouseCallbacks.o MazeParser.o RenderOpenGL.o mainMaze.o
OBJS = ../SoftwareRenderer/FrameBuffer.o ../SoftwareRenderer/Scene.o ../SoftwareRenderer/Texture.o ../SoftwareRenderer/Triangle.o ../SoftwareRenderer/Vertex.o ../SoftwareRenderer/Vector.o ../SoftwareRenderer/Matrix.o
BIN  = mainMaze.exe
MAKE = C:/cs455/MinGW32/bin/mingw32-make.exe
RM = rm -f

.PHONY: all clean

all: mainMaze.exe

clean:
	${RM} $(OBJ) $(BIN) ; ${RM} ../SoftwareRenderer/$(OBJS)

$(BIN): $(OBJ)
	$(CPP) $(CPPFLAGS) -o $(BIN) $(OBJ) $(OBJS) $(LIBS)

GLUTCallbacks.o: GLUTCallbacks.cpp GLUTCallbacks.h RenderOpenGL.h Constants.h Timer.h MazeParser.h SoftwareRenderer.h
	$(CPP) $(CPPFLAGS) -c -o GLUTcallbacks.o GLUTcallbacks.cpp

GLUTMouseCallbacks.o: GLUTMouseCallbacks.cpp GLUTMouseCallbacks.h Constants.h SoftwareRenderer.h
	$(CPP) $(CPPFLAGS) -c -o GLUTMouseCallbacks.o GLUTMouseCallbacks.cpp

MazeParser.o: MazeParser.cpp MazeParser.h SoftwareRenderer.h
	$(CPP) $(CPPFLAGS) -c -o MazeParser.o MazeParser.cpp

RenderOpenGL.o: RenderOpenGL.cpp RenderOpenGL.h SoftwareRenderer.h
	$(CPP) $(CPPFLAGS) -c -o RenderOpenGL.o RenderOpenGL.cpp

mainMaze.o: mainMaze.cpp Constants.h GLUTCallbacks.h GLUTMouseCallbacks.h MazeParser.h SoftwareRenderer.h
	$(CPP) $(CPPFLAGS) -c -o mainMaze.o mainMaze.cpp

SoftwareRenderer.h: force_rebuild
	cd ../SoftwareRenderer ; $(MAKE)

force_rebuild :
	true
