~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/gopkg.in/juju/charmstore.v5-unstable/Makefile

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
PROJECT := gopkg.in/juju/charmstore.v5-unstable
8
8
PROJECT_DIR := $(shell go list -e -f '{{.Dir}}' $(PROJECT))
9
9
 
 
10
GIT_COMMIT := $(shell git rev-parse --verify HEAD)
 
11
VERSION := $(shell git describe --dirty)
 
12
 
 
13
 
10
14
ifeq ($(shell uname -p | sed -r 's/.*(x86|armel|armhf).*/golang/'), golang)
11
15
        GO_C := golang
12
16
        INSTALL_FLAGS :=
25
29
  elasticsearch
26
30
endef
27
31
 
 
32
ifeq ($(VERSION),no)
 
33
        VERSIONDEPS :=
 
34
else
 
35
        VERSIONDEPS := version/init.go
 
36
endif
 
37
 
28
38
default: build
29
39
 
30
40
$(GOPATH)/bin/godeps:
31
 
        go get -v launchpad.net/godeps
 
41
        # godeps needs to be fetched with the insecure flag as launchpad
 
42
        # uses http for part of the checkout process.
 
43
        go get -v -insecure launchpad.net/godeps
32
44
 
33
45
# Start of GOPATH-dependent targets. Some targets only make sense -
34
46
# and will only work - when this tree is found on the GOPATH.
35
47
ifeq ($(CURDIR),$(PROJECT_DIR))
36
48
 
37
 
build:
 
49
build: $(VERSIONDEPS)
38
50
        go build $(PROJECT)/...
39
51
 
40
 
check:
 
52
check: $(VERSIONDEPS)
41
53
        go test $(PROJECT)/...
42
54
 
43
 
install:
 
55
install: $(VERSIONDEPS)
44
56
        go install $(INSTALL_FLAGS) -v $(PROJECT)/...
45
57
 
46
58
clean:
83
95
create-deps: $(GOPATH)/bin/godeps
84
96
        godeps -t $(shell go list $(PROJECT)/...) > dependencies.tsv || true
85
97
 
 
98
# Generate version information
 
99
version/init.go: version/init.go.tmpl FORCE
 
100
        gofmt -r "unknownVersion -> Version{GitCommit: \"${GIT_COMMIT}\", Version: \"${VERSION}\",}" $< > $@
 
101
 
86
102
# Install packages required to develop the charm store and run tests.
87
103
APT_BASED := $(shell command -v apt-get >/dev/null; echo $$?)
88
104
sysdeps:
120
136
        @echo 'make simplify - Format and simplify the source files.'
121
137
        @echo 'make gopkg - Output the current gopkg repository path and version.'
122
138
 
123
 
.PHONY: build check clean format gopkg help install simplify sysdeps
 
139
.PHONY: build check clean format gopkg help install simplify sysdeps FORCE