Makefile 811 B

123456789101112131415161718192021222324252627282930
  1. QVM_DIR=qvm-tools
  2. QUBES_DIR=qubes-tools
  3. PANDOC=pandoc -s -f rst -t man
  4. QVM_DOCS=$(patsubst %.rst,%.1.gz,$(wildcard $(QVM_DIR)/*.rst))
  5. QUBES_DOCS=$(patsubst %.rst,%.1.gz,$(wildcard $(QUBES_DIR)/*.rst))
  6. help:
  7. @echo "make rst=example.rst preview -- generate manpage preview from example.rst"
  8. @echo "make manpages -- generate manpages"
  9. @echo "make install -- generate manpages and copy them to /usr/share/man"
  10. install: manpages
  11. mkdir -p $(DESTDIR)/usr/share/man/man1
  12. cp $(QVM_DOCS) $(DESTDIR)/usr/share/man/man1/
  13. cp $(QUBES_DOCS) $(DESTDIR)/usr/share/man/man1/
  14. %.1: %.rst
  15. $(PANDOC) $< > $@
  16. %.1.gz: %.1
  17. gzip -f $<
  18. manpages: $(QVM_DOCS) $(QUBES_DOCS) $(VM_DOCS)
  19. preview: $(rst)
  20. pandoc -s -f rst -t man $(rst) | groff -mandoc -Tlatin1 | less -R
  21. clean:
  22. rm -f $(QVM_DOCS) $(QUBES_DOCS) $(VM_DOCS)