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