# Makefile for Filesystem Test Suite

# Compiler and compiler flags
CC = gcc
CFLAGS = -Wall -ggdb3 -O0

# Define the executable name
TARGET = fs_tests

# Define source files
SOURCES = main.c fs_tests.c utils.c
# Define object files
OBJECTS = $(SOURCES:.c=.o)
# Define header files
HEADERS = fs_tests.h utils.h

# Default target
all: $(TARGET)

# Rule to create the executable
$(TARGET): $(OBJECTS)
	$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS)

# Rule to create object files
%.o: %.c $(HEADERS)
	$(CC) $(CFLAGS) -c $< -o $@

# Clean target to remove build artifacts
clean:
	rm -f $(TARGET) $(OBJECTS)

test:
	mkdir /mnt/ctsecfs/fs_tests && ./fs_tests /mnt/ctsecfs/fs_tests && rm /mnt/ctsecfs/fs_tests -rf
.PHONY: all clean

