[PATCH v2] makedumpfile: honor the CFLAGS from environment variables

Kairui Song kasong at redhat.com
Mon Jan 28 19:14:15 PST 2019


This makes it possible to pass in extra cflags, for example, hardening
flags could be passed in with environment variable when building a
hardened package.

Also introduce a CFLAGS_BASE to hold common CFLAGS, which simplify the
CFLAGS definition.

Suggested-by: Kazuhito Hagio <k-hagio at ab.jp.nec.com>
Signed-off-by: Kairui Song <kasong at redhat.com>
---
Update from V1:
  - Use a CFLAGS_BASE to simplify CFLAGS definition
  - Use immediate set rather than lazy set to avoid unexpected
    flag duplication

 Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 612b9d0..bca9984 100644
--- a/Makefile
+++ b/Makefile
@@ -8,11 +8,10 @@ ifeq ($(strip $CC),)
 CC	= gcc
 endif
 
-CFLAGS = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-	  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-	  -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"'
-CFLAGS_ARCH	= -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-		    -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+CFLAGS_BASE := $(CFLAGS) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
+                -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+CFLAGS      := $(CFLAGS_BASE) -DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"'
+CFLAGS_ARCH := $(CFLAGS_BASE)
 # LDFLAGS = -L/usr/local/lib -I/usr/local/include
 
 HOST_ARCH := $(shell uname -m)
-- 
2.20.1




More information about the kexec mailing list