diff mbox

[4/4] Makefile: Adding OPT variable for optmize level

Message ID CANeU7Q=SHC7ca-FMkud58nr+zxnhWe1uRfN1i4erkmFpraSpGg@mail.gmail.com (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Christopher Li Aug. 13, 2017, 7:12 p.m. UTC
So that some one can do "make OPT=0" for compiling
sparse with -O0.

Signed-off-by: Christopher Li <sparse@chrisli.org>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 9db6b15..dfda866 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,8 @@  OS = linux


 CC = gcc
-CFLAGS = -O2 -finline-functions -fno-strict-aliasing -g
+OPT = 2
+CFLAGS = -O$(OPT) -finline-functions -fno-strict-aliasing -g
 CFLAGS += -Wall -Wwrite-strings
 ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS)
 DBG_CFLAGS = $(ALL_CFLAGS) -DSPARSE_DEBUG