-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (41 loc) · 1.84 KB
/
Makefile
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
42
43
44
45
46
47
48
49
50
CWD=$(shell pwd)
GOPATH := $(CWD)
prep:
if test -d pkg; then rm -rf pkg; fi
self: prep rmdeps
if -d src; then rm -rf src; fi
mkdir -p src/github.com/whosonfirst/go-whosonfirst-mmdb/
cp *.go src/github.com/whosonfirst/go-whosonfirst-mmdb/
mkdir -p src/github.com/whosonfirst/go-whosonfirst-mmdb/provider
cp provider/*.go src/github.com/whosonfirst/go-whosonfirst-mmdb/provider/
cp -r vendor/* src/
rmdeps:
if test -d src; then rm -rf src; fi
build: fmt bin
# if you're wondering about the 'rm -rf' stuff below it's because Go is
# weird... https://vanduuren.xyz/2017/golang-vendoring-interface-confusion/
# (20170912/thisisaaronland)
deps:
@GOPATH=$(GOPATH) go get -u "github.com/oschwald/maxminddb-golang"
@GOPATH=$(GOPATH) go get -u "github.com/whosonfirst/go-whosonfirst-csv"
@GOPATH=$(GOPATH) go get -u "github.com/whosonfirst/go-whosonfirst-geojson-v2"
@GOPATH=$(GOPATH) go get -u "github.com/whosonfirst/go-whosonfirst-iplookup"
@GOPATH=$(GOPATH) go get -u "github.com/whosonfirst/go-whosonfirst-log"
@GOPATH=$(GOPATH) go get -u "github.com/whosonfirst/go-whosonfirst-spr"
@GOPATH=$(GOPATH) go get -u "github.com/whosonfirst/go-whosonfirst-uri"
rm -rf src/github.com/whosonfirst/go-whosonfirst-iplookup/vendor/github.com/whosonfirst/go-whosonfirst-spr
rm -rf src/github.com/whosonfirst/go-whosonfirst-geojson-v2/vendor/github.com/whosonfirst/go-whosonfirst-flags
vendor-deps: rmdeps deps
if test -d vendor; then rm -rf vendor; fi
mkdir vendor
cp -r src/* vendor/
find vendor -name '.git' -print -type d -exec rm -rf {} +
rm -rf src
rm -rf vendor/github.com/oschwald/maxminddb-golang/test-data
fmt:
go fmt *.go
go fmt cmd/*.go
bin: self
@GOPATH=$(GOPATH) go build -o bin/wof-mmdb cmd/wof-mmdb.go
@GOPATH=$(GOPATH) go build -o bin/wof-mmdb-prepare cmd/wof-mmdb-prepare.go
@GOPATH=$(GOPATH) go build -o bin/wof-mmdb-server cmd/wof-mmdb-server.go