34 lines
642 B
Makefile
Raw Normal View History

2026-01-21 18:59:54 +08:00
# SPDX-License-Identifier: GPL-2.0
# Makefile for vm tools
#
include ../scripts/Makefile.include
2026-01-29 22:25:33 +08:00
BUILD_TARGETS=page-types slabinfo page_owner_sort
INSTALL_TARGETS = $(BUILD_TARGETS) thpmaps
2026-01-21 18:59:54 +08:00
LIB_DIR = ../lib/api
LIBS = $(LIB_DIR)/libapi.a
2026-01-29 22:25:33 +08:00
CFLAGS += -Wall -Wextra -I../lib/ -pthread
LDFLAGS += $(LIBS) -pthread
2026-01-21 18:59:54 +08:00
2026-01-29 22:25:33 +08:00
all: $(BUILD_TARGETS)
2026-01-21 18:59:54 +08:00
2026-01-29 22:25:33 +08:00
$(BUILD_TARGETS): $(LIBS)
2026-01-21 18:59:54 +08:00
$(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)
2026-01-29 22:25:33 +08:00
install -m 755 -p $(INSTALL_TARGETS) $(DESTDIR)$(sbindir)