Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Makefile - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b839541e0d0daa2525e28b9d3ac679f94fc66087 (plain)
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Top-level Makefile for Gitaly
#
# Responsibilities of this file:
# - create GOPATH in _build with symlink to current dir
# - re-generate _build/Makefile from makegen.go on each run
# - dispatch commands to _build/Makefile
#
# Besides the targets that manage _build and _build/Makefile, all
# targets in this Makefile should look like this:
#
# .PHONY: foobar
# foobar: prepare-build
# 	cd $(BUILD_DIR) && $(MAKE) $@
#
# All other logic should happen in _support/Makefile.template and
# _support/makegen.go.
#

BUILD_DIR = _build
PKG = gitlab.com/gitlab-org/gitaly
MAKEGEN = $(BUILD_DIR)/makegen

# These variables are used by makegen
export SOURCE_DIR := $(CURDIR)

# Used to build _support/makegen.go
export GO111MODULE = on

all: build

.PHONY: build
build: prepare-build
	cd $(BUILD_DIR) && $(MAKE) install INSTALL_DEST_DIR=$(CURDIR)

.PHONY: build-gitaly-remote
build-gitaly-remote: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: test-gitaly-remote
test-gitaly-remote: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: install
install: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: assemble
assemble: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: binaries
binaries: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: prepare-tests
prepare-tests: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: test
test: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: test-with-praefect
test-with-praefect: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: test-with-proxies
test-with-proxies: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: rspec
rspec: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: rspec-gitlab-shell
rspec-gitlab-shell: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: test-postgres
test-postgres: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: verify
verify: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: lint
lint: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: lint-warnings
lint-warnings: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: format
format: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: cover
cover: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: notice
notice: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: race-go
race-go: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: docker
docker: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: proto
proto: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: no-changes
no-changes: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: smoke-test
smoke-test: prepare-build
	cd $(BUILD_DIR) && $(MAKE) $@

.PHONY: prepare-build
prepare-build: $(BUILD_DIR)/.ok update-makefile
$(BUILD_DIR)/.ok:
	mkdir -p $(BUILD_DIR)
	touch $@

.PHONY: update-makefile
update-makefile: _build/makegen $(BUILD_DIR)/.ok
	cd $(BUILD_DIR) && ./makegen > Makefile

# This go.mod file soaks up go.mod/go.sum changes that we don't want in the top-level go.mod.
$(BUILD_DIR)/go.mod: $(BUILD_DIR)/.ok
	(cd $(BUILD_DIR) && go mod init _build)

_build/makegen: _support/makegen.go $(BUILD_DIR)/go.mod
	cd $(BUILD_DIR) && go build -o $(CURDIR)/$@ $(SOURCE_DIR)/_support/makegen.go

clean:
	git clean -fdX