diff --git a/Makefile b/Makefile index a793e04..712bf45 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ BUILD_DIR := build # Source files SRCS := $(wildcard $(SRC_DIR)/*.c) +# Header files (used for formatting) +HEADERS := $(wildcard $(SRC_DIR)/*.h) + # Object files OBJS := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.o,$(SRCS)) @@ -33,6 +36,9 @@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c run: $(TARGET) ./$(TARGET) +fmt: + clang-format -i $(SRCS) $(HEADERS) + # Clean rule clean: rm -rf $(BUILD_DIR) $(TARGET)