]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - locale/Makefile
rewrap text
[SourceForge/phpwiki.git] / locale / Makefile
1 # $Id: Makefile,v 1.7 2002-01-05 13:42:29 carstenklapp Exp $
2 #
3 # locale/Makefile
4 #
5 # This is a replacement for locale/translate.sh to avoid remaking
6 # files that don't need to be remade.
7 #
8
9 ALL_LINGUAS = nl es de sv it
10
11 PO_FILES = $(patsubst %, po/%.po, ${ALL_LINGUAS})
12 MO_FILES = $(patsubst %, %/LC_MESSAGES/phpwiki.mo, ${ALL_LINGUAS})
13 PHP_FILES = ${MO_FILES:.mo=.php}
14
15 PHP_SRC := $(wildcard ../templates/*.html ../lib/plugin/*.php \
16         ../lib/*.php ../lib/WikiDB/backend/*.php ../lib/WikiDB/*.php)
17
18 .PHONY: all po mo
19
20 all     : po mo
21 po      : ${PO_FILES}
22 mo      : ${MO_FILES} ${PHP_FILES}
23
24 po/phpwiki.pot : ${PHP_SRC}
25         xgettext -L C++ -k_ -k__printf -k__sprintf -k__vsprintf -o $@ $^
26
27 po/%.po : po/phpwiki.pot
28         test -f $@ || touch $@
29         cp -f $@ $@~
30         msgmerge -o $@.new $@~ $^ && mv -f $@.new $@
31
32 %/LC_MESSAGES/phpwiki.mo : po/%.po
33         mkdir -p $*/LC_MESSAGES
34         msgfmt -o $@ $<
35
36 # Generate .php from .mo rather than .po to maximize
37 # the probability of agreement between .mo and .php files.
38 %/LC_MESSAGES/phpwiki.php : %/LC_MESSAGES/phpwiki.mo
39         msgunfmt $< | awk -f make-php-trans.awk > $@
40
41 clean : # Nothing to be done for 'clean'.