Formatting target using clang-format

This commit is contained in:
Imbus 2024-03-27 06:39:47 +01:00
parent c88d6cefa3
commit c49f02d8d7

View file

@ -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)