-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
90 lines (74 loc) · 2.45 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Use bash shell in Make instead of sh
MAKEFLAGS += -j4
SHELL := /bin/bash
export PATH := /snap/bin:$(PATH)
ifeq ($(VERBOSE), 1)
VERBOSE="--verbose"
endif
# TARGETS
.PHONY: lint
lint: ## Run linter
tox -e lint
.PHONY: version
version: ## Create/update version file
@git describe --tags --dirty > version
.PHONY: readme
readme: ## create charms' README.md
@for charm in slurmd slurmdbd slurmctld slurmrestd; do \
cp README.md charm-$${charm}/README.md ;\
sed -i -e "s|Welcome to the Omnivector Slurm Distribution!|$${charm} charm|g" charm-$${charm}/README.md
done
.PHONY: clean
clean: ## Remove .tox, build dirs, and charms
rm -rf .tox/
rm -rf venv/
rm -rf node_modules/
find . -name "*.charm" -delete
rm -rf charm-slurm*/build
rm -rf charm-slurm*/version
rm -rf charm-slurm*/README.md
.PHONY: deepclean
deepclean: clean ## Cleanup charmcraft/lxd
@charmcraft clean --project-dir charm-slurmctld
@charmcraft clean --project-dir charm-slurmd
@charmcraft clean --project-dir charm-slurmdbd
@charmcraft clean --project-dir charm-slurmrestd
.PHONY: slurmd
slurmd: version ## Build slurmd
@cp version LICENSE icon.svg charm-slurmd/
@charmcraft pack --project-dir charm-slurmd ${VERBOSE}
@mv slurmd_*.charm slurmd.charm
.PHONY: slurmctld
slurmctld: version ## pack slurmctld
@cp version LICENSE icon.svg charm-slurmctld/
@charmcraft pack --project-dir charm-slurmctld ${VERBOSE}
@mv slurmctld_*.charm slurmctld.charm
.PHONY: slurmdbd
slurmdbd: version ## pack slurmdbd
@cp version LICENSE icon.svg charm-slurmdbd/
@charmcraft pack --project-dir charm-slurmdbd ${VERBOSE}
@mv slurmdbd_*.charm slurmdbd.charm
.PHONY: slurmrestd
slurmrestd: version ## pack slurmrestd
@cp version LICENSE icon.svg charm-slurmrestd/
@charmcraft pack --project-dir charm-slurmrestd ${VERBOSE}
@mv slurmrestd_*.charm slurmrestd.charm
.PHONY: charms
charms: readme slurmd slurmdbd slurmctld slurmrestd ## Build all charms
.PHONY: tests-centos
tests-centos: clean charms ## Run bats tests on centos
./run_tests centos
.PHONY: tests-focal
tests-focal: clean charms ## Run bats tests on ubuntu focal
./run_tests focal
.PHONY: tests
tests: tests-centos tests-focal ## Run bats tests
# Display target comments in 'make help'
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
# SETTINGS
# Use one shell for all commands in a target recipe
.ONESHELL:
# Set default goal
.DEFAULT_GOAL := help