forked from Cloud-Foundations/Dominator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
119 lines (87 loc) · 3.08 KB
/
Makefile
File metadata and controls
119 lines (87 loc) · 3.08 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
all: generate
CGO_ENABLED=0 go install ./cmd/*
@cd c; make
go vet -composites=false ./cmd/*
build-darwin: generate
(CGO_ENABLED=0 GOOS=darwin go build ./cmd/*)
build-linux: generate
(CGO_ENABLED=0 GOOS=linux go build ./cmd/*)
build-windows: generate
(CGO_ENABLED=0 GOOS=windows go build ./cmd/*)
install-darwin: generate
(CGO_ENABLED=0 GOOS=darwin go install ./cmd/*)
install-linux: generate
(CGO_ENABLED=0 GOOS=linux go install ./cmd/*)
install-linux-arm: generate
(CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go install ./cmd/*)
install-windows: generate
(CGO_ENABLED=0 GOOS=windows go install ./cmd/*)
disruption-manager.tarball: generate
@./scripts/make-tarball disruption-manager
dominator.tarball: generate
@./scripts/make-tarball dominator
filegen-server.tarball: generate
@./scripts/make-tarball filegen-server
fleet-manager.tarball: generate
@./scripts/make-tarball fleet-manager
hypervisor.tarball: generate
@./scripts/make-tarball hypervisor init.d/virtual-machines.* \
-C $(ETCDIR) ssl
image-unpacker.tarball: generate
@./scripts/make-tarball image-unpacker \
scripts/image-pusher/export-image
installer.tarball: generate
@cmd/installer/make-tarball installer
imageserver.tarball: generate
@./scripts/make-tarball imageserver
imaginator.tarball: generate
@./scripts/make-tarball imaginator
mdbd.tarball: generate
@./scripts/make-tarball mdbd
subd.tarball: generate
@cd c; make
@./scripts/make-tarball subd \
-C cmd/subd set-owner \
-C $(GOPATH) bin/run-in-mntns
UPSTREAM_REPO := https://github.com/Cloud-Foundations/Dominator.git
BUILD_INFO_FILE := lib/version/BUILD_INFO
BUILD_INFO_DEPS := .git/HEAD .git/logs/HEAD .git/refs/tags \
$(wildcard .git/packed-refs) Makefile
$(BUILD_INFO_FILE): $(BUILD_INFO_DEPS)
@version=$$(git describe --tags --always --match 'v[0-9]*.[0-9]*.[0-9]*'); \
raw_origin=$$(git remote get-url origin 2>/dev/null || echo unknown); \
origin=$$(echo "$$raw_origin" | sed -e 's|^git@[^:]*:||' -e 's|^https://github.com/||' -e 's|\.git$$||'); \
branch=$$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown); \
case "$$raw_origin" in *Cloud-Foundations*) is_fork=false;; *) is_fork=true;; esac; \
if [ "$$is_fork" = false ] && [ "$$branch" = "master" ]; then \
behind=0; \
elif [ -n "$(WITH_UPSTREAM)" ] && \
git fetch --quiet $(UPSTREAM_REPO) master 2>/dev/null; then \
behind=$$(git rev-list --count HEAD..FETCH_HEAD 2>/dev/null || echo -1); \
else \
behind=-1; \
fi; \
{ \
echo "version=$$version"; \
echo "origin=$$origin"; \
echo "branch=$$branch"; \
echo "behind=$$behind"; \
echo "fork=$$is_fork"; \
} > $@.tmp; \
if cmp -s $@.tmp $@; then rm $@.tmp; else mv $@.tmp $@; fi
build-info: $(BUILD_INFO_FILE)
build-info-upstream:
@$(MAKE) -B --no-print-directory $(BUILD_INFO_FILE) WITH_UPSTREAM=1
generate: build-info
format:
gofmt -s -w .
format-imports:
goimports -w .
test:
@find * -name '*_test.go' |\
sed -e 's@^@github.com/Cloud-Foundations/Dominator/@' -e 's@/[^/]*$$@@' |\
sort -u | xargs go test
vet:
go vet ./cmd/*
website:
@./scripts/make-website ${TARGET_DIR}