summaryrefslogtreecommitdiffstats
path: root/man/generate_translations.mak
blob: 4c3beb9a52214279bfbe24ddc0141f0cdea73b5b (plain)
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
LANG=$(notdir $(CURDIR))

if ENABLE_REGENERATE_MAN
config.xml: ../config.xml.in
	$(MAKE) -C .. config.xml
	cp ../config.xml $@

messages.mo: ../po/$(LANG).po
	msgfmt $< -o messages.mo

login.defs.d:
	ln -sf $(srcdir)/../login.defs.d login.defs.d

%.xml: ../%.xml messages.mo login.defs.d
	if grep -q SHADOW-CONFIG-HERE $< ; then \
	    sed -e 's/^<!-- SHADOW-CONFIG-HERE -->/<!ENTITY % config SYSTEM "config.xml">%config;/' $< > $@; \
	else \
	    sed -e 's/^\(<!DOCTYPE .*docbookx.dtd"\)>/\1 [<!ENTITY % config SYSTEM "config.xml">%config;]>/' $< > $@; \
	fi
	itstool -i $(srcdir)/../its.rules -d -l $(LANG) -m messages.mo -o . $@
	sed -i 's:\(^<refentry .*\)>:\1 lang="$(LANG)">:' $@

include ../generate_mans.mak

else
$(man_MANS):
	@echo you need to run configure with --enable-man to generate man pages
endif

CLEANFILES = messages.mo login.defs.d $(EXTRA_DIST) $(addsuffix .xml,$(EXTRA_DIST)) config.xml