CC = gcc
CFLAGS = -std=c11 -Wall -Wextra -Wpedantic -g

TARGET = tests_16oct
SOURCES = tests_16oct.c exo_cat.c exo_fread.c exo_rwmat.c
OBJECTS = $(SOURCES:.c=.o)

.PHONY: all clean rebuild

all: $(TARGET)

$(TARGET): $(OBJECTS)
	$(CC) $(CFLAGS) -o $@ $^

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

tests_16oct.o: exo_cat.h exo_fread.h exo_rwmat.h
exo_cat.o: exo_cat.h
exo_fread.o: exo_fread.h
exo_rwmat.o: exo_rwmat.h

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

rebuild: clean all
