--- makefile.orig	2014-11-27 20:47:24 UTC
+++ makefile
@@ -7,14 +7,6 @@
 # Also works with ming32-make on Windows.
 
 .SUFFIXES: .cxx .c .o .h .a
-ifdef CLANG
-CXX = clang++ -Wno-deprecated-register
-CC = clang
-# Can choose aspect to sanitize: address and undefined can simply change SANITIZE but for
-# thread also need to create Position Independent Executable -> search online documentation
-SANITIZE = address
-#SANITIZE = undefined
-endif
 RANLIB = touch
 
 ifdef GTK3
@@ -36,7 +28,8 @@
 COMPLIB=..\bin\scintilla.a
 else
 DEL = rm -f
-COMPLIB=../bin/scintilla.a
+COMPLIB=../bin/libscintilla.so.2
+LEXRLIB=../bin/libscintilla_lexers.so.2
 endif
 
 vpath %.h ../src ../include ../lexlib
@@ -77,8 +70,7 @@
 CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS)
 endif
 
-CFLAGS:=$(CTFLAGS)
-CXXTFLAGS:=--std=gnu++0x $(CTFLAGS) $(REFLAGS)
+CXXTFLAGS:=$(CTFLAGS) $(REFLAGS)
 
 CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION))
 MARSHALLER=scintilla-marshal.o
@@ -77,11 +69,11 @@
 .cxx.o:
 	$(CXX) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $<
 .c.o:
-	$(CC) $(CONFIGFLAGS) $(CFLAGS) -w -c $<
+	$(CC) $(CONFIGFLAGS) $(CTFLAGS) $(CFLAGS) -w -c $<
 
 LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx))))
 
-all: $(COMPLIB)
+all: $(COMPLIB) $(LEXRLIB)
 
 clean:
 	$(DEL) *.o $(COMPLIB) *.plist
@@ -98,9 +90,11 @@
 	PropSetSimple.o PlatGTK.o \
 	KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o CellBuffer.o CharacterCategory.o ViewStyle.o \
 	RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \
-	$(MARSHALLER) $(LEXOBJS)
-	$(AR) rc $@ $^
-	$(RANLIB) $@
+	$(MARSHALLER)
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $^ -Wl,--as-needed $(CONFIGLIBS)
+
+$(LEXRLIB): $(LEXOBJS)
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ $^ -Wl,--as-needed $(CONFIGLIBS)
 
 # Automatically generate header dependencies with "make deps"
 include deps.mak