Trying a different approach
This commit is contained in:
parent
de52aee9b1
commit
b2b8b48949
1 changed files with 10 additions and 3 deletions
13
Makefile
13
Makefile
|
@ -61,8 +61,15 @@ endif
|
||||||
|
|
||||||
DATE := $(shell date -u '+%Y-%m-%d %H:%M UTC')
|
DATE := $(shell date -u '+%Y-%m-%d %H:%M UTC')
|
||||||
LDFLAGS := -ldflags='-w -X "main.Version=$(VERSION)" -X "main.BuildTime=$(DATE)"'
|
LDFLAGS := -ldflags='-w -X "main.Version=$(VERSION)" -X "main.BuildTime=$(DATE)"'
|
||||||
GOFLAGS ?=
|
GOFLAGS := -v
|
||||||
GO_ENVS := CGO_ENABLED=0
|
|
||||||
|
ifeq (,$(GOFLAGS))
|
||||||
|
ifeq (,$(findstring CGO_ENABLED=0,$(GO_ENVS)))
|
||||||
|
GO_ENVS := $(GO_ENVS) CGO_ENABLED=1
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
GO_ENVS := $(GO_ENVS) CGO_ENABLED=0
|
||||||
|
endif
|
||||||
|
|
||||||
download:
|
download:
|
||||||
$Q go mod download
|
$Q go mod download
|
||||||
|
@ -72,7 +79,7 @@ build: $(PREFIX)bin/$(BINNAME)
|
||||||
|
|
||||||
$(PREFIX)bin/$(BINNAME): download $(call rwildcard,*.go)
|
$(PREFIX)bin/$(BINNAME): download $(call rwildcard,*.go)
|
||||||
$Q mkdir -p $(@D)
|
$Q mkdir -p $(@D)
|
||||||
$Q $(GOOS_OVERRIDE) $(GO_ENVS) go build -v -o $(PREFIX)bin/$(BINNAME) $(LDFLAGS) $(PKG)
|
$Q $(GOOS_OVERRIDE) $(GO_ENVS) go build $(GOFLAGS) -o $(PREFIX)bin/$(BINNAME) $(LDFLAGS) $(PKG)
|
||||||
|
|
||||||
# Target to force a build of step-ca without running tests
|
# Target to force a build of step-ca without running tests
|
||||||
simple: build
|
simple: build
|
||||||
|
|
Loading…
Add table
Reference in a new issue