forked from Masterminds/glide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (35 loc) · 1.21 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
VERSION := $(shell git describe --tags)
DIST_DIRS := find * -type d -exec
build:
go build -o glide -ldflags "-X main.version=${VERSION}" glide.go
install: build
install -d ${DESTDIR}/usr/local/bin/
install -m 755 ./glide ${DESTDIR}/usr/local/bin/glide
test:
go test . ./cmd ./gb
clean:
rm -f ./glide.test
rm -f ./glide
rm -rf ./dist
bootstrap:
mkdir ./vendor
git clone https://github.com/Masterminds/cookoo vendor/github.com/Masterminds/cookoo
git clone https://github.com/Masterminds/vcs vendor/github.com/Masterminds/vcs
git clone https://gopkg.in/yaml.v2 vendor/gopkg.in/yaml.v2
git clone https://github.com/codegangsta/cli vendor/github.com/codegangsta/cli
git clone https://github.com/Masterminds/semver vendor/github.com/Masterminds/semver
bootstrap-dist:
go get -u github.com/mitchellh/gox
build-all:
gox -verbose \
-ldflags "-X main.version=${VERSION}" \
-os="linux darwin windows " \
-arch="amd64 386" \
-output="dist/{{.OS}}-{{.Arch}}/{{.Dir}}" .
dist: build-all
cd dist && \
$(DIST_DIRS) cp ../LICENSE {} \; && \
$(DIST_DIRS) cp ../README.md {} \; && \
$(DIST_DIRS) tar -zcf glide-${VERSION}-{}.tar.gz {} \; && \
cd ..
.PHONY: build test install clean bootstrap bootstrap-dist build-all dist