imposm3/Makefile

66 lines
1.5 KiB
Makefile
Raw Normal View History

2015-05-07 17:41:06 +03:00
.PHONY: test all build clean test test-system test-unit update_version docs
2013-08-29 18:57:16 +04:00
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)
2013-09-04 17:23:16 +04:00
GOLDFLAGS=-ldflags '-r $${ORIGIN}/lib'
2013-08-29 18:57:16 +04:00
2014-10-10 18:12:01 +04:00
GO=godep go
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
2013-12-02 18:02:10 +04:00
update_version:
@perl -p -i -e 's/buildVersion = ".*"/buildVersion = "$(BUILD_VERSION)"/' cmd/version.go
2013-12-02 18:02:10 +04:00
revert_version:
@perl -p -i -e 's/buildVersion = ".*"/buildVersion = ""/' cmd/version.go
2013-12-02 18:02:10 +04:00
imposm3: $(PBGOFILES) $(GOFILES)
2013-12-02 18:02:10 +04:00
$(MAKE) update_version
2014-10-10 18:12:01 +04:00
$(GO) build $(GOLDFLAGS)
2013-12-02 18:02:10 +04:00
$(MAKE) revert_version
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
2013-10-29 17:08:39 +04:00
test: test-unit test-system
test-unit: imposm3
2014-10-10 18:12:01 +04:00
$(GO) test ./... -i
$(GO) test ./...
2013-10-29 17:08:39 +04:00
test-system: imposm3
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=. $^
2015-05-07 17:41:06 +03:00
docs:
(cd docs && make html)
REMOTE_DOC_LOCATION = omniscale.de:domains/imposm.org/docs/imposm3
DOC_VERSION = 3.0.0
upload-docs: docs
rsync -a -v -P -z docs/_build/html/ $(REMOTE_DOC_LOCATION)/$(DOC_VERSION)
2015-08-27 10:50:07 +03:00
build-license-deps:
rm LICENSE.deps
find ./Godeps/_workspace/src -iname license\* -exec bash -c '\
dep=$${1#./Godeps/_workspace/src/}; \
(echo -e "========== $$dep ==========\n"; cat $$1; echo -e "\n\n") \
| fold -s -w 80 \
>> LICENSE.deps \
' _ {} \;