mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Updated makefile to build with ldflags
This commit is contained in:
parent
331c515ad2
commit
fa8f31e8d3
1 changed files with 8 additions and 2 deletions
10
Makefile
10
Makefile
|
|
@ -12,6 +12,12 @@ ifndef VERSION
|
||||||
$(error VERSION is not set. Please review and copy config.env.default to config.env and try again)
|
$(error VERSION is not set. Please review and copy config.env.default to config.env and try again)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef BUILD
|
||||||
|
$(error BUILD is not set. Please review and copy config.env.default to config.env and try again)
|
||||||
|
endif
|
||||||
|
|
||||||
|
LDFLAGS="-s -X=$(GIT)main.commit=$(BUILD) -X=$(GIT)main.version=$(VERSION) -X=$(GIT)main.date=$(shell date +%Y-%m-%d:%H:%M:%S)"
|
||||||
|
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
GOPATH ?= $(shell echo $${GOPATH:-~/go})
|
GOPATH ?= $(shell echo $${GOPATH:-~/go})
|
||||||
|
|
||||||
|
|
@ -54,8 +60,8 @@ release: ## goreleaser build
|
||||||
$(GOPATH)/bin/goreleaser build --clean --single-target --snapshot
|
$(GOPATH)/bin/goreleaser build --clean --single-target --snapshot
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: ## goreleaser build
|
build: ## go build
|
||||||
go build --tags=all
|
go build -v --tags=all -ldflags=$(LDFLAGS) -o $(NAME) main.go
|
||||||
|
|
||||||
.PHONY: docker
|
.PHONY: docker
|
||||||
container: ## docker build
|
container: ## docker build
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue