HTML_FILES := $(shell find web -name *.gohtml) GO_FILES := $(shell find . -name *.go) DEFAULT_DOMAIN = camper POT_FILE = po/$(DEFAULT_DOMAIN).pot LINGUAS = ca es MO_FILES = $(patsubst %,locale/%/LC_MESSAGES/$(DEFAULT_DOMAIN).mo,$(LINGUAS)) XGETTEXTFLAGS = --no-wrap --from-code=UTF-8 --package-name=camper --msgid-bugs-address=jordi@tandem.blog locales: $(MO_FILES) locale/%/LC_MESSAGES/camper.mo: po/%.po mkdir -p $(@D) msgfmt -o $@ $< po/%.po: $(POT_FILE) msgmerge --no-wrap --update --backup=off $@ $< $(POT_FILE): $(HTML_FILES) $(GO_FILES) xgettext $(XGETTEXTFLAGS) --language=Scheme --output=$@ --keyword=pgettext:1,2c $(HTML_FILES) xgettext $(XGETTEXTFLAGS) --language=C --output=$@ --keyword=Gettext:1 --keyword=GettextNoop:1 --join-existing $(GO_FILES) test-deploy: sqitch deploy --db-name $(PGDATABASE) pg_prove test/* .PHONY: locales test-db