27 lines
466 B
Makefile
27 lines
466 B
Makefile
|
.PHONY: test all build clean
|
||
|
|
||
|
PROTOFILES=$(shell find . -name \*.proto)
|
||
|
PBGOFILES=$(patsubst %.proto,%.pb.go,$(PROTOFILES))
|
||
|
GOFILES=$(shell find . -name \*.go)
|
||
|
|
||
|
# for protoc-gen-go
|
||
|
export PATH := $(GOPATH)/bin:$(PATH)
|
||
|
|
||
|
GOLDFLAGS=-ldflags '-r ${ORIGIN}:${ORIGIN}/../lib'
|
||
|
|
||
|
all: build test
|
||
|
|
||
|
imposm3: $(GOFILES) $(PROTOFILES)
|
||
|
go build $(GOLDFLAGS)
|
||
|
|
||
|
build: imposm3
|
||
|
|
||
|
clean:
|
||
|
rm -f imposm3
|
||
|
|
||
|
test:
|
||
|
(cd test && nosetests -v test.py)
|
||
|
|
||
|
%.pb.go: %.proto
|
||
|
protoc --go_out=. $^
|