--- wiringPi-72b2af231be337d45a557ce6ca3ed1eeb6675ffd.orig/devLib/Makefile	2015-02-11 09:58:24.000000000 +0100
+++ wiringPi-72b2af231be337d45a557ce6ca3ed1eeb6675ffd/devLib/Makefile	2015-02-11 14:55:25.328819419 +0100
@@ -22,18 +22,18 @@
 #################################################################################
 
 VERSION=$(shell cat ../VERSION)
-DESTDIR=/usr
-PREFIX=/local
+DESTDIR?=
+PREFIX=
 
 STATIC=libwiringPiDev.a
 DYNAMIC=libwiringPiDev.so.$(VERSION)
 
 #DEBUG	= -g -O0
 DEBUG	= -O2
-CC	= gcc
+CC	?= gcc
 INCLUDE	= -I.
 DEFS	= -D_GNU_SOURCE
-CFLAGS	= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
+CFLAGS	?= $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -fPIC
 
 LIBS    =
 
@@ -60,11 +60,12 @@ $(STATIC):	$(OBJ)
 
 $(DYNAMIC):	$(OBJ)
 	@echo "[Link (Dynamic)]"
-	@$(CC) -shared -Wl,-soname,libwiringPiDev.so -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
+	$(CC) -shared -Wl,-soname,libwiringPiDev.so -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
+	ln -sf libwiringPiDev.so.$(VERSION) libwiringPiDev.so
 
 .c.o:
 	@echo [Compile] $<
-	@$(CC) -c $(CFLAGS) $< -o $@
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
 
 .PHONY:	clean
 clean:
@@ -86,7 +87,7 @@ install:	$(DYNAMIC)
 	@install -m 0755 -d						$(DESTDIR)$(PREFIX)/lib
 	@install -m 0755 libwiringPiDev.so.$(VERSION)			$(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
 	@ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)	$(DESTDIR)/lib/libwiringPiDev.so
-	@ldconfig
+	@ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)	$(DESTDIR)/lib/libwiringPiDev.so.2
 
 .PHONY:	install-static
 install-static:	$(STATIC)
