1 PERKAMON_DIR = perkamon
6 PO4AFLAGS ?= -k $(THRESH) $(FLAGS)
8 PO4A_SUBDIRS = $(notdir $(wildcard po4a/*))
10 .PHONY: all release translate
13 translate: translate-pages update-stats
14 release: release-pages update-tl-finish check-tl-nofinish
16 translate-pages: $(patsubst %, stamp/%, $(PO4A_SUBDIRS))
17 stamp/%: stamp-jm-setup po4a/%/po/ja.po
18 @echo "*************** translate: $* ***************"
20 LC_ALL=C $(MAKE) process-$* \
21 PO4AFLAGS="$(PO4AFLAGS)" LANGS="$(LANGS)" -C $(PERKAMON_DIR)
25 ../../admin/JM-release-all.sh -c
27 update-stats: untrans.html
29 untrans.html: $(patsubst %, stats/%, $(PO4A_SUBDIRS))
30 @echo "*************** Updating translation statistics ***************"
31 ./tools/generate-list.pl $^ > $@
32 if [ -f EXCLUDED_PAGES.txt ]; then \
33 ./tools/generate-list.pl -e EXCLUDED_PAGES.txt $^ > untrans-partial.html; \
36 stats/%: stamp-jm-setup po4a/%/po/ja.po
37 @echo "*************** stats: $* ***************"
40 $(RM) $(PERKAMON_DIR)/build/ja
41 ln -s ../../_transtmp $(PERKAMON_DIR)/build/ja
42 LC_ALL=C $(MAKE) process-$* \
43 PO4AFLAGS="-k 100 $(FLAGS)" LANGS="$(LANGS)" -C $(PERKAMON_DIR) \
45 ./tools/extract-untrans.pl < _log.txt > $@
46 $(RM) $(PERKAMON_DIR)/build/ja
47 ln -s ../../draft $(PERKAMON_DIR)/build/ja
55 @cat stats/* | grep -v '^#' | cut -d , -f 1 | sort > _stats.txt
56 @grep '^[×☆]' translation_list | cut -d : -f 5-6 | sed -e 's/:/./' | sort > _tr_todo.txt
57 @for p in `comm -23 _tr_todo.txt _stats.txt`; do \
58 ../../admin/JM-tl-modify.pl -U translation_list $$p RO; \
60 @$(RM) _stats.txt _tr_todo.txt
63 @cat stats/* | grep -v '^#' | cut -d , -f 1 | sort > _stats.txt
64 @grep '^○' translation_list | cut -d : -f 5-6 | sed -e 's/:/./' | sort > _tr_finish.txt
65 @comm -12 _tr_finish.txt _stats.txt
66 @$(RM) _stats.txt _tr_finish.txt
69 set -e; for d in po4a/*; do \
70 echo "----- $$d -----"; cur=`pwd`; cd $$d/po; \
72 LC_ALL=C msgmerge --verbose -o $$f ja.po $$(basename $$d) \
78 set -e; for d in po4a/$*; do \
81 msgmerge --verbose -o $$f ja.po $$(basename $$d) \
87 @LC_ALL=C $(MAKE) stats \
88 PO4AFLAGS="$(PO4AFLAGS)" LANGS="$(LANGS)" -C $(PERKAMON_DIR)
90 untrans-postats: jm-setup
91 @LC_ALL=C $(MAKE) stats \
92 PO4AFLAGS="$(PO4AFLAGS)" LANGS="$(LANGS)" -C $(PERKAMON_DIR) \
93 2>&1 | grep -vE ' translated messages\.$$'
95 jm-setup: stamp-jm-setup
97 @# Check perkamon/po4a and JM/po4a
98 ls -1 $(PERKAMON_DIR)/po4a | sort > _po4a_list_perkamon
99 ls -1 po4a | sort > _po4a_list_jm
100 set -e; for d in `comm -13 _po4a_list_perkamon _po4a_list_jm`; do \
104 set -e; for d in `comm -23 _po4a_list_perkamon _po4a_list_jm`; do \
106 mkdir -vp po4a/$$d/po; \
108 rm _po4a_list_jm _po4a_list_perkamon
109 cd $(PERKAMON_DIR) && make setup
110 @# Create symlink to po4a/*/po in the top dir.
111 set -e; for d in $(PERKAMON_DIR)/po4a/*; do \
112 if [ ! -e $$d/po ]; then \
113 t=$$(echo $$d | sed -e "s|$(PERKAMON_DIR)/||"); \
114 ln -s ../../../$$t/po $$d/po; \
117 @set -e; if [ ! -e $(PERKAMON_DIR)/build/ja ]; then \
118 ln -s ../../draft $(PERKAMON_DIR)/build/ja; \
120 ln -s ../../add_ja $(PERKAMON_DIR)/po4a
125 $(RM) $(PERKAMON_DIR)/man-pages || true
126 $(RM) $(PERKAMON_DIR)/stamp-*
127 $(RM) -rf $(PERKAMON_DIR)/build
128 find $(PERKAMON_DIR) -type l | xargs $(RM)
133 cd $(PERKAMON_DIR)/man-pages \
134 && ../../../../admin/JM-orig-upd.sh ../../original \
135 && cp README man-pages-* Changes* ../../original
137 sed -e 's/\^\\\.SH /^\\.S[Hh] /' ../perkamon/man-pages/scripts/remove_COLOPHON.sh \
138 sh ../perkamon/man-pages/scripts/remove_COLOPHON.sh man?/*.[1-8]
139 git add --all original/
140 git status original | ../../admin/git2upd > upd.txt
141 $(eval VERSION = $(shell grep "^V = " $(PERKAMON_DIR)/Makefile | awk '{print $$3}'))
142 ../../admin/upd_tl.perl translation_list upd.txt $(VERSION)
143 mv translation_list.* translation_list
144 $(MAKE) FLAGS="--no-translations -v --force" translate-pages
146 git add translation_list
147 git commit -m "LDP: Update original to LDP v$(VERSION)" original/ translation_list
148 git add po4a/ stats/ untrans.html perkamon
149 git commit -m "LDP: Update POT and ja.po to LDP v$(VERSION)" po4a/ stats/ untrans.html
152 @echo "Available targets:"
153 @echo " translate Generate draft from po files"
154 @echo " translate-<SEC> Generate draft from the specified po file"
155 @echo " release Generate release from po files"
157 @echo " update-stats Update per-page trans stats"
158 @echo " clean-stats Remove all caches of per-page trans stats"
159 @echo " postats Display per-po trans stats"
160 @echo " untrans-postats Display per-po trans stats (untrans only)"
162 @echo " jm-setup Setup perkamon environment"
163 @echo " clean-setup Clean perkamon environment"