From: Tavian Barnes Date: Tue, 3 Oct 2023 20:25:56 +0000 (-0400) Subject: build: New lint flag X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e3ebe734ab047418a3c26cd7eca53fc7f4f60111;p=bfs.git build: New lint flag --- 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))