forked from jnavila/git-manpages-l10n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (42 loc) · 1.68 KB
/
Makefile
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
EN_SOURCES = $(wildcard en/*.txt)
LANGUAGE_PO = $(wildcard po/documentation.*.po)
ALL_LANGUAGES = $(subst po/documentation.,,$(subst .po,,$(LANGUAGE_PO)))
L10N_BUILD_TARGETS = all man html install doc-l10n install-l10n install-txt
L10N_CLEAN_TARGETS = clean mrproper
L10N_TARGETS = $(L10N_CLEAN_TARGETS) $(L10N_BUILD_TARGETS)
QUIET_LANG = +$(MAKE) -C # space to separate -C and subdir
ifneq ($(findstring $(MAKEFLAGS),s),s)
ifndef V
QUIET_LANG = +@echo ' ' LANG $(2);$(MAKE) --no-print-directory -C
export V
endif
endif
po4a.conf: scripts/create_po4a_conf sources.txt $(LANGUAGE_PO)
@./scripts/create_po4a_conf
po4a-stamp: po4a.conf $(EN_SOURCES) $(LANGUAGE_PO) Makefile
$(QUIET_PO4A)PERL5LIB=./po4a/lib po4a/po4a -v po4a.conf
for f in po/documentation.*.po; do ./scripts/pre-translate-po $$f; done
./scripts/set-priorities po/documentation.*.po
@touch $@
update-sources:
@./scripts/update-sources
$(QUIET_PO4A)PERL5LIB=./po4a/lib po4a/po4a -v --no-translations po4a.conf
@for f in po/documentation.*.po; do ./scripts/pre-translate-po $$f; done
@./scripts/set-priorities po/documentation.*.po
define MAKE_TARGET
$(1)_$(2):
@mkdir -p $(2)
$(QUIET_LANG) $(2) -f ../makefile.locale $(1) lang=$(2)
$(1): $(1)_$(2)
.PHONY: $(1)_$(2)
endef
define DEPEND_PO4A
$(1)_$(2): po4a-stamp
endef
.PHONY: $(L10N_BUILD_TARGETS) $(L10N_CLEAN_TARGETS)
man all html doc-l10n : po4a-stamp
$(foreach lang,$(ALL_LANGUAGES),$(foreach target,$(L10N_TARGETS),$(eval $(call MAKE_TARGET,$(target),$(lang),DEPEND_PO4A))))
$(foreach lang,$(ALL_LANGUAGES),$(foreach target,$(L10N_BUILD_TARGETS),$(eval $(call DEPEND_PO4A,$(target),$(lang)))))
mrproper: mrproper-local
mrproper-local:
rm -f po4a-stamp po4a.conf