This repository was archived by the owner on Feb 18, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949# Default target
5050all : $(BUILD_DIR ) /$(EXTENSION )
5151
52+ # Check if test binary is instrumented (ASan/UBSan)
53+ # Returns 0 if instrumented, 1 if clean
54+ .PHONY : check-instrumented
55+ check-instrumented :
56+ @if [ -f " $( BUILD_DIR) /$( TEST_BIN) " ]; then \
57+ if nm " $( BUILD_DIR) /$( TEST_BIN) " 2> /dev/null | grep -q ' __asan\|__ubsan\|__tsan' ; then \
58+ exit 0; \
59+ else \
60+ exit 1; \
61+ fi ; \
62+ else \
63+ exit 1; \
64+ fi
65+
66+ # Release build (ensures clean, non-instrumented build)
67+ # Only cleans if instrumented build detected - preserves incremental builds
68+ release :
69+ @if $(MAKE ) -s check-instrumented 2> /dev/null; then \
70+ echo " Instrumented build detected - cleaning..." ; \
71+ $(MAKE ) clean; \
72+ fi
73+ @$(MAKE ) EXTRA_CFLAGS=" " all
74+
5275# Build extension (without sqlite3.o - symbols resolved from host at runtime)
5376$(BUILD_DIR ) /$(EXTENSION ) : $(SOURCES ) | $(BUILD_DIR )
5477 $(CC ) $(CFLAGS ) -DDISKANN_EXTENSION $(LDFLAGS ) -o $@ $^ $(LIBS )
@@ -139,6 +162,7 @@ valgrind: $(BUILD_DIR)/$(TEST_BIN)
139162help :
140163 @echo " sqlite-diskann build targets:"
141164 @echo " all Build extension (default)"
165+ @echo " release Ensure clean build (auto-detects and cleans ASan/UBSan builds)"
142166 @echo " test Build and run native C tests (alias for test-native)"
143167 @echo " test-native Build and run native C tests only"
144168 @echo " test-all Build and run both native C and TypeScript tests"
You can’t perform that action at this time.
0 commit comments