contacts: add a Makefile to generate docs and install
[git/mjg.git] / contrib / contacts / Makefile
bloba2990f0dcb53b19ed2da8f18ffb1fa1125e5b38d
1 # The default target of this Makefile is...
2 all::
4 -include ../../config.mak.autogen
5 -include ../../config.mak
7 prefix ?= /usr/local
8 gitexecdir ?= $(prefix)/libexec/git-core
9 mandir ?= $(prefix)/share/man
10 man1dir ?= $(mandir)/man1
11 htmldir ?= $(prefix)/share/doc/git-doc
13 ../../GIT-VERSION-FILE: FORCE
14 $(MAKE) -C ../../ GIT-VERSION-FILE
16 -include ../../GIT-VERSION-FILE
18 # this should be set to a 'standard' bsd-type install program
19 INSTALL ?= install
20 RM ?= rm -f
22 ASCIIDOC = asciidoc
23 XMLTO = xmlto
25 ifndef SHELL_PATH
26 SHELL_PATH = /bin/sh
27 endif
28 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
30 ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
31 MANPAGE_XSL = ../../Documentation/manpage-normal.xsl
33 GIT_CONTACTS := git-contacts
35 GIT_CONTACTS_DOC := git-contacts.1
36 GIT_CONTACTS_XML := git-contacts.xml
37 GIT_CONTACTS_TXT := git-contacts.txt
38 GIT_CONTACTS_HTML := git-contacts.html
40 doc: $(GIT_CONTACTS_DOC) $(GIT_CONTACTS_HTML)
42 install: $(GIT_CONTACTS)
43 $(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
44 $(INSTALL) -m 755 $(GIT_CONTACTS) $(DESTDIR)$(gitexecdir)
46 install-doc: install-man install-html
48 install-man: $(GIT_CONTACTS_DOC)
49 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
50 $(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
52 install-html: $(GIT_CONTACTS_HTML)
53 $(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
54 $(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
56 $(GIT_CONTACTS_DOC): $(GIT_CONTACTS_XML)
57 $(XMLTO) -m $(MANPAGE_XSL) man $^
59 $(GIT_CONTACTS_XML): $(GIT_CONTACTS_TXT)
60 $(ASCIIDOC) -b docbook -d manpage -f $(ASCIIDOC_CONF) \
61 -agit_version=$(GIT_VERSION) $^
63 $(GIT_CONTACTS_HTML): $(GIT_CONTACTS_TXT)
64 $(ASCIIDOC) -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) \
65 -agit_version=$(GIT_VERSION) $^
67 clean:
68 $(RM) $(GIT_CONTACTS)
69 $(RM) *.xml *.html *.1
71 .PHONY: FORCE