mirror of
https://github.com/torvalds/linux.git
synced 2024-12-21 02:21:36 +00:00
0937577d5f
Currently the tools/vm Makefile has a rather arbitrary implicit build rule; page-types is the first value in TARGETS so lets just build that one! Additionally there is no install rule and this is needed for make -C tools vm_install to work properly. Provide a more sensible implicit build rule and a new install rule. Note that the variables names used by the install rule (DESTDIR and sbindir) are copied from prior-art in tools/power/cpupower. Link: http://lkml.kernel.org/r/20170113165630.27541-1-daniel.thompson@linaro.org Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
31 lines
506 B
Makefile
31 lines
506 B
Makefile
# Makefile for vm tools
|
|
#
|
|
TARGETS=page-types slabinfo page_owner_sort
|
|
|
|
LIB_DIR = ../lib/api
|
|
LIBS = $(LIB_DIR)/libapi.a
|
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
CFLAGS = -Wall -Wextra -I../lib/
|
|
LDFLAGS = $(LIBS)
|
|
|
|
all: $(TARGETS)
|
|
|
|
$(TARGETS): $(LIBS)
|
|
|
|
$(LIBS):
|
|
make -C $(LIB_DIR)
|
|
|
|
%: %.c
|
|
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
|
|
|
clean:
|
|
$(RM) page-types slabinfo page_owner_sort
|
|
make -C $(LIB_DIR) clean
|
|
|
|
sbindir ?= /usr/sbin
|
|
|
|
install: all
|
|
install -d $(DESTDIR)$(sbindir)
|
|
install -m 755 -p $(TARGETS) $(DESTDIR)$(sbindir)
|