Append to CFLAGS, instead of replacing them

The makefile already use (directly, or indirectly) CPPFLAGS and
LDFLAGS, so it makes sense to also use the user provided CFLAGS.

One example where this is necessary is if the user has set
CPPFLAGS=”-D_FORTIFY_SOURCE=2”, which, before this patch, results
in (even if the user has set CFLAGS=-O2):

/usr/include/features.h:397:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) -Werror=cpp]
This commit is contained in:
Daniel Eklöf 2021-08-06 22:58:26 +02:00 committed by Leon Henrik Plickat
parent 06b9e5aa17
commit a385b761bd

View File

@ -4,7 +4,7 @@ PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/share/man
CFLAGS=-Wall -Werror -Wextra -Wpedantic -Wno-unused-parameter -Wconversion -Wformat-security -Wformat -Wsign-conversion -Wfloat-conversion -Wunused-result
CFLAGS+=-Wall -Werror -Wextra -Wpedantic -Wno-unused-parameter -Wconversion -Wformat-security -Wformat -Wsign-conversion -Wfloat-conversion -Wunused-result
LIBS=-lwayland-client
OBJ=wlopm.o wlr-output-power-management-unstable-v1.o xdg-output-unstable-v1.o
GEN=wlr-output-power-management-unstable-v1.c wlr-output-power-management-unstable-v1.h xdg-output-unstable-v1.c xdg-output-unstable-v1.h