CC= gcc -Wall 
LD= gcc 

CFLAGS= -g
LDFLAGS= -lGL -lglut

BIN= lightmaterial lightposition projection shapes texture transformation

.PHONY: all
all: $(BIN)

lightmaterial: lightmaterial.o glm.o
	$(LD) -o $@ $^ $(LDFLAGS)

lightposition: lightposition.o glm.o
	$(LD) -o $@ $^ $(LDFLAGS)

projection: projection.o glm.o
	$(LD) -o $@ $^ $(LDFLAGS)

shapes: shapes.o
	$(LD) -o $@ $^ $(LDFLAGS)

texture: texture.o glm.o
	$(LD) -o $@ $^ $(LDFLAGS)

transformation: transformation.o glm.o
	$(LD) -o $@ $^ $(LDFLAGS)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

.PHONY: clean
clean: 
	rm -f $(BIN) *.o 

.PHONY: tarball
tarball:
	-tar -zvcf mimtd2_GLtutor.tar.gz Makefile *.c *.h data/*
