mirror of
https://github.com/torvalds/linux.git
synced 2024-12-11 13:41:55 +00:00
e6d2c436ff
Right now there is no way to provide additional cflags/ldflags when building tools/vm binaries. And using eg. make CFLAGS=<options> 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=<options> LDFLAGS=<options> 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 <herton@redhat.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Justin Forbes <jforbes@redhat.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Scott Weaver <scweaver@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
33 lines
555 B
Makefile
33 lines
555 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# Makefile for vm tools
|
|
#
|
|
include ../scripts/Makefile.include
|
|
|
|
TARGETS=page-types slabinfo page_owner_sort
|
|
|
|
LIB_DIR = ../lib/api
|
|
LIBS = $(LIB_DIR)/libapi.a
|
|
|
|
CFLAGS += -Wall -Wextra -I../lib/
|
|
LDFLAGS += $(LIBS)
|
|
|
|
all: $(TARGETS)
|
|
|
|
$(TARGETS): $(LIBS)
|
|
|
|
$(LIBS):
|
|
make -C $(LIB_DIR)
|
|
|
|
%: %.c
|
|
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
|
|
|
clean:
|
|
$(RM) page-types slabinfo page_owner_sort
|
|
make -C $(LIB_DIR) clean
|
|
|
|
sbindir ?= /usr/sbin
|
|
|
|
install: all
|
|
install -d $(DESTDIR)$(sbindir)
|
|
install -m 755 -p $(TARGETS) $(DESTDIR)$(sbindir)
|