blob: 5b1cba57e3b3a25dfa642c4afd1e17fb543cafbf [file] [log] [blame]
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +02001include ../../scripts/Makefile.include
2include ../../scripts/utilities.mak
Janosch Frankf9bc9e62016-05-18 13:26:21 +02003BINDIR=usr/bin
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +02004MANDIR=usr/share/man
5MAN1DIR=$(MANDIR)/man1
Janosch Frankf9bc9e62016-05-18 13:26:21 +02006
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +02007MAN1=kvm_stat.1
8
9A2X=a2x
10a2x_path := $(call get-executable,$(A2X))
11
12all: man
13
14ifneq ($(findstring $(MAKEFLAGS),s),s)
15 ifneq ($(V),1)
16 QUIET_A2X = @echo ' A2X '$@;
17 endif
18endif
19
20%.1: %.txt
21ifeq ($(a2x_path),)
22 $(error "You need to install asciidoc for man pages")
23else
24 $(QUIET_A2X)$(A2X) --doctype manpage --format manpage $<
25endif
26
27clean:
28 rm -f $(MAN1)
29
30man: $(MAN1)
31
32install-man: man
33 install -d -m 755 $(INSTALL_ROOT)/$(MAN1DIR)
34 install -m 644 kvm_stat.1 $(INSTALL_ROOT)/$(MAN1DIR)
35
36install-tools:
37 install -d -m 755 $(INSTALL_ROOT)/$(BINDIR)
Janosch Frankf9bc9e62016-05-18 13:26:21 +020038 install -m 755 -p "kvm_stat" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)"
Paolo Bonzinifd41b5a2016-05-24 10:41:15 +020039
40install: install-tools install-man
41.PHONY: all clean man install-tools install-man install