2016-01-04 13:19:28 +03:00
|
|
|
.PHONY: all test clean files
|
2013-08-30 19:20:07 +04:00
|
|
|
|
2013-11-13 16:30:41 +04:00
|
|
|
ifdef VERBOSE
|
2015-12-21 14:54:36 +03:00
|
|
|
TESTOPTS = -v
|
2013-11-13 16:30:41 +04:00
|
|
|
else
|
2015-12-21 14:54:36 +03:00
|
|
|
TESTOPTS =
|
2013-11-13 16:30:41 +04:00
|
|
|
endif
|
|
|
|
|
2015-12-21 14:54:36 +03:00
|
|
|
all: test
|
2013-08-30 19:20:07 +04:00
|
|
|
|
|
|
|
clean:
|
2018-04-05 21:10:45 +03:00
|
|
|
rm generated/*.{pbf,gz}
|
2013-08-30 19:20:07 +04:00
|
|
|
|
2018-04-05 21:10:45 +03:00
|
|
|
PBF_FILES=$(addprefix generated/,$(patsubst %.osm,%.pbf,$(wildcard *.osm)))
|
|
|
|
OSCGZ_FILES=$(addprefix generated/,$(patsubst %.osc,%.osc.gz,$(wildcard *.osc)))
|
2015-12-21 14:54:36 +03:00
|
|
|
|
2018-04-05 21:10:45 +03:00
|
|
|
generated/%.pbf: %.osm
|
2016-01-04 13:19:28 +03:00
|
|
|
osmosis --read-xml $< --sort type="TypeThenId" --write-pbf $@ omitmetadata=true
|
2013-08-30 19:20:07 +04:00
|
|
|
|
2018-04-05 21:10:45 +03:00
|
|
|
generated/%.osc.gz: %.osc
|
2014-06-19 13:51:15 +04:00
|
|
|
gzip --stdout $< > $@
|
2013-08-30 19:20:07 +04:00
|
|
|
|
2016-01-04 13:19:28 +03:00
|
|
|
files: $(PBF_FILES) $(OSCGZ_FILES)
|
|
|
|
|
|
|
|
test: files
|
2016-04-27 10:45:07 +03:00
|
|
|
(cd .. && go test ./test $(TESTOPTS))
|
2014-06-19 13:51:15 +04:00
|
|
|
|
2016-01-04 13:19:28 +03:00
|
|
|
route_relation: files
|
2016-04-27 10:45:07 +03:00
|
|
|
(cd .. && go test -test.run TestRouteRelation_ ./test $(TESTOPTS))
|