summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Duvall <dduvall@wikimedia.org>2018-11-16 10:09:20 -0800
committerDan Duvall <dduvall@wikimedia.org>2018-11-16 10:09:20 -0800
commitfe819ae6a6265010e7d23861f5d35ecfec0454a6 (patch)
treeff26ac03c01786b0b8d2440529c7e09efe38cb8a
parent882f0fcc875c0bef106a61fdb186554870539dab (diff)
downloadblubber-fe819ae6a6265010e7d23861f5d35ecfec0454a6.tar.gz
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
-rw-r--r--Makefile24
1 files 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)