--- lua-5.4.6/src/Makefile 2023-10-02 23:00:53.701532908 +0200
|
+++ lua-5.4.6/src/Makefile.new 2023-10-02 23:00:47.672097994 +0200
|
@@ -25,6 +25,8 @@
|
MYLIBS=
|
MYOBJS=
|
|
+V=5.4
|
+
|
# Special flags for compiler modules; -Os reduces code size.
|
CMCFLAGS=
|
|
@@ -32,20 +34,20 @@
|
|
PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
|
|
-LUA_A= liblua.a
|
+LUA_SO= liblua$V.so
|
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
|
LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
|
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
|
|
-LUA_T= lua
|
+LUA_T= lua$V
|
LUA_O= lua.o
|
|
-LUAC_T= luac
|
+LUAC_T= luac$V
|
LUAC_O= luac.o
|
|
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
|
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
|
-ALL_A= $(LUA_A)
|
+ALL_T= $(LUA_SO) $(LUA_T) $(LUAC_T)
|
+ALL_A= $(LUA_SO)
|
|
# Targets start here.
|
default: $(PLAT)
|
@@ -56,15 +58,17 @@
|
|
a: $(ALL_A)
|
|
-$(LUA_A): $(BASE_O)
|
- $(AR) $@ $(BASE_O)
|
- $(RANLIB) $@
|
+$(LUA_SO): $(CORE_O) $(LIB_O)
|
+ $(CC) -o $(LUA_SO) -shared -h $(LUA_SO) $(CFLAGS) $(MYLDFLAGS) $(CORE_O) \
|
+ $(LIB_O) $(LIBS)
|
|
-$(LUA_T): $(LUA_O) $(LUA_A)
|
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
|
+$(LUA_T): $(LUA_O) $(LUA_SO)
|
+ $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_SO) $(LIBS)
|
|
$(LUAC_T): $(LUAC_O) $(LUA_A)
|
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
|
+$(LUAC_T): $(LUAC_O) $(LUA_SO)
|
+ $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_SO) $(LIBS)
|
|
test:
|
./$(LUA_T) -v
|
@@ -141,7 +145,7 @@
|
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX"
|
|
SunOS solaris:
|
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_REENTRANT" SYSLIBS="-ldl"
|
+ $(MAKE) all "USRCFLAGS=$(USRCFLAGS)" MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D__EXTENSIONS__ -D_REENTRANT -fPIC -DPIC" MYLIBS="-ldl"
|
|
# Targets that do not create files (not all makes understand .PHONY).
|
.PHONY: all $(PLATS) help test clean default o a depend echo
|