CC = clang
CFLAGS = -Wall -Wextra -O2 -std=c11
SRCDIR = src

SOURCES = $(SRCDIR)/hash_matrix.c $(SRCDIR)/lookup_table.c $(SRCDIR)/bromberg_sl2.c $(SRCDIR)/args.c $(SRCDIR)/main.c
OBJECTS = $(SOURCES:.c=.o)
TARGET = potcc

.PHONY: all clean

all: $(TARGET)

$(TARGET): $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET)
	rm -f $(OBJECTS)

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

clean:
	rm -f $(OBJECTS) $(TARGET)
