Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Dave Young | c6dd897 | 2012-03-28 14:42:55 -0700 | [diff] [blame] | 2 | # Makefile for vm tools |
Borislav Petkov | 5a43964 | 2013-02-20 16:32:33 +0100 | [diff] [blame] | 3 | # |
Lucas Stach | cf01699 | 2020-04-20 18:14:23 -0700 | [diff] [blame] | 4 | include ../scripts/Makefile.include |
5 | |||||
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 6 | TARGETS=page-types slabinfo page_owner_sort |
Borislav Petkov | 5a43964 | 2013-02-20 16:32:33 +0100 | [diff] [blame] | 7 | |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 8 | LIB_DIR = ../lib/api |
Andi Kleen | 4933f55 | 2015-05-14 15:16:53 -0700 | [diff] [blame] | 9 | LIBS = $(LIB_DIR)/libapi.a |
Dave Young | c6dd897 | 2012-03-28 14:42:55 -0700 | [diff] [blame] | 10 | |
Borislav Petkov | 5a43964 | 2013-02-20 16:32:33 +0100 | [diff] [blame] | 11 | CFLAGS = -Wall -Wextra -I../lib/ |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 12 | LDFLAGS = $(LIBS) |
Dave Young | c6dd897 | 2012-03-28 14:42:55 -0700 | [diff] [blame] | 13 | |
Daniel Thompson | 0937577 | 2017-02-22 15:40:12 -0800 | [diff] [blame] | 14 | all: $(TARGETS) |
15 | |||||
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 16 | $(TARGETS): $(LIBS) |
Borislav Petkov | 5a43964 | 2013-02-20 16:32:33 +0100 | [diff] [blame] | 17 | |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 18 | $(LIBS): |
19 | make -C $(LIB_DIR) | ||||
Borislav Petkov | 5a43964 | 2013-02-20 16:32:33 +0100 | [diff] [blame] | 20 | |
Dave Young | c6dd897 | 2012-03-28 14:42:55 -0700 | [diff] [blame] | 21 | %: %.c |
Borislav Petkov | 5a43964 | 2013-02-20 16:32:33 +0100 | [diff] [blame] | 22 | $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) |
Dave Young | c6dd897 | 2012-03-28 14:42:55 -0700 | [diff] [blame] | 23 | |
24 | clean: | ||||
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 25 | $(RM) page-types slabinfo page_owner_sort |
Borislav Petkov | 553873e | 2013-12-09 17:14:23 +0100 | [diff] [blame] | 26 | make -C $(LIB_DIR) clean |
Daniel Thompson | 0937577 | 2017-02-22 15:40:12 -0800 | [diff] [blame] | 27 | |
28 | sbindir ?= /usr/sbin | ||||
29 | |||||
30 | install: all | ||||
31 | install -d $(DESTDIR)$(sbindir) | ||||
32 | install -m 755 -p $(TARGETS) $(DESTDIR)$(sbindir) |