--- src/Makefile.orig	2011-09-19 16:45:14.000000000 +0400
+++ src/Makefile	2011-12-17 05:00:09.717344014 +0400
@@ -42,8 +42,10 @@
 LUAC_T=	luac
 LUAC_O=	luac.o
 
+LUA_SO=	liblua.so.%%BRANCH%%
+
 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.
@@ -65,6 +67,9 @@
 $(LUAC_T): $(LUAC_O) $(LUA_A)
 	$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
 
+$(LUA_SO): $(CORE_O) $(LIB_O)
+	$(CC) -o $@ -shared $(LDFLAGS) $(CORE_O) $(LIB_O) -lm -ldl
+
 clean:
 	$(RM) $(ALL_T) $(ALL_O)
 
