-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
16 lines (12 loc) · 728 Bytes
/
Makefile
File metadata and controls
16 lines (12 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
VERSION := $(shell git describe HEAD --exact-match --tags 2> /dev/null || echo "development")
REVISION := $(shell git rev-parse --short HEAD)
LDFLAGS := -X 'oidc-auth-proxy/version.version=$(VERSION)' -X 'oidc-auth-proxy/version.revision=$(REVISION)'
GO ?= go
GOVERSION := $(shell $(GO) version | sed 's|go version go\(.*\)\..* .*|\1|')
GOEXPECTEDVERSION := $(shell grep -E "^go " go.mod | sed 's|go ||')
all: assert_go_version build_linux_amd64
assert_go_version:
@if \[ "$(GOVERSION)" != "$(GOEXPECTEDVERSION)" \]; then echo "Invalid go version, please use go $(GOEXPECTEDVERSION)"; exit 1; fi
build_linux_amd64:
@echo "Build for linux amd64..."
@GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -ldflags "$(LDFLAGS)"