-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
executable file
·26 lines (20 loc) · 799 Bytes
/
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
#!/usr/bin/make -f
# Simple Makefile for gettext sample application
# Languages which we translate
LANGUAGES=it pl ja fr cs gl sv nl ka tr fi ca hu nb es de lt ro mn pt_BR zh_CN zh_TW hy en_GB sk sl el da ru fa sr he ar
all: hello
hello: main.c
gcc -o $@ $<
po/hello.pot: main.c Makefile
xgettext -d hello -o $@ $<
sed -i 's/Report-Msgid-Bugs-To: .*\\n/Report-Msgid-Bugs-To: <noreply@example.net>\\n/' $@
sed -i 's/Project-Id-Version: .*\\n/Project-Id-Version: Weblate Hello World 2012\\n/' $@
po/%.po: po/hello.pot
if [ ! -f $@ ] ; then \
msginit -l $* -o $@ --no-translator -i $< ; \
else \
msgmerge -U $@ $< ; \
fi
sed -i 's/Project-Id-Version: .*\\n/Project-Id-Version: Weblate Hello World 2012\\n/' $@
.PHONY: pofiles
pofiles: $(addsuffix .po, $(addprefix po/, ${LANGUAGES}))