util/queue: hold a lock when reading num_threads in util_queue_finish
[mesa.git] / src / util / xmlpool / Makefile.am
1 # Convenient makefile for managing translations.
2
3 # Prerequisites:
4 # - GNU gettext
5 # - Python
6
7 # Adding new translations
8 # -----------------------
9
10 # To start working on a new translation edit the POS=... line
11 # below. If you want to add for example a french translation, add
12 # fr.po.
13
14 # Then run "make po" to generate a fresh .po file from translatable
15 # strings in t_options.h. Now you can edit the new .po file (fr.po in
16 # the example above) to translate the strings. Please make sure that
17 # your editor encodes the file in UTF-8.
18
19 # Updating existing translations
20 # ------------------------------
21
22 # Run "make po" to update .po files with new translatable strings from
23 # t_options.h. Now you can edit the .po files you're interested
24 # in. Please make sure that your editor encodes the file in UTF-8.
25
26 # Updating options.h
27 # ------------------
28
29 # Finally run "make" to generate options.h from t_options.h with all
30 # translations. Now you can rebuild the drivers. Any common options
31 # used by the drivers will have option descriptions with the latest
32 # translations.
33
34 # Publishing translations
35 # -----------------------
36
37 # To get your translation(s) into Mesa CVS, please send me your
38 # <lang>.po file.
39
40 # More information:
41 # - info gettext
42
43 # The set of supported languages. Add languages as needed.
44 POS=ca.po de.po es.po nl.po fr.po sv.po
45
46 #
47 # Don't change anything below, unless you know what you're doing.
48 #
49 LANGS=$(POS:%.po=%)
50 MOS=$(POS:%.po=%.gmo)
51 POT=xmlpool.pot
52
53 .PHONY: all clean clean-local pot po mo
54
55 EXTRA_DIST = \
56 gen_xmlpool.py \
57 options.h \
58 t_options.h \
59 $(POS) \
60 $(MOS) \
61 SConscript \
62 meson.build \
63 LINGUAS \
64 POTFILES
65
66 BUILT_SOURCES = options.h
67 CLEANFILES = \
68 options.h
69 $(POS) \
70 $(MOS)
71
72 clean-local:
73 rm -f $(MOS)
74
75 # Default target options.h
76 LOCALEDIR := .
77 options.h: t_options.h $(MOS)
78 $(AM_V_GEN) $(PYTHON) $(PYTHON_FLAGS) $(srcdir)/gen_xmlpool.py \
79 --template $(srcdir)/t_options.h \
80 --output options.h \
81 --localedir $(LOCALEDIR) \
82 --languages $(LANGS)
83
84 # Update .mo files from the corresponding .po files.
85 %.gmo: %.po
86 @mo="$@"; \
87 lang=$${mo%%/*}; \
88 echo "Updating ($$lang) $@ from $?."; \
89 msgfmt -o $@ $?
90
91 # Use this target to create or update .po files with new messages in
92 # driconf.py.
93 po: $(POT)
94 @for po in $(POS); do \
95 if [ -f $$po ]; then \
96 echo "Merging new strings from $(POT) into $@."; \
97 mv $$po $$po~; \
98 msgmerge -o $$po $$po~ $(POT); \
99 else \
100 echo "Initializing $$po from $(POT)."; \
101 msginit -i $(POT) -o $$po~ --locale=$*; \
102 sed -e 's/charset=.*\\n/charset=UTF-8\\n/' $$po~ > $$po; \
103 fi \
104 done
105
106 pot: $(POT)
107
108 # Extract message catalog from driconf.py.
109 $(POT): t_options.h
110 xgettext -L C --from-code utf-8 -o $(POT) t_options.h