]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Fix passing CFLAGS on the make command line.
authorAndy Lutomirski <luto@kernel.org>
Mon, 15 Apr 2019 17:48:05 +0000 (10:48 -0700)
committerAndy Lutomirski <luto@kernel.org>
Mon, 15 Apr 2019 17:48:05 +0000 (10:48 -0700)
Commit 254bcd6b2343 ("Fix CFLAGS parameter") only fixed the problem
if the variable came from the environment, not if it came from the
command line.  Fix it using 'override'.  See the GNU Make manual,
section 6.7 ("Overriding variables") for details.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Makefile

index 3a4e2239254f0f4a33ca0e575e6e0a35dcc6a546..25c65ab09d6740db862b0154a266e69f1bbb6194 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 CFLAGS ?= -O2 -g -Wall -Werror
-CFLAGS += -std=gnu99 -I.
-CPPFLAGS += -D_GNU_SOURCE -D__CHECK_ENDIAN__
+override CFLAGS += -std=gnu99 -I.
+override CPPFLAGS += -D_GNU_SOURCE -D__CHECK_ENDIAN__
 LIBUUID = $(shell $(LD) -o /dev/null -luuid >/dev/null 2>&1; echo $$?)
 NVME = nvme
 INSTALL ?= install