|
|
|
@ -61,7 +61,23 @@ endif
|
|
|
|
|
|
|
|
|
|
DATE := $(shell date -u '+%Y-%m-%d %H:%M UTC')
|
|
|
|
|
LDFLAGS := -ldflags='-w -X "main.Version=$(VERSION)" -X "main.BuildTime=$(DATE)"'
|
|
|
|
|
GOFLAGS := CGO_ENABLED=0
|
|
|
|
|
|
|
|
|
|
# Always explicitly enable or disable cgo,
|
|
|
|
|
# so that go doesn't silently fall back on
|
|
|
|
|
# non-cgo when gcc is not found.
|
|
|
|
|
ifeq (,$(findstring CGO_ENABLED,$(GO_ENVS)))
|
|
|
|
|
ifneq ($(origin GOFLAGS),undefined)
|
|
|
|
|
# This section is for backward compatibility with
|
|
|
|
|
#
|
|
|
|
|
# $ make build GOFLAGS=""
|
|
|
|
|
#
|
|
|
|
|
# which is how we recommended building step-ca with cgo support
|
|
|
|
|
# until June 2023.
|
|
|
|
|
GO_ENVS := $(GO_ENVS) CGO_ENABLED=1
|
|
|
|
|
else
|
|
|
|
|
GO_ENVS := $(GO_ENVS) CGO_ENABLED=0
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
download:
|
|
|
|
|
$Q go mod download
|
|
|
|
@ -71,7 +87,7 @@ build: $(PREFIX)bin/$(BINNAME)
|
|
|
|
|
|
|
|
|
|
$(PREFIX)bin/$(BINNAME): download $(call rwildcard,*.go)
|
|
|
|
|
$Q mkdir -p $(@D)
|
|
|
|
|
$Q $(GOOS_OVERRIDE) $(GOFLAGS) go build -v -o $(PREFIX)bin/$(BINNAME) $(LDFLAGS) $(PKG)
|
|
|
|
|
$Q $(GOOS_OVERRIDE) GOFLAGS="$(GOFLAGS)" $(GO_ENVS) go build -v -o $(PREFIX)bin/$(BINNAME) $(LDFLAGS) $(PKG)
|
|
|
|
|
|
|
|
|
|
# Target to force a build of step-ca without running tests
|
|
|
|
|
simple: build
|
|
|
|
@ -93,10 +109,10 @@ generate:
|
|
|
|
|
test: testdefault testtpmsimulator combinecoverage
|
|
|
|
|
|
|
|
|
|
testdefault:
|
|
|
|
|
$Q $(GOFLAGS) gotestsum -- -coverprofile=defaultcoverage.out -short -covermode=atomic ./...
|
|
|
|
|
$Q $(GO_ENVS) gotestsum -- -coverprofile=defaultcoverage.out -short -covermode=atomic ./...
|
|
|
|
|
|
|
|
|
|
testtpmsimulator:
|
|
|
|
|
$Q CGO_ENALBED=1 gotestsum -- -coverprofile=tpmsimulatorcoverage.out -short -covermode=atomic -tags tpmsimulator ./acme
|
|
|
|
|
$Q CGO_ENABLED=1 gotestsum -- -coverprofile=tpmsimulatorcoverage.out -short -covermode=atomic -tags tpmsimulator ./acme
|
|
|
|
|
|
|
|
|
|
testcgo:
|
|
|
|
|
$Q gotestsum -- -coverprofile=coverage.out -short -covermode=atomic ./...
|
|
|
|
@ -109,7 +125,7 @@ combinecoverage:
|
|
|
|
|
integrate: integration
|
|
|
|
|
|
|
|
|
|
integration: bin/$(BINNAME)
|
|
|
|
|
$Q $(GOFLAGS) gotestsum -- -tags=integration ./integration/...
|
|
|
|
|
$Q $(GO_ENVS) gotestsum -- -tags=integration ./integration/...
|
|
|
|
|
|
|
|
|
|
.PHONY: integrate integration
|
|
|
|
|
|
|
|
|
|