From 9f7b8ec5a75a49a967accb8ec1ad324e646a7010 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Wed, 17 Aug 2022 19:52:12 +0200 Subject: [PATCH] Add Makefile This commit adds a Makefile to automate application builds. --- .gitignore | 1 + Makefile | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 3fc6e72..122d109 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ +/demo-app /sessions /static certs/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3c6a032 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +GOFILES = $(wildcard */*.go) +TEMPLATES = $(wildcard templates/*.gohtml) +TRANSLATIONS = $(wildcard active.*.toml) + +all: demo-app + +go.sum: go.mod + go mod tidy + +translations: $(TRANSLATIONS) $(GOFILES) + goi18n extract . + goi18n merge active.*.toml + if translate.*.toml 2>/dev/null; then \ + echo "missing translations"; \ + goi18n merge active.*.toml translate.*.toml; \ + fi + +demo-app: go.sum $(GOFILES) $(TEMPLATES) translations + go build -o $@ ./cmd/app.go + +clean: + rm -f demo-app + +.PHONY: all translations clean