From ae3696e82d146eb6856e8662b3ca197c2b396d79 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Sun, 4 Sep 2016 19:20:55 +0300 Subject: [PATCH] Use Python to get date in cross-platform way I was able to build micro with Mozilla's pymake on Windows --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8df045c6..a1f6effa 100644 --- a/Makefile +++ b/Makefile @@ -2,17 +2,18 @@ VERSION = $(shell git describe --tags --abbrev=0) HASH = $(shell git rev-parse --short HEAD) +DATE = $(shell python -c 'import time; print(time.strftime("%B %d, %Y"))') # Builds micro after checking dependencies but without updating the runtime build: deps tcell - go build -ldflags "-X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(shell date -u '+%B %d, %Y')'" -o micro ./cmd/micro + go build -ldflags "-X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(DATE)'" -o micro ./cmd/micro # Builds micro after building the runtime and checking dependencies build-all: runtime build # Builds micro without checking for dependencies build-quick: - go build -ldflags "-X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(shell date -u '+%B %d, %Y')'" -o micro ./cmd/micro + go build -ldflags "-X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(DATE)'" -o micro ./cmd/micro # Same as 'build' but installs to $GOPATH/bin afterward install: build