-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
73 lines (61 loc) · 1.9 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
PLATFORMS= \
freebsd-386 \
freebsd-amd64 \
freebsd-arm \
linux-386 \
linux-amd64 \
linux-arm \
openbsd-386 \
openbsd-amd64 \
windows-386 \
windows-amd64 \
darwin-386 \
darwin-amd64 \
$(NULL)
DIST=$(shell pwd)/dist
export GOPATH=$(shell pwd)
test: src/gopkg.in/coryb/cliby.v1
go test -v
debug: src/gopkg.in/coryb/cliby.v1
cd src/gopkg.in/coryb/cliby.v1 && go get -v github.com/mailgun/godebug && $(GOPATH)/bin/godebug test -instrument gopkg.in/coryb/cliby.v1,encoding/json
src/%:
mkdir -p $(@D)
test -L $@ || ln -sf ../../.. $@
go get -v -t $*
cross-setup:
for p in $(PLATFORMS); do \
echo "Building for $$p"; \
cd $(GOROOT)/src && sudo GOOS=$${p/-*/} GOARCH=$${p/*-/} bash ./make.bash --no-clean; \
done
all:
rm -rf $(DIST); \
mkdir -p $(DIST); \
cd src/github.com/Netflix-Skunkworks/go-jira/jira; \
go get -d; \
for p in $(PLATFORMS); do \
echo "Building for $$p"; \
GOOS=$${p/-*/} GOARCH=$${p/*-/} go build -v -ldflags -s -o $(DIST)/jira-$$p; \
done
fmt:
gofmt -s -w *.go util/*.go
install:
export GOBIN=~/bin && ${MAKE} build
CURVER ?= $(shell git describe --abbrev=0 --tags)
NEWVER ?= $(shell echo $(CURVER) | awk -F. '{print $$1"."$$2"."$$3+1}')
TODAY := $(shell date +%Y-%m-%d)
changes:
@git log --pretty=format:"* %s [%cn] [%h]" --no-merges ^$(CURVER) HEAD jira | grep -v gofmt | grep -v "bump version"
update-changelog:
@echo "# Changelog" > CHANGELOG.md.new; \
echo >> CHANGELOG.md.new; \
echo "## $(NEWVER) - $(TODAY)" >> CHANGELOG.md.new; \
echo >> CHANGELOG.md.new; \
$(MAKE) changes | \
perl -pe 's{\[([a-f0-9]+)\]}{[[$$1](https://github.com/coryb/cliby/commit/$$1)]}g' | \
perl -pe 's{\#(\d+)}{[#$$1](https://github.com/coryb/cliby/issues/$$1)}g' >> CHANGELOG.md.new; \
tail +2 CHANGELOG.md >> CHANGELOG.md.new; \
mv CHANGELOG.md.new CHANGELOG.md; \
git commit -m "Updated Changelog" CHANGELOG.md; \
git tag $(NEWVER)
clean:
rm -rf pkg dist bin src