aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoseph Richey <joerichey@google.com>2017-07-13 20:19:49 -0700
committerGitHub <noreply@github.com>2017-07-13 20:19:49 -0700
commit424e63311034da878d032362b706b835373dc994 (patch)
tree86dcd4c29c942e722fd37c0f3e55d5b59b7d1410 /Makefile
parent6e459e6ddb91bf33e60c4bf7a47b62fd5a280bd3 (diff)
parentd54a42b8646a4ee8c030f316803539ecff3d297d (diff)
Merge pull request #14 from google/docs
Version now uses git tags and releases
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 3 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index dc24e67..56b3646 100644
--- a/Makefile
+++ b/Makefile
@@ -16,13 +16,6 @@
# the License.
NAME = fscrypt
-# VERSION is formatted as <major>.<minor>.<bugfix>
-# Bugfix releases resolve issues in existing features.
-# Minor releases introduce new features.
-# Major releases may introduce breaking changes to the API.
-VERSION = 0.1.0
-# Holds a formatted string of the build time
-BUILD_TIME = $(shell date)
CFLAGS += -O2 -Wall
CMD_DIR = github.com/google/$(NAME)/cmd/$(NAME)
@@ -39,10 +32,10 @@ CMD_DIR = github.com/google/$(NAME)/cmd/$(NAME)
# Set the C flags so we don't need to set C flags in each CGO file.
export CGO_CFLAGS = $(CFLAGS)
-# Pass the version to the command line program
-VERSION_FLAG = -X "main.version=$(VERSION)"
+# Pass the version to the command line program (pulled from tags)
+VERSION_FLAG = -X "main.version=$(shell git describe --tags)"
# Pass the current date and time to the command line program
-DATE_FLAG = -X "main.buildTime=$(BUILD_TIME)"
+DATE_FLAG = -X "main.buildTime=$(shell date)"
# Pass the C linking flags into Go
GO_LINK_FLAGS += -s -w $(VERSION_FLAG) $(DATE_FLAG) -extldflags "$(LDFLAGS)"
GOFLAGS += --ldflags '$(GO_LINK_FLAGS)'