]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
Fix CFLAGS parameter
authorBreno Leitao <leitao@debian.org>
Mon, 21 Jan 2019 12:03:24 +0000 (07:03 -0500)
committerBreno Leitao <leitao@debian.org>
Mon, 21 Jan 2019 12:03:24 +0000 (07:03 -0500)
Currently nvme-cli 1.7 is not compiling on Debian because the Debian helper
(compilation toolkit) does pass a CFLAGS variable, thus, avoiding the
initial definition (CFLAGS ?= -O2 -g -Wall -Werror -I.)

The problem is that -I should not be removed, otherwise the code does not
compile, with the following bug:

cc -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D__CHECK_ENDIAN__ -g -O2 -fdebug-prefix-map=/home/breno/nvme/nvme-cli-1.7=. -fstack-protector-strong -Wformat -Werror=format-security -std=gnu99 -DLIBUUID -DNVME_VERSION='"1.7"' -o plugins/intel/intel-nvme.o -c plugins/intel/intel-nvme.c
plugins/intel/intel-nvme.c:10:18: fatal error: nvme.h: No such file or directory
compilation terminated.

This patch just moves the -I parameter to part of the CFLAGS that is not
replaced by dh's CFLAGS.

Signed-off-by: Breno Leitao <leitao@debian.org>
Makefile

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