Skip to content

Commit 5f086d8

Browse files
YAGNI on Makefile magic
1 parent 6e339ea commit 5f086d8

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
version: 0.8.15
1717
- name: Check Formatting
18-
run: make format-check PYTHON_RUN="uv run --group=format"
18+
run: uv run --group=format --isolated make format-check
1919

2020
build-matrix:
2121
name: Build & Test (Linux)

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,8 @@ INSTALL_PREFIX :=
1414
# Treat compiler warnings as errors (Sets COMPILE_WARNING_AS_ERROR on amongoc)
1515
WARNINGS_AS_ERRORS := false
1616

17-
# *** Execution Parameters ***
18-
# Set the LAUNCHER parameter to prefix all executed commands
19-
LAUNCHER :=
20-
21-
# Update the shell to be executed by the launching command. Make will use
22-
# this to execute all commands in the Makefile:
23-
SHELL := $(LAUNCHER) $(SHELL)
24-
2517
.SILENT:
26-
.PHONY: docs-html docs-serve default build test format format-check packages
18+
.PHONY: default
2719

2820
# If given no other target, runs the build
2921
default: build
@@ -36,7 +28,7 @@ THIS_DIR := $(shell dirname $(THIS_FILE))
3628
# Directory where we will scribble build files
3729
BUILD_DIR ?= $(THIS_DIR)/_build/auto
3830

39-
PYTHON_RUN :=
31+
PYTHON_RUN := python
4032
# Run CMake within the uv environment
4133
CMAKE_RUN := cmake
4234

@@ -45,12 +37,15 @@ SPHINX_ARGS := --jobs="$(SPHINX_JOBS)" --write-all --show-traceback --builder=di
4537

4638
DOCS_SRC := $(THIS_DIR)/docs
4739
DOCS_OUT := $(BUILD_DIR)/docs/dev/html
40+
.PHONY: docs-html docs-serve
4841
docs-html:
4942
sphinx-build $(SPHINX_ARGS) $(DOCS_SRC) $(DOCS_OUT)
5043

5144
docs-serve:
5245
sphinx-autobuild $(SPHINX_ARGS) $(DOCS_SRC) $(DOCS_OUT)
5346

47+
CMAKE_CONFIGURE_ARGS :=
48+
.PHONY: configure build build-fast
5449
configure:
5550
$(CMAKE_RUN) \
5651
-S "$(THIS_DIR)" \
@@ -62,6 +57,7 @@ configure:
6257
-D BUILD_TESTING=$(BUILD_TESTING) \
6358
-D MONGO_SANITIZE="$(SANITIZE)" \
6459
-D CMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) \
60+
$(CMAKE_CONFIGURE_ARGS) \
6561
-G "Ninja Multi-Config"
6662

6763
build: configure
@@ -70,6 +66,7 @@ build: configure
7066
build-fast:
7167
$(CMAKE_RUN) --build "$(BUILD_DIR)"
7268

69+
.PHONY: test test-fast ctest-run
7370
test: build
7471
$(MAKE) test-fast
7572

@@ -86,6 +83,7 @@ ctest-run:
8683
|| :
8784
uv tool run --isolated junit2html "$(JUNIT_OUTPUT)" "$(JUNIT_OUTPUT).html"
8885

86+
.PHONY: install install-fast package
8987
install: build
9088
$(MAKE) install-fast
9189

@@ -104,11 +102,13 @@ package-fast:
104102
cpack -B "$(CPACK_OUT)" -C "$(PACKAGE_CONFIGS)" -G "$(PACKAGE_FORMATS)"
105103
rm -r -- "$(CPACK_OUT)/_CPack_Packages"
106104

105+
.PHONY: format format-check
107106
format-check:
108-
uv run --group=format --isolated $(PYTHON_RUN) tools/format.py --mode=check
107+
$(PYTHON_RUN) tools/format.py --mode=check
109108

110109
format:
111-
uv run --group=format --isolated $(PYTHON_RUN) tools/format.py
110+
$(PYTHON_RUN) tools/format.py
112111

112+
.PHONY: packages
113113
packages:
114114
bash $(THIS_DIR)/tools/earthly.sh -a +build-multi/ _build/pkgs

0 commit comments

Comments
 (0)