blob: 006029456988d637d74a1da983747ce5a9625e1f [file] [log] [blame]
Dave Youngc6dd8972012-03-28 14:42:55 -07001# Makefile for vm tools
Borislav Petkov5a439642013-02-20 16:32:33 +01002#
Joonsoo Kim48c96a32014-12-12 16:56:01 -08003TARGETS=page-types slabinfo page_owner_sort
Borislav Petkov5a439642013-02-20 16:32:33 +01004
Borislav Petkov553873e2013-12-09 17:14:23 +01005LIB_DIR = ../lib/api
Andi Kleen4933f552015-05-14 15:16:53 -07006LIBS = $(LIB_DIR)/libapi.a
Dave Youngc6dd8972012-03-28 14:42:55 -07007
8CC = $(CROSS_COMPILE)gcc
Borislav Petkov5a439642013-02-20 16:32:33 +01009CFLAGS = -Wall -Wextra -I../lib/
Borislav Petkov553873e2013-12-09 17:14:23 +010010LDFLAGS = $(LIBS)
Dave Youngc6dd8972012-03-28 14:42:55 -070011
Daniel Thompson09375772017-02-22 15:40:12 -080012all: $(TARGETS)
13
Borislav Petkov553873e2013-12-09 17:14:23 +010014$(TARGETS): $(LIBS)
Borislav Petkov5a439642013-02-20 16:32:33 +010015
Borislav Petkov553873e2013-12-09 17:14:23 +010016$(LIBS):
17 make -C $(LIB_DIR)
Borislav Petkov5a439642013-02-20 16:32:33 +010018
Dave Youngc6dd8972012-03-28 14:42:55 -070019%: %.c
Borislav Petkov5a439642013-02-20 16:32:33 +010020 $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
Dave Youngc6dd8972012-03-28 14:42:55 -070021
22clean:
Joonsoo Kim48c96a32014-12-12 16:56:01 -080023 $(RM) page-types slabinfo page_owner_sort
Borislav Petkov553873e2013-12-09 17:14:23 +010024 make -C $(LIB_DIR) clean
Daniel Thompson09375772017-02-22 15:40:12 -080025
26sbindir ?= /usr/sbin
27
28install: all
29 install -d $(DESTDIR)$(sbindir)
30 install -m 755 -p $(TARGETS) $(DESTDIR)$(sbindir)