From be9006546dbad89aef476d2096c91b14fad2a3f4 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Wed, 17 Aug 2022 20:28:29 +0200 Subject: [PATCH] Add Makefile This commit adds a Makefile to automate the build process for the cacert-oidc-registration binary. --- .gitignore | 3 ++- Makefile | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 28af801..b9c298a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ +/cacert-oidc-registration +/static certs/ registration.toml -/static diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8962f7c --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +GOFILES = $(wildcard */*.go) +TEMPLATES = $(wildcard templates/*.gohtml) +TRANSLATIONS = $(wildcard active.*.toml) + +all: cacert-oidc-registration + +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 + +cacert-oidc-registration: go.sum $(GOFILES) $(TEMPLATES) translations + go build -o $@ ./cmd/registration.go + +clean: + rm -f cacert-oidc-registration + +.PHONY: all translations clean +