summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-13 13:01:48 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-13 13:01:48 +0200
commit548090e67f66acf84385c4152ca464e52d3e3319 (patch)
tree9b6de528bd7b0aa63362fa83f5c8e6a97f68a5d8 /Makefile
parenta1d809960bee74df19c7e5fc34ffd1e4757cfdcb (diff)
Migrate away from templ and towards html/template
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 21 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index b8a4aea..f867cfa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,26 @@
-# Generating translations is rather slow; so don’t do that by default
-all:
- TEMPL_EXPERIMENT=rawgo go generate ./template
+templates = $(shell find src/templates -name '*.tmpl')
+gofiles = $(shell find main.go src -name '*.go')
+
+exttmpl = $(wildcard cmd/exttmpl/*.go)
+mfmt = $(wildcard cmd/mfmt/*.go)
+
+all: euro-cash.eu exttmpl mfmt
+
+euro-cash.eu: $(templates) $(gofiles)
go build
-all-i18n:
- TEMPL_EXPERIMENT=rawgo go generate ./template ./lib
+# Generating translations is rather slow; so don’t do that by default
+all-i18n: exttmpl
+ go generate ./src
find . -name out.gotext.json | mcp -b sed s/out/messages/
go build
+exttmpl: $(exttmpl)
+ go build ./cmd/exttmpl
+
+mfmt: $(mfmt)
+ go build ./cmd/mfmt
+
watch:
ls euro-cash.eu | entr -r ./euro-cash.eu -no-email -port $${PORT:-8080}
@@ -16,3 +29,6 @@ watch:
release: all-i18n
[ -n "$$GOOS" -a -n "$$GOARCH" ]
tar -cf euro-cash.eu-$$GOOS-$$GOARCH.tar.gz euro-cash.eu data/ static/
+
+clean:
+ rm -f euro-cash.eu