Skip to content

Commit

Permalink
Merge pull request #6411 from ipfs/build/gogo-from-gomod
Browse files Browse the repository at this point in the history
build: use protoc-gen-* from gomod
  • Loading branch information
Stebalien committed Jun 5, 2019
2 parents 1fd5f9d + 6b0f9f7 commit f72ae26
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ gx-workspace-update.json

.ipfs
bin/gx
bin/protoc-*
bin/gx*
bin/tmp
bin/gocovmerge
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

SHELL=PATH='$(PATH)' /bin/sh

PROTOC = protoc --gogofaster_out=. --proto_path=.:$(GOPATH)/src:$(dir $@) $<

# enable second expansion
.SECONDEXPANSION:

Expand Down
5 changes: 3 additions & 2 deletions Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ DISTCLEAN :=
TEST :=
TEST_SHORT :=
GOCC ?= go
PROTOC ?= protoc

all: help # all has to be first defined target
.PHONY: all
Expand Down Expand Up @@ -58,8 +59,8 @@ include $(dir)/Rules.mk
# universal rules #
# -------------------- #

%.pb.go: %.proto
$(PROTOC)
%.pb.go: %.proto bin/protoc-gen-gogofaster
$(PROTOC) --gogofaster_out=. --proto_path=.:$(GOPATH)/src:$(dir $@) $<

# -------------------- #
# core targets #
Expand Down
7 changes: 5 additions & 2 deletions bin/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include mk/header.mk

dist_root_$(d)="/ipfs/QmPrXH9jRVwvd7r5MC5e6nV4uauQGzLk1i2647Ye9Vbbwe"

TGTS_$(d) := $(d)/gx $(d)/gx-go
DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*) $(d)/tmp
TGTS_$(d) := $(d)/protoc
DISTCLEAN += $(d)/protoc $(d)/tmp

PATH := $(realpath $(d)):$(PATH)

Expand All @@ -15,5 +15,8 @@ else
ln -s $(notdir $^) $@
endif

bin/protoc-gen-gogofaster:
$(call go-build,github.com/gogo/protobuf/protoc-gen-gogofaster)

CLEAN += $(TGTS_$(d))
include mk/footer.mk

0 comments on commit f72ae26

Please sign in to comment.