From e6d2c436ff693869e83a65e61643b922e193e162 Mon Sep 17 00:00:00 2001 From: "Herton R. Krzesinski" Date: Mon, 16 Jan 2023 19:49:21 -0300 Subject: [PATCH] tools/mm: allow users to provide additional cflags/ldflags Right now there is no way to provide additional cflags/ldflags when building tools/vm binaries. And using eg. make CFLAGS= will override the CFLAGS being set in the Makefile, making the build fail since it requires the include of the ../lib dir (for libapi). This change then allows you to specify: CFLAGS= LDFLAGS= make V=1 -C tools/vm And the options will be correctly appended as can be seen from the make output. Link: https://lkml.kernel.org/r/20230116224921.4106324-1-herton@redhat.com Signed-off-by: Herton R. Krzesinski Cc: Don Zickus Cc: Justin Forbes Cc: Vlastimil Babka Cc: Scott Weaver Signed-off-by: Andrew Morton --- tools/mm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mm/Makefile b/tools/mm/Makefile index 9860622cbb15..6c1da51f4177 100644 --- a/tools/mm/Makefile +++ b/tools/mm/Makefile @@ -8,8 +8,8 @@ TARGETS=page-types slabinfo page_owner_sort LIB_DIR = ../lib/api LIBS = $(LIB_DIR)/libapi.a -CFLAGS = -Wall -Wextra -I../lib/ -LDFLAGS = $(LIBS) +CFLAGS += -Wall -Wextra -I../lib/ +LDFLAGS += $(LIBS) all: $(TARGETS)