Add Makefile

This commit adds a Makefile to automate application builds.
This commit is contained in:
Jan Dittberner 2022-08-17 19:52:12 +02:00
parent c69e8d2980
commit 9f7b8ec5a7
2 changed files with 25 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
.idea/ .idea/
/demo-app
/sessions /sessions
/static /static
certs/ certs/

24
Makefile Normal file
View file

@ -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