Allow override of CFLAGS
authorDavid M. Lee <dlee@digium.com>
Thu, 31 Jan 2013 17:37:41 +0000 (18:37 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 31 Jan 2013 17:37:41 +0000 (18:37 +0100)
If you attempt to specify your own CFLAGS on the command line (such as
make CFLAGS="--whatever"), this would prevent -DFIO_VERSION from being
added to CFLAGS. This patch uses the override directive to allow the
flag to be appended to CFLAGS.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Makefile

index a4a478d9b400968311a4fa66086ccc669d248a61..45b20e61bcc77a78c981417f91b2df9fdc21b8a6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -177,7 +177,7 @@ FIO-VERSION-FILE: FORCE
        @$(SHELL) ./FIO-VERSION-GEN
 -include FIO-VERSION-FILE
 
-CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
+override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
 
 .c.o: .depend FORCE
        $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<