imposm3/Makefile

35 lines
780 B
Makefile
Raw Normal View History

2013-08-29 18:57:16 +04:00
.PHONY: test all build clean
PROTOFILES=$(shell find . -name \*.proto)
PBGOFILES=$(patsubst %.proto,%.pb.go,$(PROTOFILES))
2013-09-04 16:19:36 +04:00
GOFILES=$(shell find . \( -name \*.go ! -name version.go \) )
2013-08-29 18:57:16 +04:00
# for protoc-gen-go
export PATH := $(GOPATH)/bin:$(PATH)
GOLDFLAGS=-ldflags '-r ${ORIGIN}:${ORIGIN}/../lib'
2013-09-04 16:19:36 +04:00
BUILD_DATE=$(shell date +%Y%m%d)
BUILD_REV=$(shell git rev-parse --short HEAD)
BUILD_VERSION=dev-$(BUILD_DATE)-$(BUILD_REV)
2013-08-29 18:57:16 +04:00
all: build test
imposm3: $(GOFILES) $(PROTOFILES)
2013-09-04 17:21:12 +04:00
@sed -i='' 's/buildVersion = ".*"/buildVersion = "$(BUILD_VERSION)"/' version.go
2013-08-29 18:57:16 +04:00
go build $(GOLDFLAGS)
2013-09-04 17:21:12 +04:00
@sed -i='' 's/buildVersion = ".*"/buildVersion = ""/' version.go
2013-08-29 18:57:16 +04:00
build: imposm3
clean:
rm -f imposm3
2013-09-02 14:07:15 +04:00
(cd test && make clean)
2013-08-29 18:57:16 +04:00
test:
2013-09-02 14:07:15 +04:00
(cd test && make test)
2013-08-29 18:57:16 +04:00
%.pb.go: %.proto
protoc --go_out=. $^