-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile.in
More file actions
92 lines (75 loc) · 2.38 KB
/
Makefile.in
File metadata and controls
92 lines (75 loc) · 2.38 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Default Makefile included by subdirs
# Should not be called from here (root folder)
ifndef LANGUAGES
LANGUAGES := $(shell grep -v "^\#" po/LINGUAS)
endif
HTML_FILES = $(shell find data -name "*.html")
RESOURCE_NAME = /var/tmp/po_dir
PYTHON = python
PYBABEL = $(PYTHON) /usr/bin/pybabel
BASEPATH = ./
PWD = $(shell pwd)
POT_FILE := $(shell ls po/*.pot)
BUILDDIR = $(PWD)/../build.d
HTTPDDIR = $(PWD)/../httpd
sync = \
if test -f "PO_FREEZE"; then \
echo "> Not pulling POs for $2"; \
else \
if test -d $1/$2; then \
rsync -az $1/$2/po/* po/; \
echo ">>> POs pulled"; \
else \
echo ">>> Error, \`$1/$2' should exists"; \
fi \
fi
all: $(LANGUAGES)
cp static/robots.txt out/
static:
$(PYTHON) $(BUILDDIR)/build.py -o out -s static -b $(BASEPATH)
po/%.mo: po/%.po
msgfmt -o $@ $<
pot: $(HTML_FILES)
ifneq ($(POT_FILE),)
${PYBABEL} extract -F $(BUILDDIR)/pybabel.cfg data -o $(POT_FILE)
else
@echo "Error, POT_FILE \`$(POT_FILE)' not found, create it first \
for me to get its name.. Please use a wise name."
endif
data/templates/translations.html: po/LINGUAS
$(PYTHON) $(BUILDDIR)/construct-translations.py $(BUILDDIR)/translations.ini $^ $@
msgmerge: $(wildcard po/*.po)
pushpot:
tx push -s
pullpos:
tx -d pull -l zh_CN
$(HTTPDDIR)/conf/httpd.conf: $(HTTPDDIR)/conf/httpd.conf.in
cp $(HTTPDDIR)/conf/httpd.conf.in $(HTTPDDIR)/conf/httpd.conf
sed -i \
-e 's#@SERVERROOT@#$(HTTPDDIR)#g' \
-e 's#@DOCUMENTROOT@#$(PWD)/out#g' \
$(HTTPDDIR)/conf/httpd.conf
$(HTTPDDIR)/conf/languages.conf.in: po/LINGUAS
$(PYTHON) $(BUILDDIR)/buildconf.py $^ > $@
$(HTTPDDIR)/conf/languages.conf: $(HTTPDDIR)/conf/languages.conf.in
cp $(HTTPDDIR)/conf/languages.conf.in $(HTTPDDIR)/conf/languages.conf
sed -i \
-e 's#@SERVERROOT@#$(HTTPDDIR)#g' \
-e 's#@DOCUMENTROOT@#$(PWD)/out#g' \
$(HTTPDDIR)/conf/languages.conf
test: $(HTTPDDIR)/conf/httpd.conf $(HTTPDDIR)/conf/languages.conf
/usr/sbin/httpd -d $(HTTPDDIR) -f conf/httpd.conf
@echo "Test instance started at: http://localhost:5000/"
stoptest: clean
pid=`cat $(HTTPDDIR)/run/httpd.pid` && \
kill -TERM $$pid
clean:
rm -rf out
rm -f po/*.mo
rm -f data/templates/translations.html
rm -f data/templates/magfeed.html
rm -f build/rss.cache build/rss.pyc
rm -f build/schedule.cache
rm -f build/json.cache
rm -f $(HTTPDDIR)/conf/*.conf $(HTTPDDIR)/conf/languages.conf.in
.PHONY: all static rss-cache clean push test stoptest