Formatting target using clang-format
This commit is contained in:
parent
c88d6cefa3
commit
c49f02d8d7
1 changed files with 6 additions and 0 deletions
6
Makefile
6
Makefile
|
@ -11,6 +11,9 @@ BUILD_DIR := build
|
||||||
# Source files
|
# Source files
|
||||||
SRCS := $(wildcard $(SRC_DIR)/*.c)
|
SRCS := $(wildcard $(SRC_DIR)/*.c)
|
||||||
|
|
||||||
|
# Header files (used for formatting)
|
||||||
|
HEADERS := $(wildcard $(SRC_DIR)/*.h)
|
||||||
|
|
||||||
# Object files
|
# Object files
|
||||||
OBJS := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.o,$(SRCS))
|
OBJS := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.o,$(SRCS))
|
||||||
|
|
||||||
|
@ -33,6 +36,9 @@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
|
||||||
run: $(TARGET)
|
run: $(TARGET)
|
||||||
./$(TARGET)
|
./$(TARGET)
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
clang-format -i $(SRCS) $(HEADERS)
|
||||||
|
|
||||||
# Clean rule
|
# Clean rule
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(BUILD_DIR) $(TARGET)
|
rm -rf $(BUILD_DIR) $(TARGET)
|
||||||
|
|
Loading…
Reference in a new issue