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 2f5041d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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
go build -ldflags $(BUILD_FLAGS) -extldflags=-static -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 $(BUILD_FLAGS) -extldflags=-static -o ./cmd/reva/reva ./cmd/reva

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

0 comments on commit 2f5041d

Please sign in to comment.