[PATCH liburing 1/4] Makefiles: Support specifying CFLAGS on the command line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch makes the liburing build work as expected for e.g. the following
command:

make CFLAGS=-m32

and avoids that the build fails as follows for the above command:

make[1]: Entering directory 'liburing/test'
cc -m32 -o poll poll.c -luring
/usr/bin/ld: cannot find -luring
collect2: error: ld returned 1 exit status
Makefile:18: recipe for target 'poll' failed
make[1]: *** [poll] Error 1
make[1]: Leaving directory 'software/liburing/test'
Makefile:12: recipe for target 'all' failed
make: *** [all] Error 2

Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
 examples/Makefile | 3 ++-
 src/Makefile      | 2 +-
 test/Makefile     | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/examples/Makefile b/examples/Makefile
index 6fe9bb9d15b2..ed73fcdcdaa2 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -1,4 +1,5 @@
-CFLAGS ?= -g -O2 -Wall -D_GNU_SOURCE -L../src/
+CFLAGS ?= -g -O2
+override CFLAGS += -Wall -D_GNU_SOURCE -L../src/
 
 all_targets += io_uring-test io_uring-cp link-cp
 
diff --git a/src/Makefile b/src/Makefile
index b68b57e73013..954e05ea6160 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,7 +3,7 @@ includedir=$(prefix)/include
 libdir=$(prefix)/lib
 
 CFLAGS ?= -g -fomit-frame-pointer -O2
-CFLAGS += -Wall -I.
+override CFLAGS += -Wall -I.
 SO_CFLAGS=-shared -fPIC $(CFLAGS)
 L_CFLAGS=$(CFLAGS)
 LINK_FLAGS=
diff --git a/test/Makefile b/test/Makefile
index b94e29ecbbff..52b4c9e53d22 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,4 +1,5 @@
-CFLAGS ?= -g -O2 -Wall -D_GNU_SOURCE -L../src/
+CFLAGS ?= -g -O2
+override CFLAGS += -Wall -D_GNU_SOURCE -L../src/
 
 all_targets += poll poll-cancel ring-leak fsync io_uring_setup io_uring_register \
 	       io_uring_enter nop sq-full cq-full 35fa71a030ca-test \
-- 
2.22.0.410.gd8fdbe21b5-goog




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux