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
2026-02-28 19:27:14 +00:00
parent 27f16b126d
commit 84b9aeb7e9
3 changed files with 21 additions and 3 deletions

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