-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (35 loc) · 956 Bytes
/
Makefile
File metadata and controls
41 lines (35 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
PROJECTNAME=$(shell basename $(PWD))
GOFILES = $(wildcard */*.go)
# Make is verbose in Linux. Made it silent
MAKEFLAGS += --silent
## usage: make [option]
## Options:
.PHONY : help
help : Makefile
echo "\n$(PROJECTNAME) is an example custom blockchain built in golang\n"
sed -n 's/^## //p' $<
sed -n 's/^###//p' $<
### build: Build the project
.PHONY : build
build:
@echo " > Building binary..."
@go build -o bin/$(PROJECTNAME)
@echo " > Binary build complete - bin/$(PROJECTNAME)"
### run: Run the project
.PHONY : run
run: build
@echo " > Running binary..."
@./bin/$(PROJECTNAME)
### test: Run tests
.PHONY : test
test:
@echo " > Running tests..."
@go test -v ./...
### proto: Generate protobuf files
.PHONY : proto
proto:
@echo " > Generating protobuf files..."
@protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
./proto/*.proto
@echo " > Protobuf files generated"