--- src/Makefile.orig	2013-06-18 16:49:36.000000000 +0400
+++ src/Makefile	2013-10-09 12:59:45.000000000 +0400
@@ -1,9 +1,8 @@
-LIBRARIES = libb64.a
+LIBRARIES = libb64.so
 
 # Build flags (uncomment one)
 #############################
 # Release build flags
-CFLAGS += -O3
 #############################
 # Debug build flags
 #CFLAGS += -g
@@ -15,8 +14,7 @@
 
 LINK.o = gcc
 
-CFLAGS += -Werror -pedantic
-CFLAGS += -I../include
+CFLAGS += -I../include -fPIC -shared
 
 vpath %.h ../include/b64
 
@@ -24,8 +22,8 @@
 
 all: $(TARGETS) #strip
 
-libb64.a: cencode.o cdecode.o
-	$(AR) $(ARFLAGS) $@ $^
+libb64.so: cencode.o cdecode.o
+	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname,libb64.so.1 $^ -o $@
 
 strip:
 	strip $(BINARIES) *.exe