Skip to contentSkip to conversation

tools/vm: add missing Makefile rules

PATCH New [email protected] 1 participant 1 message Feb 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 9/142 tools/vm: add missing Makefile rules

From: Daniel Thompson <[email protected]>
Subject: tools/vm: add missing Makefile rules

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.

---

 tools/vm/Makefile |    8 ++++++++
 1 file changed, 8 insertions(+)
tools/vm/Makefile renamed from tools/vm/Makefile~tools-vm-add-missing-makefile-rules +8 -0
diff -puN tools/vm/Makefile~tools-vm-add-missing-makefile-rules tools/vm/Makefile
@@ -9,6 +9,8 @@ CC = $(CROSS_COMPILE)gcc
 CFLAGS = -Wall -Wextra -I../lib/
 LDFLAGS = $(LIBS)
 
+all: $(TARGETS)
+
 $(TARGETS): $(LIBS)
 
 $(LIBS):
@@ -20,3 +22,9 @@ $(LIBS):
 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)

_