2023-07-24 15:55:41 +00:00
|
|
|
GOFILES = $(shell find -type f -name '*.go')
|
2022-08-22 16:50:59 +00:00
|
|
|
TEMPLATES = $(wildcard ui/templates/*.gohtml)
|
2023-05-15 14:47:37 +00:00
|
|
|
TRANSLATIONS = $(wildcard translations/active.*.toml)
|
2022-08-22 16:50:59 +00:00
|
|
|
RESOURCES = ui/css ui/images ui/js
|
2022-08-17 18:25:00 +00:00
|
|
|
|
|
|
|
all: cacert-idp
|
|
|
|
|
2022-08-22 16:50:59 +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 18:25:00 +00:00
|
|
|
go.sum: go.mod
|
|
|
|
go mod tidy
|
|
|
|
|
|
|
|
translations: $(TRANSLATIONS) $(GOFILES)
|
2023-05-15 14:47:37 +00:00
|
|
|
cd translations ; \
|
|
|
|
goi18n extract .. ; \
|
|
|
|
goi18n merge active.*.toml ; \
|
2022-08-17 18:25:00 +00:00
|
|
|
if translate.*.toml 2>/dev/null; then \
|
|
|
|
echo "missing translations"; \
|
|
|
|
goi18n merge active.*.toml translate.*.toml; \
|
|
|
|
fi
|
|
|
|
|
2023-05-13 08:16:49 +00:00
|
|
|
lint: $(GOFILES)
|
|
|
|
golangci-lint run --verbose
|
|
|
|
|
2022-08-22 16:50:59 +00:00
|
|
|
cacert-idp: go.sum $(GOFILES) $(TEMPLATES) translations $(RESOURCES)
|
2023-07-24 15:55:41 +00:00
|
|
|
CGO_ENABLED=0 go build -o $@ ./cmd/idp
|
2022-08-17 18:25:00 +00:00
|
|
|
|
|
|
|
clean:
|
2022-08-22 16:50:59 +00:00
|
|
|
rm -rf cacert-idp ui/css ui/js ui/images
|
2022-08-17 18:25:00 +00:00
|
|
|
|
2023-05-13 08:16:49 +00:00
|
|
|
.PHONY: all translations clean lint
|