# Compiler and flags
CC = gcc
CFLAGS = -Wall -Wextra -O2 -MMD -MP  # For auto dependencies

# Executable name
TARGET = matrix_test_app

# Source files
SRCS = main.c matrix_utils.c matrix_mult.c

# Object and dependency files
OBJS = $(SRCS:.c=.o)
DEPS = $(SRCS:.c=.d)

# Default target
all: $(TARGET)

# Link rule
$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) -o $@ $^

# Include dependency files
-include $(DEPS)

# Clean up
clean:
	rm -f $(OBJS) $(DEPS) $(TARGET)

.PHONY: all clean
