-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
66 lines (48 loc) · 1.73 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
# setup (use XXX=<value> make <target> to override)
.PHONY: help build build_repro build_debug build_wrapper clean
help:
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
build: ## build repro and debug mode versions FV3 locally (assuming all tools and dependencies are available in the environment)
$(MAKE) build_repro
$(MAKE) clean_fortran_build_artifacts
$(MAKE) build_debug
build_repro: ## build repro mode version of FV3 locally (assuming all tools and dependencies are available in the environment)
$(MAKE) -j 8 -C FV3
mkdir -p bin
cp FV3/fv3.exe bin/fv3.repro.exe
build_debug: ## build debug mode version of FV3 locally in debug mode
# Note DEBUG and REPRO cannot be set to Y simultaneously; CALLPYFORT can
# also not currently be set in debug mode without failures (see GitHub issue
# #365).
CALLPYFORT= DEBUG=Y REPRO= $(MAKE) -j 8 -C FV3
mkdir -p bin
cp FV3/fv3.exe bin/fv3.debug.exe
build_wrapper:
$(MAKE) -j 8 -C FV3 wrapper_build
test_fortran:
pytest tests/pytest -v
test_fortran_basic:
pytest tests/pytest -v -m 'basic'
test_fortran_coarse_graining:
pytest tests/pytest -v -m 'coarse'
test_fortran_emulation:
pytest tests/pytest -v -m 'emulation'
test_fortran_unmarked:
pytest tests/pytest -v -m 'not basic and not coarse and not emulation'
test_wrapper:
$(MAKE) -C FV3/wrapper/ test
docs_wrapper:
$(MAKE) -C FV3/wrapper/ docs
lint:
pre-commit run flake8 --all-files
reformat:
pre-commit run --all-files
clean_fortran_build_artifacts:
$(MAKE) -C FV3 clean
clean_executables:
$(RM) -rf bin
clean: ## cleanup source tree and executables
$(MAKE) clean_fortran_build_artifacts
$(MAKE) clean_executables
setup-hooks:
pre-commit install