aboutsummaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile105
1 files changed, 53 insertions, 52 deletions
diff --git a/GNUmakefile b/GNUmakefile
index f2c50410..4ee63f84 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -20,63 +20,63 @@
20include config.mk 20include config.mk
21 21
22all: css locale template 22all: css locale template
23 cp -R dist rendered/ 23 $(cp) -R dist rendered/
24 cp -R static rendered/ 24 $(cp) -R static rendered/
25 cp rendered/static/robots.txt rendered/robots.txt 25 $(cp) rendered/static/robots.txt rendered/robots.txt
26 cp rendered/static/stage.robots.txt rendered/stage.robots.txt 26 $(cp) rendered/static/stage.robots.txt rendered/stage.robots.txt
27 cp rendered/static/robots.txt rendered/dist/robots.txt 27 $(cp) rendered/static/robots.txt rendered/dist/robots.txt
28 cp rendered/static/robots.txt rendered/en/robots.txt 28 $(cp) rendered/static/robots.txt rendered/en/robots.txt
29 cp rendered/static/robots.txt rendered/de/robots.txt 29 $(cp) rendered/static/robots.txt rendered/de/robots.txt
30 cp rendered/static/robots.txt rendered/es/robots.txt 30 $(cp) rendered/static/robots.txt rendered/es/robots.txt
31 cp rendered/static/robots.txt rendered/fr/robots.txt 31 $(cp) rendered/static/robots.txt rendered/fr/robots.txt
32 cp rendered/static/robots.txt rendered/it/robots.txt 32 $(cp) rendered/static/robots.txt rendered/it/robots.txt
33 cp favicon.ico rendered/favicon.ico 33 $(cp) favicon.ico rendered/favicon.ico
34 /bin/sh make_sitemap.sh 34 $(sh) make_sitemap.sh
35 cp rendered/sitemap.xml rendered/en/sitemap.xml 35 $(cp) rendered/sitemap.xml rendered/en/sitemap.xml
36 cp rss.xml rendered/rss.xml 36 $(cp) rss.xml rendered/rss.xml
37 cp rss.xml rendered/en/rss.xml 37 $(cp) rss.xml rendered/en/rss.xml
38 cp rss.xml rendered/de/rss.xml 38 $(cp) rss.xml rendered/de/rss.xml
39 cp rss.xml rendered/es/rss.xml 39 $(cp) rss.xml rendered/es/rss.xml
40 cp rss.xml rendered/fr/rss.xml 40 $(cp) rss.xml rendered/fr/rss.xml
41 cp rss.xml rendered/it/rss.xml 41 $(cp) rss.xml rendered/it/rss.xml
42 cp static/moved.html rendered/frontpage.html 42 $(cp) static/moved.html rendered/frontpage.html
43 cd rendered; ln -fs frontpage.html frontpage 43 cd rendered; $(ln) -fs frontpage.html frontpage
44 cp static/moved_gsoc.html rendered/gsoc.html 44 $(cp) static/moved_gsoc.html rendered/gsoc.html
45 cd rendered; ln -fs gsoc.html gsoc 45 cd rendered; $(ln) -fs gsoc.html gsoc
46 cp static/moved_gns.html rendered/gns.html 46 $(cp) static/moved_gns.html rendered/gns.html
47 cd rendered; ln -fs gns.html gns 47 cd rendered; $(ln) -fs gns.html gns
48 mkdir rendered/node ; cp static/moved_about.html rendered/node/about.html 48 $(mkdir) rendered/node ; $(cp) static/moved_about.html rendered/node/about.html
49 cd rendered/node ; ln -fs about.html 397 49 cd rendered/node ; $(ln) -fs about.html 397
50 cp static/moved_about.html rendered/about.html 50 $(cp) static/moved_about.html rendered/about.html
51 cd rendered ; ln -fs about.html philosophy 51 cd rendered ; $(ln) -fs about.html philosophy
52 52
53# Extract translateable strings from jinja2 templates. 53# Extract translateable strings from jinja2 templates.
54# Because of the local i18nfix extractor module we need 54# Because of the local i18nfix extractor module we need
55# to set the pythonpath before invoking pybabel. 55# to set the pythonpath before invoking pybabel.
56locale/messages.pot: common/*.j2.inc template/*.j2 56locale/messages.pot: common/*.j2.inc template/*.j2
57 PYTHONPATH=. $(BABEL) -v extract -F locale/babel.map -o locale/messages.pot . 57 $(env) PYTHONPATH=. $(pybabel) -q extract -F locale/babel.map -o locale/messages.pot .
58 58
59# Update translation (.po) files with new strings. 59# Update translation (.po) files with new strings.
60locale-update: locale/messages.pot 60locale-update: locale/messages.pot
61 msgmerge -U -m --previous locale/en/LC_MESSAGES/messages.po locale/messages.pot 61 $(msgmerge) -q -U -m --previous locale/en/LC_MESSAGES/messages.po locale/messages.pot
62 msgmerge -U -m --previous locale/de/LC_MESSAGES/messages.po locale/messages.pot 62 $(msgmerge) -q -U -m --previous locale/de/LC_MESSAGES/messages.po locale/messages.pot
63 msgmerge -U -m --previous locale/fr/LC_MESSAGES/messages.po locale/messages.pot 63 $(msgmerge) -q -U -m --previous locale/fr/LC_MESSAGES/messages.po locale/messages.pot
64 msgmerge -U -m --previous locale/es/LC_MESSAGES/messages.po locale/messages.pot 64 $(msgmerge) -q -U -m --previous locale/es/LC_MESSAGES/messages.po locale/messages.pot
65 msgmerge -U -m --previous locale/it/LC_MESSAGES/messages.po locale/messages.pot 65 $(msgmerge) -q -U -m --previous locale/it/LC_MESSAGES/messages.po locale/messages.pot
66 66
67 if grep -nA1 '#-#-#-#-#' locale/*/LC_MESSAGES/messages.po; then echo -e "\nERROR: Conflicts encountered in PO files.\n"; exit 1; fi 67 if $(grep) -nA1 '#-#-#-#-#' locale/*/LC_MESSAGES/messages.po; then echo -e "\nERROR: Conflicts encountered in PO files.\n"; exit 1; fi
68 68
69# sass preprocessor 69# sass preprocessor
70css: 70css:
71 sassc static/styles.sass static/styles.css 71 $(sassc) static/styles.sass static/styles.css
72 72
73# Compile translation files for use. 73# Compile translation files for use.
74locale-compile: 74locale-compile:
75 $(BABEL) -v compile -d locale -l en --use-fuzzy 75 $(pybabel) -q compile -d locale -l en --use-fuzzy
76 $(BABEL) -v compile -d locale -l de --use-fuzzy 76 $(pybabel) -q compile -d locale -l de --use-fuzzy
77 $(BABEL) -v compile -d locale -l fr --use-fuzzy 77 $(pybabel) -q compile -d locale -l fr --use-fuzzy
78 $(BABEL) -v compile -d locale -l it --use-fuzzy 78 $(pybabel) -q compile -d locale -l it --use-fuzzy
79 $(BABEL) -v compile -d locale -l es --use-fuzzy 79 $(pybabel) -q compile -d locale -l es --use-fuzzy
80 80
81# Process everything related to gettext translations. 81# Process everything related to gettext translations.
82locale: locale-update locale-compile 82locale: locale-update locale-compile
@@ -84,7 +84,7 @@ locale: locale-update locale-compile
84# Run the jinja2 templating engine to expand templates to HTML 84# Run the jinja2 templating engine to expand templates to HTML
85# incorporating translations. 85# incorporating translations.
86template: locale-compile 86template: locale-compile
87 $(PYTHON) ./template.py 87 $(python) ./template.py
88 88
89it: template 89it: template
90 90
@@ -92,23 +92,24 @@ current_dir = $(shell pwd)
92 92
93run: all 93run: all
94 @[ "$(BROWSER)" ] || ( echo "You need to export the environment variable 'BROWSER' to run this."; exit 1 ) 94 @[ "$(BROWSER)" ] || ( echo "You need to export the environment variable 'BROWSER' to run this."; exit 1 )
95 $(RUN_BROWSER) http://0.0.0.0:8000 & 95 $(browser) http://0.0.0.0:8000 &
96 cd rendered && $(PYTHON) -m http.server 96 cd rendered && $(PYTHON) -m http.server
97 97
98 98
99# docker-all: Build using a docker image which contains all the needed packages. 99# docker-all: Build using a docker image which contains all the needed
100# packages.
100 101
101docker: docker-all 102docker: docker-all
102 103
103docker-all: 104docker-all:
104 docker build -t gnunet-www-builder . 105 $(docker) build -t gnunet-www-builder .
105 # Importing via the shell like this is hacky, 106 # Importing via the shell like this is hacky,
106 # but after trying lots of other ways, this works most reliably... 107 # but after trying lots of other ways, this works most reliably...
107 $(PYTHON) -c 'import i18nfix' 108 $(python) -c 'import i18nfix'
108 docker run --rm -v $$(pwd):/tmp/ --user $$(id -u):$$(id -g) gnunet-www-builder 109 $(docker) run --rm -v $$(pwd):/tmp/ --user $$(id -u):$$(id -g) gnunet-www-builder
109 110
110clean: 111clean:
111 rm -rf __pycache__ 112 $(rm) -rf __pycache__
112 rm -rf en/ de/ fr/ it/ es/ ru/ 113 $(rm) -rf en/ de/ fr/ it/ es/ ru/
113 rm -rf rendered/ 114 $(rm) -rf rendered/
114 rm -rf *.pyc *~ \.*~ \#*\# 115 $(rm) -rf *.pyc *~ \.*~ \#*\#