From d7f6adb5b524bc8f8f2d6534f2f978c91c6d69b0 Mon Sep 17 00:00:00 2001 From: anth64 Date: Sat, 31 Jan 2026 23:08:39 +0100 Subject: [PATCH] fix(build): resolve BSD make compatibility issues - Use absolute path ${.CURDIR}/test in main bmake.mk - Replace automatic variable $< with explicit source filenames in test/bmake.mk - Ensure proper directory navigation and source file compilation - Fixes "undefined symbol: main" linker error on BSD systems --- bmake.mk | 2 +- test/bmake.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bmake.mk b/bmake.mk index 837642a..aa2db69 100644 --- a/bmake.mk +++ b/bmake.mk @@ -50,4 +50,4 @@ clean: test: debug @echo "=== Building and running stk tests ===" - cd test && ${MAKE} -f bmake.mk + cd ${.CURDIR}/test && ${MAKE} -f bmake.mk diff --git a/test/bmake.mk b/test/bmake.mk index 1b46dc0..223d9b3 100644 --- a/test/bmake.mk +++ b/test/bmake.mk @@ -17,10 +17,10 @@ MODULE_EXT = .so all: test test_program: test.c - $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) + $(CC) $(CFLAGS) -o $@ test.c $(LDFLAGS) test_mod$(MODULE_EXT): test_mod.c - $(CC) $(CFLAGS) -fPIC -shared -o $@ $< + $(CC) $(CFLAGS) -fPIC -shared -o $@ test_mod.c setup: @mkdir -p mods