diff options
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/GNUmakefile b/GNUmakefile index 6e320e7..3d7ec2c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,5 @@ -GO := go +GO := go +PORT := 8080 cssfiles := $(shell find static -name '*.css' -not -name '*.min.css') cssfiles := $(cssfiles:.css=.min.css) @@ -6,19 +7,21 @@ gofiles := $(shell find main.go src -name '*.go') sqlfiles := $(shell find src/dbx/sql -name '*.sql') templates := $(shell find src/templates -name '*.tmpl') -exttmpl := $(wildcard cmd/exttmpl/*.go) +extpo := $(wildcard cmd/extpo/*.go) +extwiki := $(wildcard cmd/extwiki/*.go) -ENABLED_LANGUAGES := $(shell ./enabled-languages) +ENABLED_LANGUAGES := $(shell ./aux/enabled-languages) -all: euro-cash.eu exttmpl +all: euro-cash.eu extpo euro-cash.eu: $(cssfiles) $(templates) $(gofiles) $(sqlfiles) $(GO) build -extract: exttmpl - find . -name '*.go' -exec xgettext -Lgo --force-po --from-code=UTF-8 \ - -o po/backend.pot {} + - find . -name '*.html.tmpl' -exec ./exttmpl {} + \ +extract: extpo extwiki + find . -name '*.go' -exec xgotext --foreign-user -o po/backend.pot {} + + find . -name '*.html.tmpl' -exec ./extwiki {} + \ + | gofmt >src/wikipedia/links.gen.go + find . -name '*.html.tmpl' -exec ./extpo {} + \ | msgcat po/backend.pot - -o po/messages.pot for bcp in $(ENABLED_LANGUAGES); \ do \ @@ -27,9 +30,9 @@ extract: exttmpl then \ mkdir -p "$$dir"; \ msginit -i po/messages.pot -o "$$dir/messages.po" -l$$bcp.UTF-8 \ ---no-translator; \ + --no-translator; \ fi; \ - msgmerge --update "po/$$bcp/messages.po" po/messages.pot; \ + msgmerge -UN "po/$$bcp/messages.po" po/messages.pot; \ done find po -name '*~' -delete @@ -39,8 +42,11 @@ po: msgfmt "$$po" -o "$${po%.*}.mo"; \ done -exttmpl: $(exttmpl) - $(GO) build ./cmd/exttmpl +extpo: $(extpo) + $(GO) build ./cmd/extpo + +extwiki: $(extwiki) + $(GO) build ./cmd/extwiki %.min.css: %.css if command -v lightningcss >/dev/null; \ @@ -53,9 +59,13 @@ exttmpl: $(exttmpl) clean: find . -type f \( \ -name euro-cash.eu \ - -or -name exttmpl \ + -or -name extpo \ + -or -name extwiki \ -or -name '*.min.css' \ -or -name '*.tar.gz' \ \) -delete -.PHONY: clean extract po release
\ No newline at end of file +debug: + ./euro-cash.eu -debug -no-email -db-name :memory: -port $(PORT) + +.PHONY: clean debug extract po release |