From f5f01c663816235bed38b3056771c6898744f567 Mon Sep 17 00:00:00 2001 From: cos Date: Sat, 15 Feb 2025 09:32:39 +0100 Subject: Add support for OpenBSD+FreeBSD platforms --- src/Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 6425a4a..7d96cc7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -17,6 +17,9 @@ endif ifeq ($(UNAME_S),FreeBSD) PLAT=freebsd endif +ifeq ($(UNAME_S),OpenBSD) + PLAT=openbsd +endif ifeq ($(patsubst MINGW%,MINGW,$(UNAME_S)),MINGW) PLAT=mingw endif @@ -64,6 +67,13 @@ LUAPREFIX_freebsd?=/usr/local/ CDIR_freebsd?=lib/lua/$(LUA_VERSION) LDIR_freebsd?=share/lua/$(LUA_VERSION) +# LUAINC_openbsd: +LUAINC_openbsd_base?=/usr/local/include +LUAINC_openbsd?=$(LUAINC_openbsd_base)/lua-$(LUA_VERSION) +LUAPREFIX_openbsd?=/usr/local/ +CDIR_openbsd?=lib/lua/$(LUA_VERSION) +LDIR_openbsd?=share/lua/$(LUA_VERSION) + # where lua headers are found for mingw builds # LUAINC_mingw: # /opt/local/include @@ -160,6 +170,18 @@ CFLAGS_freebsd= -I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \ LDFLAGS_freebsd=-O -shared -fpic -o LD_freebsd=gcc +#------ +# Compiler and linker settings +# for FreeBSD +SO_openbsd=so +O_openbsd=o +CC_openbsd=clang +DEF_openbsd= +CFLAGS_openbsd= -I$(LUAINC) $(DEF) -Wall -Wshadow -Wextra \ + -Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden +LDFLAGS_openbsd=-O -shared -fpic -o +LD_openbsd=clang + #------ # Compiler and linker settings # for MingW @@ -227,6 +249,9 @@ default: $(PLAT) freebsd: $(MAKE) all PLAT=freebsd +openbsd: + $(MAKE) all PLAT=openbsd + macosx: $(MAKE) all PLAT=macosx -- cgit v1.2.3-55-g6feb