2023-07-29 15:46:33 +00:00
|
|
|
GOFILES = $(shell find -type f -name '*.go')
|
|
|
|
TEMPLATES = $(wildcard ui/templates/*.gohtml)
|
|
|
|
TRANSLATIONS = $(wildcard translations/active.*.toml)
|
|
|
|
RESOURCES = ui/css ui/images ui/js
|
2022-08-17 17:52:12 +00:00
|
|
|
|
|
|
|
all: demo-app
|
|
|
|
|
2023-07-29 15:46:33 +00:00
|
|
|
ui/css: ../cacert_resources/static/css
|
|
|
|
cp -r ../cacert_resources/static/css ui/
|
|
|
|
|
|
|
|
ui/js: ../cacert_resources/static/js
|
|
|
|
cp -r ../cacert_resources/static/js ui/
|
|
|
|
|
|
|
|
ui/images: ../cacert_resources/static/images
|
|
|
|
cp -r ../cacert_resources/static/images ui/
|
|
|
|
|
2022-08-17 17:52:12 +00:00
|
|
|
go.sum: go.mod
|
2023-07-29 15:46:33 +00:00
|
|
|
go mod tidy -v
|
2022-08-17 17:52:12 +00:00
|
|
|
|
|
|
|
translations: $(TRANSLATIONS) $(GOFILES)
|
2023-08-03 14:46:28 +00:00
|
|
|
if [ ! -z "$(wildcard translations/translate.*.toml)" ]; then \
|
2022-08-17 17:52:12 +00:00
|
|
|
echo "missing translations"; \
|
2023-08-03 14:46:28 +00:00
|
|
|
goi18n merge -outdir translations translations/active.*.toml translations/translate.*.toml; \
|
|
|
|
fi ; \
|
|
|
|
goi18n extract -outdir translations . ; \
|
|
|
|
goi18n merge -outdir translations translations/active.*.toml
|
2022-08-17 17:52:12 +00:00
|
|
|
|
2023-07-29 15:46:33 +00:00
|
|
|
lint: $(GOFILES)
|
|
|
|
golangci-lint run --verbose
|
|
|
|
|
|
|
|
demo-app: go.sum $(GOFILES) $(TEMPLATES) translations $(RESOURCES)
|
|
|
|
CGO_ENABLED=0 go build -o $@ ./cmd/app
|
2022-08-17 17:52:12 +00:00
|
|
|
|
|
|
|
clean:
|
2023-07-29 15:46:33 +00:00
|
|
|
rm -rf demo-app ui/css ui/js ui/images
|
2022-08-17 17:52:12 +00:00
|
|
|
|
2023-07-29 15:46:33 +00:00
|
|
|
.PHONY: all translations clean lint
|