Commit 3dd22d2
Makefile: Add override directive to CFLAGS
It is perfectly legal to override CFLAGS on the command line,
but this doesn't work with libocxl:
$ make V=1 CFLAGS='-g'
VERSION_MAJOR=1 VERSION_MINOR=1 \
VERSION_PATCH=0 CC="gcc" CFLAGS="-g" \
./version.pl > src/libocxl_info.h
mkdir obj
gcc -g -c -o obj/afu.o src/afu.c
In file included from src/afu.c:17:
src/libocxl_internal.h:25:10: fatal error: libocxl.h: No such file or directory
25 | #include "libocxl.h"
| ^~~~~~~~~~~
compilation terminated.
This is especially painful for some building frameworks that rely on
that, eg. buildroot.
The GNU make documentation clearly indicates that overriding a variable
on the command line causes ordinary assignments to this variable in the
makefile to be ignored.
Use the override directive so that we can add the required items to
CFLAGS.
https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_6.html#SEC66
Signed-off-by: Greg Kurz <groug@kaod.org>1 parent 537e0ad commit 3dd22d2
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments