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