blob: 9860622cbb151126571ef0962cdab5735c59c5dd [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Dave Youngc6dd8972012-03-28 14:42:55 -07002# Makefile for vm tools
Borislav Petkov5a439642013-02-20 16:32:33 +01003#
Lucas Stachcf016992020-04-20 18:14:23 -07004include ../scripts/Makefile.include
5
Joonsoo Kim48c96a32014-12-12 16:56:01 -08006TARGETS=page-types slabinfo page_owner_sort
Borislav Petkov5a439642013-02-20 16:32:33 +01007
Borislav Petkov553873e2013-12-09 17:14:23 +01008LIB_DIR = ../lib/api
Andi Kleen4933f552015-05-14 15:16:53 -07009LIBS = $(LIB_DIR)/libapi.a
Dave Youngc6dd8972012-03-28 14:42:55 -070010
Borislav Petkov5a439642013-02-20 16:32:33 +010011CFLAGS = -Wall -Wextra -I../lib/
Borislav Petkov553873e2013-12-09 17:14:23 +010012LDFLAGS = $(LIBS)
Dave Youngc6dd8972012-03-28 14:42:55 -070013
Daniel Thompson09375772017-02-22 15:40:12 -080014all: $(TARGETS)
15
Borislav Petkov553873e2013-12-09 17:14:23 +010016$(TARGETS): $(LIBS)
Borislav Petkov5a439642013-02-20 16:32:33 +010017
Borislav Petkov553873e2013-12-09 17:14:23 +010018$(LIBS):
19 make -C $(LIB_DIR)
Borislav Petkov5a439642013-02-20 16:32:33 +010020
Dave Youngc6dd8972012-03-28 14:42:55 -070021%: %.c
Borislav Petkov5a439642013-02-20 16:32:33 +010022 $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
Dave Youngc6dd8972012-03-28 14:42:55 -070023
24clean:
Joonsoo Kim48c96a32014-12-12 16:56:01 -080025 $(RM) page-types slabinfo page_owner_sort
Borislav Petkov553873e2013-12-09 17:14:23 +010026 make -C $(LIB_DIR) clean
Daniel Thompson09375772017-02-22 15:40:12 -080027
28sbindir ?= /usr/sbin
29
30install: all
31 install -d $(DESTDIR)$(sbindir)
32 install -m 755 -p $(TARGETS) $(DESTDIR)$(sbindir)