diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ce1d577 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT + +CC = gcc +CFLAGS = -Wall -Wextra -Werror -Wno-unused-parameter +CFLAGS += -Wno-unused-variable -Wno-unused-function +CFLAGS += -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-label + +C_SOURCES = $(wildcard *.c) +C_HEADERS = $(wildcard *.h) +OBJECTS = $(C_SOURCES:.c=.o) + +all: $(OBJECTS) + +%.o: %.c $(C_HEADERS) + @echo "CC $<" + @$(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(OBJECTS) + +format: + clang-format -i $(C_SOURCES) $(C_HEADERS) + +.PHONY: all clean format \ No newline at end of file