summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-21 08:22:29 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-21 08:22:29 +0200
commitf290736c33a6df85cd83eaed18e80530681955b9 (patch)
treee3690041c6fbeffa807f5d2a8e57abadac836c0e /Makefile
parent19e4d8dcc9c9e76a8c90855cccb4c4553b35389e (diff)
downloadbokf-f290736c33a6df85cd83eaed18e80530681955b9.tar.gz
bokf-f290736c33a6df85cd83eaed18e80530681955b9.zip
build: run gate in its own build directory
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 14 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index eac1bd7..8d9364e 100644
--- a/Makefile
+++ b/Makefile
@@ -110,18 +110,25 @@ test-pty: all
python3 scripts/tui-golden.py
SAN_CFLAGS = -O1 -g -fno-omit-frame-pointer
+ASAN_BUILD ?= build-asan
+UBSAN_BUILD ?= build-ubsan
test-asan:
- $(MAKE) BUILD=build-asan CFLAGS="$(SAN_CFLAGS) -fsanitize=address" test-core
+ $(MAKE) BUILD=$(ASAN_BUILD) CFLAGS="$(SAN_CFLAGS) -fsanitize=address" test-core
test-ubsan:
- $(MAKE) BUILD=build-ubsan CFLAGS="$(SAN_CFLAGS) -fsanitize=undefined" test-core
+ $(MAKE) BUILD=$(UBSAN_BUILD) CFLAGS="$(SAN_CFLAGS) -fsanitize=undefined" test-core
+GATE_BUILD ?= build-gate
+
+# A pre-stop check in its own build directory: never touches build/, so the
+# human's clients are still there when it is done.
gate:
- $(MAKE) clean
- $(MAKE) WERROR=1 all
- $(MAKE) WERROR=1 test
- $(MAKE) WERROR=1 test-asan
+ $(MAKE) BUILD=$(GATE_BUILD) ASAN_BUILD=$(GATE_BUILD)-asan \
+ UBSAN_BUILD=$(GATE_BUILD)-ubsan clean
+ $(MAKE) BUILD=$(GATE_BUILD) WERROR=1 all
+ $(MAKE) BUILD=$(GATE_BUILD) WERROR=1 test
+ $(MAKE) BUILD=$(GATE_BUILD) ASAN_BUILD=$(GATE_BUILD)-asan test-asan
$(BUILD)/vendor/%.o: vendor/%.c
@mkdir -p $(dir $@)
@@ -157,7 +164,7 @@ install: all
install -m 0644 data/bas_k2.csv data/bas_k3.csv $(DESTDIR)/usr/local/share/bokf/
clean:
- rm -rf $(BUILD) build-asan build-ubsan
+ rm -rf $(BUILD) $(ASAN_BUILD) $(UBSAN_BUILD)
.PHONY: all backend test test-core test-pty check gen-protocol test-asan test-ubsan gate \
install clean