From a385b761bd0854c41264e6a543894368a2191d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 6 Aug 2021 22:58:26 +0200 Subject: [PATCH] Append to CFLAGS, instead of replacing them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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] --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4f7b62b..f32d3ba 100644 --- a/Makefile +++ b/Makefile @@ -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