1include ../../scripts/Makefile.include 2include ../../scripts/utilities.mak 3BINDIR=usr/bin 4MANDIR=usr/share/man 5MAN1DIR=$(MANDIR)/man1 6 7MAN1=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) 38 install -m 755 -p "kvm_stat" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)" 39 40install: install-tools install-man 41.PHONY: all clean man install-tools install-man install 42