From fe819ae6a6265010e7d23861f5d35ecfec0454a6 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Fri, 16 Nov 2018 10:09:20 -0800 Subject: Provide separate Makefile rules for building blubber/blubberoid Implemented additional rules in the Makefile to be more conventional. Now you can do `make [all]` for both blubber and blubberoid binaries without installing them, or `make blubber` and `make blubberoid` to build them independently. A `make clean` rule was also added. Change-Id: Iaf52d9fbbc1c377c26a0cb21810af2e3d93778e5 --- Makefile | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index afb2119..3ad6d93 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,27 @@ GO_LDFLAGS := \ -X $(PACKAGE)/meta.Version=$(shell cat VERSION) \ -X $(PACKAGE)/meta.GitCommit=$(shell git rev-parse --short HEAD) +# go build/install commands +# +# workaround bug in case CURDIR is a symlink +# see https://github.com/golang/go/issues/24359 +GO_BUILD := cd "$(REAL_CURDIR)" && go build -v -ldflags "$(GO_LDFLAGS)" +GO_INSTALL := cd "$(REAL_CURDIR)" && go install -v -ldflags "$(GO_LDFLAGS)" + +all: blubber blubberoid + +blubber: + $(GO_BUILD) ./cmd/blubber + +blubberoid: + $(GO_BUILD) ./cmd/blubberoid + +clean: + go clean + rm -f blubber blubberoid + install: - # workaround bug in case CURDIR is a symlink - # see https://github.com/golang/go/issues/24359 - cd "$(REAL_CURDIR)" && \ - go install -v -ldflags "$(GO_LDFLAGS)" $(GO_PACKAGES) + $(GO_INSTALL) $(GO_PACKAGES) release: gox -output="$(RELEASE_DIR)/{{.OS}}-{{.Arch}}/{{.Dir}}" -osarch='$(TARGETS)' -ldflags '$(GO_LDFLAGS)' $(GO_PACKAGES) -- cgit v1.2.1