# Makefile for NetBSD make (portable version: "bmake"), # GNU make will find 'GNUmakefile' first and use that file instead. # This file is in the public domain. .include "config.mk" DESTDIR=$(prefix) _LOCALELIST= en de fr it es ru pt _DIRLIST= dist icons papers pdf presentations images .PHONY: all run locale-compile locale install clean # Work this into an mk file # All: build HTML pages in all languages and compile the # TypeScript logic in web-common. all: locale template cd web-common && $(tsc) $(sh) make_sitemap.sh .for _lang in ${_LOCALELIST} $(cp) robots.txt rendered/${_lang} $(cp) favicon.ico rendered/${_lang} $(cp) rendered/sitemap.xml rendered/${_lang} .endfor .for _dir in ${_DIRLIST} $(cp) -R ${_dir} rendered/ .endfor $(cp) styles.css rendered/ # Extract translateable strings from jinja2 templates. locale/messages.pot: template/*.j2 common/*.j2 common/*.j2.inc $(env) PYTHONPATH="." $(pybabel) extract -F locale/babel.map -o locale/messages.pot . # Update translation (.po) files with new strings. locale-update: locale/messages.pot .for _lang in ${_LOCALELIST} $(msgmerge) -U -m --previous locale/${_lang}/LC_MESSAGES/messages.po locale/messages.pot .endfor if $(grep) -nA1 '#-#-#-#-#' locale/*/LC_MESSAGES/messages.po; then \ $(echo) -e "\nERROR: Conflicts encountered in PO files.\n"; exit 1; \ fi # Compile translation files for use. locale-compile: .for _lang in ${_LOCALELIST} $(pybabel) compile -d locale -l ${_lang} --use-fuzzy .endfor # Process everything related to gettext translations. locale: locale-update locale-compile # Run the jinja2 templating engine to expand templates to HTML # incorporating translations. template: locale-compile $(python) ./template.py run: .if defined(browser) && !empty(DESTDIR) && !empty(python) $(browser) http://0.0.0.0:8000 & $(python) -m http.server .endif install: $(mkdir) -p $(prefix)/share/taler-www $(cp) -R rendered/* $(prefix)/share/taler-www uninstall: $(rm) -rf $(prefix)/share/taler-www submodules/init: $(git) submodule update --init --recursive submodules/update: $(git) submodule update --recursive --remote CLEANFILES+= *.pyc *~ \.*~ *.core .include