1
+ # *** Build Parameters ***
2
+ # Whether to use PMM for the build process
3
+ USE_PMM := TRUE
4
+ # Whether to build tests
5
+ BUILD_TESTING := TRUE
6
+ # Sanitizers to request (Comma-separated list)
7
+ SANITIZE :=
8
+ # The configurations to build (Semicolon-separated, or "all")
9
+ CONFIGS := Debug
10
+ # If running tests, the configuration to test
11
+ TEST_CONFIG := Debug
12
+ # Set the CMAKE_INSTALL_PREFIX and the `--prefix` arg for installs
13
+ INSTALL_PREFIX :=
14
+
15
+ # *** Execution Parameters ***
16
+ # Set the LAUNCHER parameter to prefix all executed commands
17
+ LAUNCHER :=
18
+
19
+ # Update the shell to be executed by the launching command. Make will use
20
+ # this to execute all commands in the Makefile:
21
+ SHELL := $(LAUNCHER ) $(SHELL )
22
+
1
23
.SILENT :
2
24
.PHONY : docs-html docs-serve default build test format format-check packages
3
25
@@ -12,45 +34,51 @@ THIS_DIR := $(shell dirname $(THIS_FILE))
12
34
# Directory where we will scribble build files
13
35
BUILD_DIR ?= $(THIS_DIR ) /_build/auto
14
36
15
- # uv commands used in this file
16
- UV_RUN := uv run
17
- DOCS_RUN := $(UV_RUN ) --isolated --group=docs
18
- FORMAT_RUN := $(UV_RUN ) --isolated --group=format
19
- # Build is not isolated, because CMake caches paths to certain files
20
- BUILD_RUN := $(UV_RUN ) --group=build
37
+ PYTHON_RUN :=
21
38
# Run CMake within the uv environment
22
- CMAKE_RUN := $( BUILD_RUN ) cmake
39
+ CMAKE_RUN := cmake
23
40
24
41
SPHINX_JOBS ?= auto
25
42
SPHINX_ARGS := -W -j "$(SPHINX_JOBS ) " -aT -b dirhtml
26
43
27
44
DOCS_SRC := $(THIS_DIR ) /docs
28
45
DOCS_OUT := $(BUILD_DIR ) /docs/dev/html
29
46
docs-html :
30
- $( DOCS_RUN ) sphinx-build $(SPHINX_ARGS ) $(DOCS_SRC ) $(DOCS_OUT )
47
+ sphinx-build $(SPHINX_ARGS ) $(DOCS_SRC ) $(DOCS_OUT )
31
48
32
49
docs-serve :
33
- $( DOCS_RUN ) sphinx-autobuild $(SPHINX_ARGS ) $(DOCS_SRC ) $(DOCS_OUT )
50
+ sphinx-autobuild $(SPHINX_ARGS ) $(DOCS_SRC ) $(DOCS_OUT )
34
51
35
- build :
52
+ configure :
36
53
$(CMAKE_RUN ) \
37
54
-S " $( THIS_DIR) " \
38
55
-B " $( BUILD_DIR) " \
39
- --fresh \
40
- -D CMAKE_CROSS_CONFIGS=" Debug" \
56
+ -D CMAKE_CROSS_CONFIGS=" $( CONFIGS) " \
41
57
-D CMAKE_DEFAULT_CONFIGS=all \
58
+ -D AMONGOC_USE_PMM=$(USE_PMM ) \
59
+ -D BUILD_TESTING=$(BUILD_TESTING ) \
60
+ -D MONGO_SANITIZE=" $( SANITIZE) " \
61
+ -D CMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX ) \
42
62
-G " Ninja Multi-Config"
63
+
64
+ build : configure
65
+ $(MAKE ) build-fast
66
+
67
+ build-fast :
43
68
$(CMAKE_RUN ) --build " $( BUILD_DIR) "
44
69
45
70
test : build
71
+ $(MAKE ) test-fast
72
+
73
+ test-fast :
46
74
$(CMAKE_RUN ) -E chdir " $( BUILD_DIR) " \
47
- ctest -C Debug -j4 --output-on-failure
75
+ ctest -C $( TEST_CONFIG ) -j4 --output-on-failure --progress -E CMake/ \| URI/spec/
48
76
49
77
format-check :
50
- $(UV_RUN ) --group format tools/format.py --mode=check
78
+ $(PYTHON_RUN ) tools/format.py --mode=check
51
79
52
80
format :
53
- $(UV_RUN ) --group format tools/format.py
81
+ $(PYTHON_RUN ) tools/format.py
54
82
55
83
packages :
56
84
bash $(THIS_DIR ) /tools/earthly.sh -a +build-multi/ _build/pkgs
0 commit comments