OSDN Git Service

meson 0.60.2: Cancel reservation. Commit the sources so far.
[linuxjm/jm.git] / manual / rsync / Makefile
1 THRESH = 100
2 EXTFLAGS =
3 PO4AFLAGS += -k $(THRESH) $(EXTFLAGS)
4
5 MASTER_ROFFS = $(wildcard original/*/*.[1-8])
6 TRANS_ROFFS = $(patsubst original/%,draft/%,$(MASTER_ROFFS))
7 POFILES = $(patsubst original/%,po4a/%.ja.po,$(MASTER_ROFFS))
8 POTFILES = $(patsubst original/%,po4a/%.pot,$(MASTER_ROFFS))
9 MSGMERGE_OPTS = --no-wrap --no-location
10
11 WORK_DIR = .
12
13 all:    translate
14
15 translate:      $(TRANS_ROFFS)
16
17 draft/%:        po4a/%.ja.po
18         po4a-translate $(PO4AFLAGS) -f man -p $< -l $@ -m original/$* \
19           --addendum po4a/add_ja/copyright/$(notdir $*).txt
20
21 updatepo:       $(patsubst %,updatepo-%,$(notdir $(MASTER_ROFFS)))
22
23 updatepo-%:
24         @set -e; for target in $*; do \
25           p=$$(echo $* | sed -e 's|.*\.\([1-8]\)|man\1/\0|'); \
26           pofile=po4a/$$p.ja.po; \
27           potfile=po4a/$$p.pot; \
28           master=original/$$p; \
29           if [ -f $$pofile ]; then \
30             echo "po4a-updatepo $$pofile <- $$master"; \
31             po4a-updatepo -f man --previous --msgmerge-opt='$(MSGMERGE_OPTS)' \
32               -p $$pofile -m $$master; \
33           else \
34             echo "po4a-gettextize $$pofile <- $$master"; \
35             mkdir -p $$(dirname $$pofile); \
36             po4a-gettextize -f man -p $$pofile -m $$master; \
37             cp $$pofile $$potfile; \
38             msgmerge $(MSGMERGE_OPTS) -o $$pofile $$pofile $$potfile; \
39             $(RM) $$potfile; \
40           fi; \
41         done
42
43 stat:
44         @for po in $(POFILES); do \
45           echo -n $$(basename $$po)": "; \
46           msgfmt --statistics -o /dev/null $$po; \
47         done
48
49 pot:    $(POTFILES)
50
51 po4a/%.pot:
52         po4a-gettextize -f man -p $@ -m original/$*
53
54 pot-clean:
55         $(RM) -v $(POTFILES)