mirror of
https://github.com/coredns/coredns.git
synced 2026-01-18 06:41:18 -05:00
chore: allow to override -ldflags via ENV VAR for make coredns target (#7807)
This commit is contained in:
4
Makefile
4
Makefile
@@ -8,6 +8,8 @@ GOPATH?=$(HOME)/go
|
|||||||
MAKEPWD:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
MAKEPWD:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||||
CGO_ENABLED?=0
|
CGO_ENABLED?=0
|
||||||
GOLANG_VERSION ?= $(shell cat .go-version)
|
GOLANG_VERSION ?= $(shell cat .go-version)
|
||||||
|
STRIP_FLAGS?=-s -w
|
||||||
|
LDFLAGS?=-ldflags="$(STRIP_FLAGS) -X github.com/coredns/coredns/coremain.GitCommit=$(GITCOMMIT)"
|
||||||
|
|
||||||
export GOSUMDB = sum.golang.org
|
export GOSUMDB = sum.golang.org
|
||||||
export GOTOOLCHAIN = go$(GOLANG_VERSION)
|
export GOTOOLCHAIN = go$(GOLANG_VERSION)
|
||||||
@@ -17,7 +19,7 @@ all: coredns
|
|||||||
|
|
||||||
.PHONY: coredns
|
.PHONY: coredns
|
||||||
coredns: $(CHECKS)
|
coredns: $(CHECKS)
|
||||||
CGO_ENABLED=$(CGO_ENABLED) $(SYSTEM) go build $(BUILDOPTS) -ldflags="-s -w -X github.com/coredns/coredns/coremain.GitCommit=$(GITCOMMIT)" -o $(BINARY)
|
CGO_ENABLED=$(CGO_ENABLED) $(SYSTEM) go build $(BUILDOPTS) $(LDFLAGS) -o $(BINARY)
|
||||||
|
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
check: core/plugin/zplugin.go core/dnsserver/zdirectives.go
|
check: core/plugin/zplugin.go core/dnsserver/zdirectives.go
|
||||||
|
|||||||
Reference in New Issue
Block a user