update compile warning setting.

This commit is contained in:
Gatsby Van
2023-12-20 20:13:44 +08:00
parent 94bcdccd5b
commit 81037d042e
45 changed files with 56 additions and 52 deletions
+9 -5
View File
@@ -16,7 +16,7 @@ BIARRAY_SRC := $(wildcard ../src/bit_array/*.c ../src/bit_array/*.h)
CC ?= gcc
# Compiler flags
CFLAGS ?= --std=c11 -O0 -I../src -Wall -Werror -pedantic -g -Wno-sign-compare -Wno-comment
CFLAGS ?= --std=c11 -O0 -I../src -Wall -Wformat=2 -Werror -pedantic -g -Wno-sign-compare -Wno-comment
# Add sanitizer flags for identifying undefined behavior. The flags are
# different on macOS (AKA Darwin) and Windows/WSL/Linux.
@@ -27,13 +27,17 @@ else
CFLAGS += -m32 -fsanitize=address -fsanitize=undefined -D_GLIBCC_DEBUG
endif
tmc_board_unit_test: tmc_board_unit_test.c $(TMC_SRC) $(UTIL_SRC) $(COMMON_SRC) $(TEST_FRAME)
test: tmc_emulate_unit_test.exe linklayer_emulate_unit_test.exe
./tmc_emulate_unit_test.exe > tmc_emulate_unit_test.log
./linklayer_emulate_unit_test.exe > linklayer_emulate_unit_test.log
tmc_board_unit_test.exe: tmc_board_unit_test.c $(TMC_SRC) $(UTIL_SRC) $(COMMON_SRC) $(TEST_FRAME)
$(CC) $(CFLAGS) $(filter %.c, $^) -o $@
tmc_emulate_unit_test: tmc_emulate_unit_test.c $(TMC_SRC) $(UTIL_SRC) $(COMMON_SRC) $(TEST_FRAME)
tmc_emulate_unit_test.exe: tmc_emulate_unit_test.c $(TMC_SRC) $(UTIL_SRC) $(COMMON_SRC) $(TEST_FRAME)
$(CC) $(CFLAGS) -DEMULATION $(filter %.c, $^) -o $@
linklayer_emulate_unit_test: linklayer_emulate_unit_test.c \
linklayer_emulate_unit_test.exe: linklayer_emulate_unit_test.c \
$(LINK_SRC) \
$(BIARRAY_SRC) \
$(GEOMETRY_SRC) \
@@ -44,7 +48,7 @@ linklayer_emulate_unit_test: linklayer_emulate_unit_test.c \
$(TEST_FRAME)
$(CC) $(CFLAGS) -lm -DEMULATION $(filter %.c, $^) -o $@
clean:
rm -f *_unit_test
rm -f *.exe *.log
# Style check
CPD ?= $(PMD_HOME)/bin/run.sh cpd