Makefile 553 B

123456789101112131415161718192021222324252627282930313233
  1. # SPDX-License-Identifier: GPL-2.0
  2. # Makefile for vm tools
  3. #
  4. include ../scripts/Makefile.include
  5. TARGETS=page-types slabinfo page_owner_sort
  6. LIB_DIR = ../lib/api
  7. LIBS = $(LIB_DIR)/libapi.a
  8. CFLAGS = -Wall -Wextra -I../lib/
  9. LDFLAGS = $(LIBS)
  10. all: $(TARGETS)
  11. $(TARGETS): $(LIBS)
  12. $(LIBS):
  13. make -C $(LIB_DIR)
  14. %: %.c
  15. $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
  16. clean:
  17. $(RM) page-types slabinfo page_owner_sort
  18. make -C $(LIB_DIR) clean
  19. sbindir ?= /usr/sbin
  20. install: all
  21. install -d $(DESTDIR)$(sbindir)
  22. install -m 755 -p $(TARGETS) $(DESTDIR)$(sbindir)