From bfaa5b5c087d3e3e36991583f326cbef88407ebb Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sun, 24 Feb 2019 15:09:37 +0200 Subject: Makefile: Change default CPP/CFLAGS -D_FORTIFY_SOURCE=2 and -O2 enables some useful diagnosis. Move WARNINGS into CFLAGS ?= assignment, as they are compiler specific. The default compilation flags assumes gcc, but can easily be changed by overriding CFLAGS and CPPFLAGS. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e80632d..bfcca00 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,9 @@ MAKEFLAGS += --no-builtin-rules WARNINGS := -Wall -Wextra -Wpedantic -Wformat=2 -Wstrict-aliasing=3 -Wstrict-overflow=5 -Wstack-usage=12500 \ -Wfloat-equal -Wcast-align -Wpointer-arith -Wchar-subscripts -Warray-bounds=2 -override CFLAGS ?= -g -override CFLAGS += -std=c99 $(WARNINGS) +override CFLAGS ?= -g -O2 $(WARNINGS) +override CFLAGS += -std=c99 +override CPPFLAGS ?= -D_FORTIFY_SOURCE=2 override CPPFLAGS += -Isrc bins = ptrace-region-rw ptrace-address-rw uio-region-rw uio-address-rw memview binsearch bintrim -- cgit v1.2.3-70-g09d2