-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-Makefiles.patch
128 lines (113 loc) · 4.17 KB
/
0001-Makefiles.patch
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
From ff57f26d13dd5bbd7c6b9b562fb16e07991d4ca0 Mon Sep 17 00:00:00 2001
Message-Id: <ff57f26d13dd5bbd7c6b9b562fb16e07991d4ca0.1526287488.git.devel@agrez.net>
From: Vaughan Agrez <[email protected]>
Date: Mon, 14 May 2018 16:44:42 +0800
Subject: [PATCH] Update Makefiles for Fedora
---
devLib/Makefile | 15 ++++++++++++++-
gpio/Makefile | 10 +++++++++-
wiringPi/Makefile | 13 +++++++++++++
3 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/devLib/Makefile b/devLib/Makefile
index cf665d6..d605c53 100644
--- a/devLib/Makefile
+++ b/devLib/Makefile
@@ -24,6 +24,8 @@
VERSION=$(shell cat ../VERSION)
DESTDIR?=/usr
PREFIX?=/local
+LIBDIR?=/usr/lib
+WIRINGPI_SONAME_SUFFIX=.$(shell printf "%.0f" "$(VERSION)")
LDCONFIG?=ldconfig
@@ -37,7 +39,7 @@ DYNAMIC=libwiringPiDev.so.$(VERSION)
#DEBUG = -g -O0
DEBUG = -O2
CC = gcc
-INCLUDE = -I.
+INCLUDE = -I. -I../wiringPi/
DEFS = -D_GNU_SOURCE
CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
@@ -73,6 +75,7 @@ $(DYNAMIC): $(OBJ)
.c.o:
$Q echo [Compile] $<
$Q $(CC) -c $(CFLAGS) $< -o $@
+ @ln -sf libwiringPiDev.so.$(VERSION) libwiringPiDev.so
.PHONY: clean
clean:
@@ -115,6 +118,16 @@ install-deb: $(DYNAMIC)
install -m 0755 libwiringPiDev.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION)
ln -sf ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so
+.PHONY: install-fedora
+install-fedora: $(DYNAMIC)
+ @echo "[Install Headers]"
+ @install -m 0755 -d $(DESTDIR)$(PREFIX)/include/wiringPi
+ @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include/wiringPi
+ @echo "[Install Dynamic Lib]"
+ @install -m 0755 -d $(DESTDIR)$(LIBDIR)
+ @install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(LIBDIR)/libwiringPiDev.so.$(VERSION)
+ @ln -sf $(LIBDIR)/libwiringPiDev.so.$(VERSION) $(DESTDIR)$(LIBDIR)/libwiringPiDev.so$(WIRINGPI_SONAME_SUFFIX)
+
.PHONY: uninstall
uninstall:
$Q echo "[UnInstall]"
diff --git a/gpio/Makefile b/gpio/Makefile
index 9ec160d..1592b27 100644
--- a/gpio/Makefile
+++ b/gpio/Makefile
@@ -33,7 +33,7 @@ endif
#DEBUG = -g -O0
DEBUG = -O2
CC = gcc
-INCLUDE = -I$(DESTDIR)$(PREFIX)/include
+INCLUDE = -I$(DESTDIR)$(PREFIX)/include -I../wiringPi -I../devLib
CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
@@ -80,6 +80,14 @@ endif
$Q mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
$Q cp gpio.1 $(DESTDIR)$(PREFIX)/share/man/man1
+.PHONY: install-fedora
+install-fedora: gpio
+ @echo "[Install]"
+ @install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
+ @install -m 0755 gpio $(DESTDIR)$(PREFIX)/bin
+ @mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
+ @install -m 0644 gpio.1 $(DESTDIR)$(PREFIX)/share/man/man1
+
.PHONY: install-deb
install-deb: gpio
$Q echo "[Install: deb]"
diff --git a/wiringPi/Makefile b/wiringPi/Makefile
index 287fa58..39532e4 100644
--- a/wiringPi/Makefile
+++ b/wiringPi/Makefile
@@ -24,6 +24,8 @@
VERSION=$(shell cat ../VERSION)
DESTDIR?=/usr
PREFIX?=/local
+LIBDIR?=/usr/lib
+WIRINGPI_SONAME_SUFFIX=.$(shell printf "%.0f" "$(VERSION)")
LDCONFIG?=ldconfig
@@ -80,6 +82,7 @@ $(DYNAMIC): $(OBJ)
.c.o:
$Q echo [Compile] $<
$Q $(CC) -c $(CFLAGS) $< -o $@
+ @ln -sf libwiringPi.so.$(VERSION) libwiringPi.so
.PHONY: clean
@@ -114,6 +117,16 @@ install-deb: $(DYNAMIC)
install -m 0755 libwiringPi.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPi.so.$(VERSION)
ln -sf ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPi.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPi.so
+.PHONY: install-fedora
+install-fedora: $(DYNAMIC)
+ @echo "[Install Headers]"
+ @install -m 0755 -d $(DESTDIR)$(PREFIX)/include/wiringPi
+ @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include/wiringPi
+ @echo "[Install Dynamic Lib]"
+ @install -m 0755 -d $(DESTDIR)$(LIBDIR)
+ @install -m 0755 libwiringPi.so.$(VERSION) $(DESTDIR)$(LIBDIR)/libwiringPi.so.$(VERSION)
+ @ln -sf $(LIBDIR)/libwiringPi.so.$(VERSION) $(DESTDIR)$(LIBDIR)/libwiringPi.so$(WIRINGPI_SONAME_SUFFIX)
+
.PHONY: uninstall
uninstall:
$Q echo "[UnInstall]"
--
2.14.3