Auto-detect platform in makefiles and test runner

Use uname -s to select Linux vs macOS build flags instead of
hardcoding. Add -undefined dynamic_lookup for test shared libs
on macOS. Set _port=true automatically on non-Linux in ./all.
This commit is contained in:
Cormac Shannon committed 2026-02-28 19:27:14 +00:00
1 parent 27f16b126d
commit 84b9aeb7e9
3 files changed
+21 -3

No files matched your search

+4
View File
@@ -6,6 +6,10 @@ CC = gcc
# compilation should generate Dynamic-Link Libraries
CFLAGS = -Wall -O2 -I$(LUA_DIR) -fPIC -shared
UNAME = $(shell uname -s)
ifeq ($(UNAME),Darwin)
CFLAGS += -undefined dynamic_lookup
endif
# libraries used by the tests
all: lib1.so lib11.so lib2.so lib21.so lib2-v2.so