doesn't build yet
This commit is contained in:
32
Makefile
Normal file
32
Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
VERSION := $(shell git rev-parse --short HEAD)
|
||||
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
|
||||
BUILDTIMEFILENAME := $(shell date -u '+%Y%m%d-%H%M%SZ')
|
||||
BUILDTIMETAG := $(shell date -u '+%Y%m%d%H%M%S')
|
||||
BUILDUSER := $(shell whoami)
|
||||
BUILDHOST := $(shell hostname -s)
|
||||
BUILDARCH := $(shell uname -m)
|
||||
|
||||
FN := sco
|
||||
IMAGENAME := sneak/$(FN)
|
||||
|
||||
UNAME_S := $(shell uname -s)
|
||||
|
||||
GOLDFLAGS += -X main.Version=$(VERSION)
|
||||
GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
|
||||
|
||||
# osx can't statically link apparently?!
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
GOFLAGS := -ldflags "$(GOLDFLAGS)"
|
||||
endif
|
||||
|
||||
ifneq ($(UNAME_S),Darwin)
|
||||
GOFLAGS = -ldflags "-linkmode external -extldflags -static $(GOLDFLAGS)"
|
||||
endif
|
||||
|
||||
default: ./$(FN)
|
||||
|
||||
go-get:
|
||||
cd cmd/$(FN) && go get -v
|
||||
|
||||
./$(FN): */*.go cmd/*/*.go go-get
|
||||
cd cmd/$(FN) && go build -o ../../$(FN) $(GOFLAGS) .
|
||||
Reference in New Issue
Block a user