Created
December 4, 2020 11:28
-
-
Save dawidd6/fbec1d0179f8b8f7d026ed48c2f177a6 to your computer and use it in GitHub Desktop.
Homebrew on Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Makefile b/Makefile | |
index 36447a0..5f93891 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -52,7 +52,7 @@ R= $V.2 | |
all: $(PLAT) | |
$(PLATS) help test clean: | |
- @cd src && $(MAKE) $@ | |
+ @cd src && $(MAKE) $@ V=$(V) R=$(R) | |
install: dummy | |
cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) | |
diff --git a/src/Makefile b/src/Makefile | |
index a99735a..9415e09 100644 | |
--- a/src/Makefile | |
+++ b/src/Makefile | |
@@ -33,6 +33,7 @@ CMCFLAGS= | |
PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris | |
LUA_A= liblua.a | |
+LUA_SO= liblua.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) | |
@@ -44,7 +45,7 @@ LUAC_T= luac | |
LUAC_O= luac.o | |
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) | |
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) | |
+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) | |
ALL_A= $(LUA_A) | |
# Targets start here. | |
@@ -60,6 +61,12 @@ $(LUA_A): $(BASE_O) | |
$(AR) $@ $(BASE_O) | |
$(RANLIB) $@ | |
+$(LUA_SO): $(CORE_O) $(LIB_O) | |
+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) | |
+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) | |
+ ln -sf $(LUA_SO).$(R) $(LUA_SO) | |
+ | |
+ | |
$(LUA_T): $(LUA_O) $(LUA_A) | |
$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment