Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
Makefile: force static compilation for vanilla reva and revad, dynami…
Browse files Browse the repository at this point in the history
…c for ceph and docker
  • Loading branch information
glpatcern committed Oct 9, 2023
1 parent 0b87c25 commit d75b1d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ GIT_COMMIT ?= `git rev-parse --short HEAD`
VERSION ?= `git describe --always`
GO_VERSION ?= `go version | awk '{print $$3}'`
BUILD_DATE = `date +%FT%T%z`
BUILD_FLAGS = "`[[ -z "$(STATIC)" ]] && echo "" || echo "-extldflags=-static"` -X github.com/cs3org/reva/cmd/revad.gitCommit=$(GIT_COMMIT) -X github.com/cs3org/reva/cmd/revad.version=$(VERSION) -X github.com/cs3org/reva/cmd/revad.goVersion=$(GO_VERSION) -X github.com/cs3org/reva/cmd/revad.buildDate=$(BUILD_DATE)"
BUILD_FLAGS = "-X github.com/cs3org/reva/cmd/revad.gitCommit=$(GIT_COMMIT) -X github.com/cs3org/reva/cmd/revad.version=$(VERSION) -X github.com/cs3org/reva/cmd/revad.goVersion=$(GO_VERSION) -X github.com/cs3org/reva/cmd/revad.buildDate=$(BUILD_DATE)"

.PHONY: revad
revad:
go build -ldflags $(BUILD_FLAGS) -o ./cmd/revad/revad ./cmd/revad/main
reva:
go build -ldflags -extldflags=-static $(BUILD_FLAGS) -o ./cmd/revad/revad ./cmd/revad/main

.PHONY: revad-ceph
revad-ceph:
go build -ldflags $(BUILD_FLAGS) -tags ceph -o ./cmd/revad/revad ./cmd/revad/main

.PHONY: reva
reva:
go build -ldflags $(BUILD_FLAGS) -o ./cmd/reva/reva ./cmd/reva
go build -ldflags -extldflags=-static $(BUILD_FLAGS) -o ./cmd/reva/reva ./cmd/reva

.PHONY: docker-reva
docker-reva:
Expand Down

0 comments on commit d75b1d9

Please sign in to comment.