EXEC = main
CC = gcc
SRC = $(wildcard *.c)
OBJ = $(SRC:.c = .o)
CFLAG = -Wall -Wextra -g -O0

all: $(EXEC)

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

$(EXEC) : $(OBJ)
	$(CC) -o $@ $^

clean:
	rm -rf *.o