-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
74 lines (56 loc) · 2.26 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
74
include header.mk
PACKAGES = src
export ABS_ROOT_PATH=$(shell pwd)
.PHONY: packages $(PACKAGES)
packages: $(PACKAGES)
$(PACKAGES):
$(MAKE) -C $@
# the sets of directories to do various things in
INITPACKAGES = $(PACKAGES:%=init-%)
INSTALLPACKAGES = $(PACKAGES:%=package-install-%)
DEVINSTALLPACKAGES = $(PACKAGES:%=dev-install-%)
CLEANPACKAGES = $(PACKAGES:%=clean-%)
TESTPACKAGES = $(PACKAGES:%=test-%)
LINTPACKAGES = $(PACKAGES:%=lint-%)
FORMATPACKAGES = $(PACKAGES:%=format-%)
BUMPVERSIONPACKAGES = $(PACKAGES:%=bumpversion-%)
help: ## Prints this help text
@python -c "$$PRINT_HELP_PYSCRIPT" < Makefile
package-install: $(INSTALLPACKAGES) ## Installs all packages without dev dependencies
$(INSTALLPACKAGES):
$(MAKE) -C $(@:package-install-%=%) package-install
dev-install: $(DEVINSTALLPACKAGES) ## Installs all packages without dev dependencies
$(DEVINSTALLPACKAGES):
$(MAKE) -C $(@:dev-install-%=%) dev-install
test: $(TESTPACKAGES) ## Run tests on all packages
$(TESTPACKAGES):
$(MAKE) -C $(@:test-%=%) test
test-coverage: $(TESTPACKAGES) ## Run tests coverage on all packages
$(TESTPACKAGES):
$(MAKE) -C $(@:test-%=%) test-coverage
clean: $(CLEANPACKAGES) ## Remove all build, test, coverage and Python artifacts
$(CLEANPACKAGES):
$(MAKE) -C $(@:clean-%=%) clean
bumpversion: ${BUMPVERSIONPACKAGES} ## Bumps the (default: patch) version of all release packages. To bump minor or major, add bump=minor or bump=major to the make call.
$(BUMPVERSIONPACKAGES):
$(MAKE) -C $(@:bumpversion-%=%) bumpversion
lint: $(LINTPACKAGES)
$(LINTPACKAGES):
$(MAKE) -C $(@:lint-%=%) lint
format: $(FORMATPACKAGES)
$(FORMATPACKAGES):
$(MAKE) -C $(@:format-%=%) format
check: ## Runs pre-commit hooks on all files
pre-commit run --all-files
docker-build: ## Build and package Docker container
docker build -t cdevents -f Dockerfile .
docker-shell: ## Opens a bash
docker run --rm --network host --volume $(pwd)/output/:/root/cdevents-client/ -it cdevents bash
.PHONY: packages $(PACKAGES)
.PHONY: packages $(INITPACKAGES)
.PHONY: packages $(INSTALLPACKAGES)
.PHONY: packages $(DEVINSTALLPACKAGES)
.PHONY: packages $(TESTPACKAGES)
.PHONY: packages $(CLEANPACKAGES)
.PHONY: packages $(BUMPVERSIONPACKAGES)
.PHONY: init test clean bumpversion install internal-install check docker-build docker-shell