.PHONY: clean, mrproper
CC = gcc
CFLAGS = -g -Wall

all: ex1 ex2 ex3 ex4 ex5 ex6 ex7 group

group: group.o mergeSort.o
	$(CC) $(CFLAGS) -o $@ $+

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

%: %.o
	$(CC) $(CFLAGS) -o $@ $+

clean:
	rm -f *.o core.*

mrproper: clean
	rm -f ex1

run: group
	./$<

graph: run
	graph -Tpng plot > plot.png
	nsxiv plot.png
