forked from bmw-software-engineering/lobster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
157 lines (129 loc) · 4.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
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
146
147
148
149
150
151
152
153
154
155
156
157
SYSTEM_PYTHONPATH:=$(PYTHONPATH)
export LOBSTER_ROOT=$(PWD)
export PYTHONPATH=$(LOBSTER_ROOT)
export PATH:=$(LOBSTER_ROOT):$(PATH)
ASSETS=$(wildcard assets/*.svg)
lobster/html/assets.py: $(ASSETS) util/mkassets.py
util/mkassets.py lobster/html/assets.py $(ASSETS)
lint: style
@PYTHONPATH=$(SYSTEM_PYTHONPATH) \
python3 -m pylint --rcfile=pylint3.cfg \
--reports=no \
--ignore=assets.py \
lobster
style:
@python3 -m pycodestyle lobster \
--exclude=assets.py
.PHONY: packages
packages:
git clean -xdf
make lobster/html/assets.py
make -C packages/lobster-core
make -C packages/lobster-tool-trlc
make -C packages/lobster-tool-codebeamer
make -C packages/lobster-tool-cpp
make -C packages/lobster-tool-cpptest
make -C packages/lobster-tool-gtest
make -C packages/lobster-tool-json
make -C packages/lobster-tool-python
make -C packages/lobster-metapackage
make -C packages/lobster-monolithic
PYTHONPATH= \
pip3 install --prefix test_install \
packages/*/dist/*.whl
PYTHONPATH= \
pip3 install --prefix test_install_monolithic \
packages/lobster-monolithic/meta_dist/*.whl
diff -Naur test_install/lib/python*/site-packages/lobster test_install_monolithic/lib/python*/site-packages/lobster -x "*.pyc"
diff -Naur test_install/bin test_install_monolithic/bin
clang-tidy:
cd .. && \
git clone https://github.com/bmw-software-engineering/llvm-project && \
cd llvm-project && \
cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra' -DCMAKE_BUILD_TYPE=Release && \
cmake --build build --target clang-tidy
integration-tests: packages
(cd tests-integration/projects/basic; make)
(cd tests-integration/projects/filter; make)
rm -f MODULE.bazel MODULE.bazel.lock
system-tests:
mkdir -p docs
make -B -C tests-system/lobster-json
make -B -C tests-system/lobster-python
unit-tests:
coverage run -p \
--branch --rcfile=coverage.cfg \
--data-file .coverage \
-m unittest discover -s tests-unit -v
upload-main: packages
python3 -m twine upload --repository pypi packages/*/dist/*
python3 -m twine upload --repository pypi packages/*/meta_dist/*
remove-dev:
python3 -m util.release
github-release:
git push
python3 -m util.github_release
bump:
python3 -m util.bump_version_post_release
full-release:
make remove-dev
git push
make github-release
make bump
git push
coverage:
coverage combine -q
coverage html --rcfile=coverage.cfg
coverage report --rcfile=coverage.cfg --fail-under=72
test: system-tests unit-tests
make coverage
util/check_local_modifications.sh
test-all: integration-tests system-tests unit-tests
make coverage
util/check_local_modifications.sh
TOOL_FOLDERS := $(shell find ./lobster/tools -mindepth 1 -maxdepth 2 -type d | grep -v -E '^./lobster/tools/core$$|__pycache__|parser' | sed 's|^./lobster/tools/||; s|/|-|g')
.PHONY: docs
docs:
rm -rf docs
@make lobster/html/assets.py
mkdir -p docs
@make clean-lobster
@for tool in $(TOOL_FOLDERS); do \
make tracing-tools-$$tool; \
done
@make clean-lobster
tracing-tools-%: tracing-% clean-lobster
@echo "Finished processing tool: $*"
tracing-%: report.lobster-%
$(eval TOOL_PATH := $(subst -,_,$*))
lobster-html-report report.lobster --out=docs/tracing-$(TOOL_PATH).html
lobster-ci-report report.lobster
report.lobster-%: lobster/tools/lobster.conf \
code.lobster-% \
unit-tests.lobster-% \
requirements.lobster-% \
system-tests.lobster-%
lobster-report \
--lobster-config=lobster/tools/lobster.conf \
--out=report.lobster
lobster-online-report report.lobster
requirements.lobster-%: lobster/tools/requirements.rsl
$(eval TOOL_PATH := $(subst -,/,$*))
lobster-trlc lobster/tools/$(TOOL_PATH)/requirements.trlc lobster/tools/requirements.rsl \
--config-file=lobster/tools/lobster-trlc.conf \
--out requirements.lobster
code.lobster-%:
$(eval TOOL_PATH := $(subst -,/,$*))
lobster-python --out code.lobster lobster/tools/$(TOOL_PATH)
unit-tests.lobster-%:
$(eval TOOL_PATH := $(subst -,/,$*))
lobster-python --activity --out unit-tests.lobster tests-unit/lobster-$(TOOL_PATH)
system-tests.lobster-%:
$(eval TOOL_PATH := $(subst -,/,$*))
python3 tests-system/lobster-trlc-system-test.py $(TOOL_PATH);
clean-lobster:
rm -f code.lobster
rm -f report.lobster
rm -f requirements.lobster
rm -f unit-tests.lobster
rm -f system-tests.lobster