blob: c3e36c60d477839e16b0bc6c1156946f165c1ecc [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +02002include ../../scripts/Makefile.include
3include ../../scripts/utilities.mak
Janosch Frankf9bc9e62016-05-18 13:26:21 +02004BINDIR=usr/bin
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +02005MANDIR=usr/share/man
6MAN1DIR=$(MANDIR)/man1
Janosch Frankf9bc9e62016-05-18 13:26:21 +02007
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +02008MAN1=kvm_stat.1
9
10A2X=a2x
11a2x_path := $(call get-executable,$(A2X))
12
13all: man
14
15ifneq ($(findstring $(MAKEFLAGS),s),s)
16 ifneq ($(V),1)
17 QUIET_A2X = @echo ' A2X '$@;
18 endif
19endif
20
21%.1: %.txt
22ifeq ($(a2x_path),)
23 $(error "You need to install asciidoc for man pages")
24else
25 $(QUIET_A2X)$(A2X) --doctype manpage --format manpage $<
26endif
27
28clean:
29 rm -f $(MAN1)
30
31man: $(MAN1)
32
33install-man: man
34 install -d -m 755 $(INSTALL_ROOT)/$(MAN1DIR)
35 install -m 644 kvm_stat.1 $(INSTALL_ROOT)/$(MAN1DIR)
36
37install-tools:
38 install -d -m 755 $(INSTALL_ROOT)/$(BINDIR)
Janosch Frankf9bc9e62016-05-18 13:26:21 +020039 install -m 755 -p "kvm_stat" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)"
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +020040
41install: install-tools install-man
42.PHONY: all clean man install-tools install-man install