From e3ebe734ab047418a3c26cd7eca53fc7f4f60111 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 3 Oct 2023 16:25:56 -0400 Subject: build: New lint flag --- GNUmakefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 8154240..c1296f9 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -166,6 +166,13 @@ LOCAL_CFLAGS += --coverage LOCAL_CFLAGS := $(patsubst -std=c%,-std=gnu%,$(LOCAL_CFLAGS)) endif +ifneq ($(filter lint,$(MAKECMDGOALS)),) +LOCAL_CPPFLAGS += \ + -D_FORTIFY_SOURCE=3 \ + -DBFS_LINT +LOCAL_CFLAGS += -Werror -O2 +endif + ifneq ($(filter release,$(MAKECMDGOALS)),) LOCAL_CPPFLAGS += -DNDEBUG CFLAGS := $(DEFAULT_CFLAGS) -O3 -flto=auto @@ -181,7 +188,7 @@ bfs: $(BIN)/bfs .PHONY: bfs # Goals that are treated like flags by this makefile -FLAG_GOALS := asan lsan msan tsan ubsan gcov release +FLAG_GOALS := asan lsan msan tsan ubsan gcov lint release # These are the remaining non-flag goals GOALS := $(filter-out $(FLAG_GOALS),$(MAKECMDGOALS)) -- cgit v1.2.3