1 # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors
2 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
6 RSYNC_DEST = ssoma.public-inbox.org:/srv/ssoma/
7 docs := README COPYING INSTALL $(shell git ls-files 'Documentation/*.txt')
10 PANDOC_OPTS = -f markdown --email-obfuscation=none
11 pandoc = $(PANDOC) $(PANDOC_OPTS)
19 m5 += ssoma_repository
23 man1 := $(addsuffix .1, $(m1))
24 man5 := $(addsuffix .5, $(m5))
25 man7 := $(addsuffix .7, $(m7))
29 man: $(man1) $(man5) $(man7)
32 mandir ?= $(prefix)/share/man
33 man1dir = $(mandir)/man1
34 man5dir = $(mandir)/man5
35 man7dir = $(mandir)/man7
38 test -z "$(man1)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
39 test -z "$(man5)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
40 test -z "$(man7)" || $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
41 test -z "$(man1)" || $(INSTALL) -m 644 $(man1) $(DESTDIR)$(man1dir)
42 test -z "$(man5)" || $(INSTALL) -m 644 $(man5) $(DESTDIR)$(man5dir)
43 test -z "$(man7)" || $(INSTALL) -m 644 $(man7) $(DESTDIR)$(man7dir)
44 %.1 %.5 %.7 : Documentation/%.txt
45 $(pandoc) -s -t man < $< > $@+ && mv $@+ $@
47 txt2pre = ./Documentation/txt2pre < $< > $@+ && touch -r $< $@+ && mv $@+ $@
48 txt = INSTALL README COPYING
55 docs_html := index.html INSTALL.html
57 gz_docs := $(addsuffix .gz, $(docs) $(docs_html))
58 rsync_docs := $(gz_docs) $(docs) $(txt) $(docs_html)
60 gzip -9 --rsyncable < $< > $@+
66 git set-file-times $(docs) $(txt)
68 $(RSYNC) --chmod=Fugo=r -av $(rsync_docs) $(RSYNC_DEST)
70 $(RM) $(man1) $(man5) $(man7) $(gz_docs) $(docs_html)