summaryrefslogtreecommitdiff
path: root/package/wiringPi/patches/patch-wiringPi_Makefile
blob: 4dac546121666db58c51ba8da31f489948cb0221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- wiringPi-72b2af231be337d45a557ce6ca3ed1eeb6675ffd.orig/wiringPi/Makefile	2015-02-11 09:58:24.000000000 +0100
+++ wiringPi-72b2af231be337d45a557ce6ca3ed1eeb6675ffd/wiringPi/Makefile	2015-02-11 13:29:16.820794439 +0100
@@ -22,18 +22,18 @@
 #################################################################################
 
 VERSION=$(shell cat ../VERSION)
-DESTDIR=/usr
-PREFIX=/local
+DESTDIR?=
+PREFIX=/usr
 
 STATIC=libwiringPi.a
 DYNAMIC=libwiringPi.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    =
 
@@ -83,11 +83,12 @@ $(STATIC):	$(OBJ)
 
 $(DYNAMIC):	$(OBJ)
 	@echo "[Link (Dynamic)]"
-	@$(CC) -shared -Wl,-soname,libwiringPi.so -o libwiringPi.so.$(VERSION) -lpthread $(OBJ)
+	$(CC) -shared -Wl,-soname,libwiringPi.so -o libwiringPi.so.$(VERSION) -lpthread $(OBJ)
+	ln -sf libwiringPi.so.$(VERSION) libwiringPi.so
 
 .c.o:
 	@echo [Compile] $<
-	@$(CC) -c $(CFLAGS) $< -o $@
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
 
 
 .PHONY:	clean
@@ -110,7 +111,7 @@ install:	$(DYNAMIC)
 	@install -m 0755 -d						$(DESTDIR)$(PREFIX)/lib
 	@install -m 0755 libwiringPi.so.$(VERSION)			$(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)
 	@ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)	$(DESTDIR)/lib/libwiringPi.so
-	@ldconfig
+	@ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)	$(DESTDIR)/lib/libwiringPi.so.2
 
 .PHONY:	install-static
 install-static:	$(STATIC)