1# SPDX-License-Identifier: GPL-2.0 2# Makefile for vm tools 3# 4include ../scripts/Makefile.include 5 6BUILD_TARGETS=page-types slabinfo page_owner_sort thp_swap_allocator_test 7INSTALL_TARGETS = $(BUILD_TARGETS) thpmaps 8 9LIB_DIR = ../lib/api 10LIBS = $(LIB_DIR)/libapi.a 11 12CFLAGS += -Wall -Wextra -I../lib/ -pthread 13LDFLAGS += $(LIBS) -pthread 14 15all: $(BUILD_TARGETS) 16 17$(BUILD_TARGETS): $(LIBS) 18 19$(LIBS): 20 make -C $(LIB_DIR) 21 22%: %.c 23 $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) 24 25clean: 26 $(RM) page-types slabinfo page_owner_sort 27 make -C $(LIB_DIR) clean 28 29sbindir ?= /usr/sbin 30 31install: all 32 install -d $(DESTDIR)$(sbindir) 33 install -m 755 -p $(INSTALL_TARGETS) $(DESTDIR)$(sbindir) 34