Skip to content

Commit

Permalink
Merge pull request #882 from ondrej-fabry/makefile
Browse files Browse the repository at this point in the history
Build enhancements
  • Loading branch information
VladoLavor committed Sep 14, 2018
2 parents a6ad051 + 7029479 commit 058c591
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Expand Up @@ -2,7 +2,7 @@ include vpp.env

VERSION ?= $(shell git describe --always --tags --dirty)
COMMIT ?= $(shell git rev-parse HEAD)
DATE := $(shell date +'%Y-%m-%dT%H:%M%:z')
DATE := $(shell git log -1 --format="%ct" | xargs -I{} date -d @{} +'%Y-%m-%dT%H:%M%:z')

CNINFRA := github.com/ligato/vpp-agent/vendor/github.com/ligato/cn-infra/agent
LDFLAGS = -X $(CNINFRA).BuildVersion=$(VERSION) -X $(CNINFRA).CommitHash=$(COMMIT) -X $(CNINFRA).BuildDate=$(DATE)
Expand All @@ -11,6 +11,11 @@ ifeq ($(NOSTRIP),)
LDFLAGS += -w -s
endif

ifeq ($(BUILDPIE),y)
GO_BUILD_ARGS += -buildmode=pie
LDFLAGS += -extldflags=-Wl,-z,now,-z,relro
endif

ifeq ($(V),1)
GO_BUILD_ARGS += -v
endif
Expand Down

0 comments on commit 058c591

Please sign in to comment.