-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
59 lines (48 loc) · 1.2 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
.PHONY: default
default: build doc ;
# Modules that can be built into an executable
BUILD_MODULES = webapp src
.PHONY: $(BUILD_MODULES)
# Documentation modules
DOC_MODULES = tcr-doc
.PHONY: $(DOC_MODULES)
# Modules with a main package
MAIN_MODULES = $(BUILD_MODULES) $(DOC_MODULES)
# Production modules
PROD_MODULES = $(BUILD_MODULES)
# Module dependencies
src: webapp
tcr-doc: src
# Convenience target for automating release preparation
.PHONY: prepare
prepare: deps tidy lint build doc test
.PHONY: deps tidy vet lint
deps tidy vet lint: $(MAIN_MODULES)
@for module in $^; do \
echo "- make $@ $$module"; \
$(MAKE) -C $$module $@; \
done
.PHONY: test test-short cov
test test-short cov: $(PROD_MODULES)
@for module in $^; do \
echo "- make $@ $$module"; \
$(MAKE) -C $$module $@; \
done
.PHONY: build download run
build download run: $(BUILD_MODULES)
@for module in $^; do \
echo "- make $@ $$module"; \
$(MAKE) -C $$module $@; \
done
.PHONY: doc
doc: $(DOC_MODULES)
@for module in $^; do \
echo "- make $@ $$module"; \
$(MAKE) -C $$module $@; \
done
.PHONY: release
release:
@goreleaser $(GORELEASER_ARGS)
.PHONY: snapshot
snapshot: GORELEASER_ARGS= --clean --snapshot
snapshot: release