-
Notifications
You must be signed in to change notification settings - Fork 215
/
makefile.locale
98 lines (72 loc) · 2.5 KB
/
makefile.locale
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
vpath GIT-VERSION-FILE . ..
MAN1_SOURCE = $(wildcard git-*.txt)
MAN1_SOURCE += $(wildcard git.txt*)
MAN7_SOURCE = $(wildcard gitglossary.txt*)
MAN_FILTER = $(MAN1_SOURCE) $(MAN7_SOURCE)
HTML_FILTER = $(patsubst %.txt,%.html,$(MAN_FILTER))
ifeq ($(wildcard ../../build-docdep.perl),../../build-docdep.perl)
vpath %conf . .. ../..
vpath %in . .. ../..
vpath %xsl . .. ../..
vpath %rb . .. ../..
ifdef mandir
tmp_mandir := $(mandir)
mandir = $(tmp_mandir)/$(lang)
else
mandir = $(prefix)/share/man/$(lang)
endif
include ../../Makefile
XMLTO_EXTRA += --searchpath ../..
ifdef USE_ASCIIDOCTOR
ASCIIDOC_EXTRA += -I../.. -I. -rasciidoctor-extensions
else
ASCIIDOC_CONF = -f ../../asciidoc.conf
endif
doc-l10n: all
install-l10n:
$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
$(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
$(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
if [ ! -z "$(DOC_MAN1)" ]; then $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir); fi
if [ ! -z "$(DOC_MAN5)" ]; then $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir); fi
if [ ! -z "$(DOC_MAN7)" ]; then $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir); fi
else
ifndef V
QUIET_PO4A = @echo ' ' PO4A $(lang) $@;
QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $(lang) $@;
endif
-include ../GIT-VERSION-FILE
ASCIIDOC_EXTRA = -d manpage -I.. -I. -rasciidoctor-extensions
ASCIIDOC_EXTRA += -amanmanual='Git Manual' \
-amansource='Git $(GIT_VERSION)' \
-amanversion=$(GIT_VERSION)
ASCIIDOC_EXTRA += -alitdd='\--'
ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
$(HTML_FILTER): %.html: %.txt
$(QUIET_ASCIIDOC)asciidoctor -b xhtml5 \
$(ASCIIDOC_EXTRA) $<
MAN1_PAGES=$(patsubst %.txt,%.1,$(MAN1_SOURCE))
MAN5_PAGES=$(patsubst %.txt,%.5,$(MAN5_SOURCE))
MAN7_PAGES=$(patsubst %.txt,%.7,$(MAN7_SOURCE))
MANPAGES=$(MAN1_PAGES) $(MAN5_PAGES) $(MAN7_PAGES)
$(MAN1_PAGES): %.1: %.txt
$(QUIET_ASCIIDOC)asciidoctor -b manpage -o $@ \
$(ASCIIDOC_EXTRA) -amanvolnum=1 $<
$(MAN5_PAGES): %.5: %.txt
$(QUIET_ASCIIDOC)asciidoctor -b manpage -o $@ \
$(ASCIIDOC_EXTRA) -amanvolnum=5 $<
$(MAN7_PAGES): %.7: %.txt
$(QUIET_ASCIIDOC)asciidoctor -b manpage -o $@ \
$(ASCIIDOC_EXTRA) -amanvolnum=7 $<
man: $(MANPAGES)
html: $(HTML_FILTER)
all doc-l10n: man html
install-txt:
install -d -m 755 $(prefix)/$(lang)
[ -z "$$(ls *.txt 2>/dev/null)" ] || install *.txt -m 644 $(prefix)/$(lang)
[ -z "$$(ls *.html 2>/dev/null)" ] || install *.html -m 644 $(prefix)/$(lang)
clean:
rm -f *.1 *.5 *7 *.html
endif
mrproper: clean
rm -f *.txt