CC=g++
FLAGS=-g
LIB=-framework GLUT -framework OpenGL

cube: cube.o control.o matrix.o textures.o
	$(CC) $(FLAGS) $(LIB) -o $@ $^

matrix.o: matrix.c matrix.h
	$(CC) $(FLAGS) -c $<

cube.o: cube.cpp cube.h
	$(CC) $(FLAGS) $(LIB) -c $<

control.o: control.c cube.h
	$(CC) $(FLAGS) $(LIB) -c $<

run: cube
	./cube
