-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
55 lines (48 loc) · 1.58 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
include campaign.def
LANGS=$(shell cat po/LINGUAS)
POFILES=${LANGS:=.po}
DUMMYPOFILES=${LANGS:=.nop}
UPDATEPOFILES=${LANGS:=.po-update}
GMOFILES=${LANGS:=.gmo}
CATALOGS=${LANGS:=.gmo}
all: setup
cd po && (make update-po || (make clean && false))
for locale in `cat po/LINGUAS`; do \
if test -f po/$${locale}.gmo; then \
mkdir -p ${CAMPAIGN}/translations/$${locale}/LC_MESSAGES ;\
cp po/$${locale}.gmo ${CAMPAIGN}/translations/$${locale}/LC_MESSAGES/${DOMAIN}.mo ;\
else \
rm -f ${CAMPAIGN}/translations/$${locale}/LC_MESSAGES/${DOMAIN}.mo; \
if test -d ${CAMPAIGN}/translations/$${locale}; then \
rmdir ${CAMPAIGN}/translations/$${locale}/LC_MESSAGES; \
rmdir ${CAMPAIGN}/translations/$${locale}; \
fi; \
fi; \
done
cd po && make clean
# The comment-remove command is seperate from the Makevars insertion line.
# This arrangement allows for comments from Makevars to be stripped too.
setup:
sed < po/Makefile.in.in > po/Makefile \
-e "s/@CAMPAIGN@/${CAMPAIGN}/" \
-e "s/@PACKAGE@/${DOMAIN}/" \
-e "s/@BRANCH@/${BRANCH}/" \
-e "s/@srcdir@/./" \
-e "s/@top_srcdir@/../" \
-e "s,@MSGFMT@,msgfmt," \
-e "s,@MSGMERGE@,msgmerge," \
-e "s/@POFILES@/${POFILES}/" \
-e "s/@DUMMYPOFILES@/${DUMMYPOFILES}/" \
-e "s/@UPDATEPOFILES@/${UPDATEPOFILES}/" \
-e "s/@GMOFILES@/${GMOFILES}/" \
-e "s/@CATALOGS@/${CATALOGS}/" \
-e "/Makevars gets inserted here/ r po/Makevars"
sed -i po/Makefile -e "/^[ \t]*#/d"
mostlyclean:
-cd po && make mostlyclean
clean:
-cd po && make clean
distclean:
-cd po && make distclean
realclean: distclean
rm -rf ${CAMPAIGN}/translations