COMPILE = gcc -Wall -pedantic

all: applyLines.c groupLines.c threadLines.c applyElements.c groupElements.c threadElements.c sequential.c matrix
	$(COMPILE) matrix.c applyLines.c -o applyLines
	$(COMPILE) matrix.c groupLines.c -o groupLines
	$(COMPILE) matrix.c threadLines.c -o threadLines
	$(COMPILE) matrix.c applyElements.c -o applyElements
	$(COMPILE) matrix.c groupElements.c -o groupElements
	$(COMPILE) matrix.c threadElements.c -o threadElements
	$(COMPILE) matrix.c sequential.c -o sequential
	
lines: applyLines.c groupLines.c threadLines.c matrix
	$(COMPILE) matrix.c applyLines.c -o applyLines
	$(COMPILE) matrix.c groupLines.c -o groupLines
	$(COMPILE) matrix.c threadLines.c -o threadLines

elements: applyElements.c groupElements.c threadElements.c matrix
	$(COMPILE) matrix.c applyElements.c -o applyElements
	$(COMPILE) matrix.c groupElements.c -o groupElements
	$(COMPILE) matrix.c threadElements.c -o threadElements

matrix: matrix.c matrix.h
	$(COMPILE) -c matrix.c

clean:
	rm -rf *.o *~

cleanAll:
	clean
	rm -rf applyLines groupLines threadLines applyElements groupElements threadElements sequential