Skip to content
Snippets Groups Projects
Select Git revision
  • 9d7a41b35eebbb3427cbf5418fa1e5b7e2010a33
  • develop default protected
  • congestioncontrol
  • merge-v-data-collection-spammer-0.8.2
  • WIP-merge-v-data-collection-spammer-0.8.2
  • merge-v-data-collection-spammer-0.7.7
  • tmp
  • test-masterpow-fixing
  • test-masterpow
  • test-echo
  • v-data-collection
  • v-data-collection-spammer
  • tmp-dump-spam-info
  • dump-msg-info-0.3.1
  • test-dump-message-info
  • spammer-exprandom
  • extra/tutorial
  • without_tipselection
  • hacking-docker-network
  • hacking-docker-network-0.2.3
  • master
  • v0.2.3
22 results

Makefile

Blame
  • user avatar
    Luca Moser authored and Wolfgang Welz committed
    17b58973
    History
    Makefile 1.07 KiB
    SHELL := /bin/bash
    REPO := $(shell pwd)
    GOFILES_NOVENDOR := $(shell go list -f "{{.Dir}}" ./...)
    PACKAGES_NOVENDOR := $(shell go list ./...)
    PROTOC_GEN_GO := $(GOPATH)/bin/protoc-gen-go
    
    # Protobuf generated go files
    PROTO_FILES = $(shell find . -path ./vendor -prune -o -type f -name '*.proto' -print)
    PROTO_GO_FILES = $(patsubst %.proto, %.pb.go, $(PROTO_FILES))
    PROTO_GO_FILES_REAL = $(shell find . -path ./vendor -prune -o -type f -name '*.pb.go' -print)
    
    .PHONY: build
    build: proto
    	go build -o goshimmer
    
    # Protobuffing
    .PHONY: proto
    proto: $(PROTO_GO_FILES)
    
    # If $GOPATH/bin/protoc-gen-go does not exist, we'll run this command to install it.
    $(PROTOC_GEN_GO):
    	(GO111MODULE=off go get -v github.com/golang/protobuf/protoc-gen-go)
    
    # Implicit compile rule for GRPC/proto files
    %.pb.go: %.proto | $(PROTOC_GEN_GO)
    	protoc $< --go_out=plugins=grpc,paths=source_relative:.
    
    .PHONY: clean_proto
    clean_proto:
    	@rm -f $(PROTO_GO_FILES_REAL)
    
    .PHONY: vet
    vet:
    	@echo "Running go vet."
    	@go vet ${PACKAGES_NOVENDOR}
    
    .PHONY: test
    test: vet
    	go test -timeout 30s ./... ${GOPACKAGES_NOVENDOR}