build: use protoc-gen-* from gomod
Also, * Make it possible to override the PROTOC binary. * Remove gx targets.
Steven Allen committed
Jun 5, 2019 at 10:57 UTC
6b0f9f71e05d9b93f1690a267a4c6d4808ff76b9
4 files changed
+9
-6
.gitignore
+1
@@ -15,6 +15,7 @@ gx-workspace-update.json
15
16
.ipfs
17
bin/gx
18
+bin/protoc-*
19
bin/gx*
20
bin/tmp
21
bin/gocovmerge
Makefile
-2
@@ -2,8 +2,6 @@
2
3
SHELL=PATH='$(PATH)' /bin/sh
4
5
-PROTOC = protoc --gogofaster_out=. --proto_path=.:$(GOPATH)/src:$(dir $@) $<
6
-
5
# enable second expansion
6
.SECONDEXPANSION:
7
Rules.mk
+3
-2
@@ -5,6 +5,7 @@ DISTCLEAN :=
5
TEST :=
6
TEST_SHORT :=
7
GOCC ?= go
8
+PROTOC ?= protoc
9
10
all: help # all has to be first defined target
11
.PHONY: all
@@ -58,8 +59,8 @@ include $(dir)/Rules.mk
59
# universal rules #
60
# -------------------- #
61
61
-%.pb.go: %.proto
62
- $(PROTOC)
62
+%.pb.go: %.proto bin/protoc-gen-gogofaster
63
+ $(PROTOC) --gogofaster_out=. --proto_path=.:$(GOPATH)/src:$(dir $@) $<
64
65
# -------------------- #
66
# core targets #
bin/Rules.mk
+5
-2
@@ -2,8 +2,8 @@ include mk/header.mk
2
3
dist_root_$(d)="/ipfs/QmPrXH9jRVwvd7r5MC5e6nV4uauQGzLk1i2647Ye9Vbbwe"
4
5
-TGTS_$(d) := $(d)/gx $(d)/gx-go
6
-DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*) $(d)/tmp
5
+TGTS_$(d) := $(d)/protoc
6
+DISTCLEAN += $(d)/protoc $(d)/tmp
7
8
PATH := $(realpath $(d)):$(PATH)
9
@@ -15,5 +15,8 @@ else
15
ln -s $(notdir $^) $@
16
endif
17
18
+bin/protoc-gen-gogofaster:
19
+ $(call go-build,github.com/gogo/protobuf/protoc-gen-gogofaster)
20
+
21
CLEAN += $(TGTS_$(d))
22
include mk/footer.mk