File: Makefile

package info (click to toggle)
python-fluids 0.1.75-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 6,384 kB
  • sloc: python: 44,248; f90: 1,033; makefile: 47
file content (38 lines) | stat: -rw-r--r-- 813 bytes parent folder | download | duplicates (2)
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
PYTHON_FILES:= $(wildcard fluids/*.py)

COVERAGE:= coverage

path_to_pymodule = $(subst /,.,$(basename $(1)))

unittests: clean run html annotate

RUN_SUFFIX:= runfile
RUN_FILES:= $(addsuffix .$(RUN_SUFFIX),$(PYTHON_FILES))

run: $(RUN_FILES)

%.$(RUN_SUFFIX): %
	$(COVERAGE) run -m -a --include="fluids/*" $(call path_to_pymodule,$<)
	@touch $@

HTML_DIR:= html_report

html: $(HTML_DIR) run
	$(COVERAGE) html -d $<

ANNOTATED_DIR:= code_coverage
ANNOTATED_FILES:= $(foreach file,$(PYTHON_FILES),$(ANNOTATED_DIR)/$(file),cover)

annotate: $(ANNOTATED_FILES)

$(ANNOTATED_DIR)/%,cover: $(ANNOTATED_DIR) %
	$(COVERAGE) annotate -d $< $(word 2,$^)

clean:
	$(COVERAGE) erase
	rm -rf $(HTML_DIR)
	rm -rf $(ANNOTATED_DIR)
	rm -rf $$(find . -name "*.$(RUN_SUFFIX)" -type f)

$(ANNOTATED_DIR) $(HTML_DIR):
	mkdir -p $@