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