1 all: puzzles.hlp puzzles.txt HACKING
3 preprocessed.but: puzzles.but
4 sed 's/PREFIX-/$(BINPREFIX)/g' puzzles.but > preprocessed.but
6 puzzles.hlp puzzles.txt: preprocessed.but
7 halibut --winhelp=puzzles.hlp --text=puzzles.txt preprocessed.but
10 halibut --text=HACKING devel.but
13 puzzles.hhp: puzzles.but chm.but
14 halibut --html puzzles.but chm.but
16 TRANSLATIONS := $(patsubst po/%.po,%,$(wildcard po/*.po))
17 LANGUAGES := en $(TRANSLATIONS)
20 # Please tell me there is an easier way to preserve the POT file header.
21 test -f po/puzzles-doc.pot
22 po4a-gettextize -f halibut -m puzzles.but --package-name puzzles \
23 -p po/puzzles-doc.tmp1.pot
24 awk -F: '{ print ""; \
25 print "#: " $$1 ".R"; \
26 print "msgid \"" $$4 "\""; \
27 print "msgstr \"\""; }' \
28 < gamedesc.txt >> po/puzzles-doc.tmp1.pot
29 xgettext -j -cTranslator: --package-name puzzles \
30 -o po/puzzles-doc.tmp1.pot mkmanpages.pl
31 sed -i '1,/^#$$/d' po/puzzles-doc.tmp1.pot
32 cat po/puzzles-doc.pot.head po/puzzles-doc.tmp1.pot \
33 > po/puzzles-doc.tmp2.pot
34 diff -q -I Project-Id-Version: -I POT-Creation-Date: \
35 po/puzzles-doc.pot po/puzzles-doc.tmp2.pot || \
36 mv po/puzzles-doc.tmp2.pot po/puzzles-doc.pot
37 rm -f po/puzzles-doc.tmp*.pot
38 for lang in $(TRANSLATIONS); do \
39 msgmerge --previous -U po/$$lang.po po/puzzles-doc.pot || exit; \
43 doc/puzzles.but.%: puzzles.but po/%.po
45 po4a-translate -k 0 -f halibut -m puzzles.but -p po/$*.po -l $@
46 .PRECIOUS: $(addprefix doc/puzzles.but.,$(TRANSLATIONS))
48 doc/preprocessed.but.%: doc/puzzles.but.%
49 sed 's/PREFIX-/$(BINPREFIX)/g' $< > $@
51 doc/puzzles.txt.%: doc/preprocessed.but.%
52 halibut --text=$@ --input-charset=UTF-8 $<
53 all: $(addprefix doc/puzzles.txt.,$(TRANSLATIONS))
55 doc/man-en-stamp: preprocessed.but
61 doc/man-%-stamp: doc/preprocessed.but.%
67 man: $(patsubst %,doc/man-%-stamp,$(LANGUAGES))
69 doc/html-en-stamp: preprocessed.but
73 cd doc/html-en && halibut --html ../../preprocessed.but
75 doc/html-%-stamp: doc/preprocessed.but.%
79 cd doc/html-$* && halibut --html --input-charset=UTF-8 ../preprocessed.but.$*
81 html: $(patsubst %,doc/html-%-stamp,$(LANGUAGES))
87 rm -f puzzles.hlp puzzles.txt preprocessed.but HACKING *.html *.hh[pck]