Makefile
This commit is contained in:
parent
21fc38a875
commit
23273d09e2
1 changed files with 24 additions and 0 deletions
24
Makefile
Normal file
24
Makefile
Normal file
|
@ -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
|
Loading…
Reference in a new issue