forked from UB-Mannheim/PalMA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (28 loc) · 934 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Makefile for PalMA
# Compile all available translations for the PalMA web interface.
.PHONY: all
DISTDIR=docs/dist
LANGUAGES=$(shell cd locale && ls -d *.UTF-8 | sed s/.UTF-8//)
SRC=index.php
SRC+=i12n.php
SRC+=login.php
SRC+=upload.php
SRC+=$(wildcard examples/screensaver/*.php)
SRC+=$(wildcard selectplace/*.php)
SRC+=$(wildcard theme/*/*/*.php)
PO=$(wildcard locale/*.UTF-8/LC_MESSAGES/palma.po)
all: $(patsubst %.po, %.mo, $(PO)) locale/README.md
%.mo: %.po
msgfmt --output-file=$@ $?
palma.po: $(SRC)
xgettext --default-domain=palma --keyword=__ --package-name=palma \
--output-dir=. --from-code=UTF-8 $(SRC)
perl -pi -e s/charset=CHARSET/charset=UTF-8/ $@
$(PO): palma.po
msgmerge --update $@ palma.po
touch $@
locale/README.md: $(PO)
perl $(DISTDIR)/find-untranslated.pl --markdown $(LANGUAGES) >$@
.git/hooks: .git/hooks/pre-push .git/hooks/pre-commit
.git/hooks/%: $(DISTDIR)/%.sh
ln -sf ../../$< $@