3 # wiringPi - Wiring Compatable library for the Raspberry Pi
5 # Copyright (c) 2012 Gordon Henderson
6 #################################################################################
7 # This file is part of wiringPi:
8 # https://projects.drogon.net/raspberry-pi/wiringpi/
10 # wiringPi is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU Lesser General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
15 # wiringPi is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License for more details.
20 # You should have received a copy of the GNU Lesser General Public License
21 # along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
22 #################################################################################
27 VERSION=$(DYN_VERS_MAJ).$(DYN_VERS_MIN)
32 DYNAMIC=libwiringPi.so.$(VERSION)
38 CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe -fPIC
42 # Should not alter anything below this line
43 ###############################################################################
45 SRC = wiringPi.c wiringPiFace.c wiringSerial.c wiringShift.c \
48 lcd.c piHiPri.c piThread.c \
49 wiringPiSPI.c wiringPiI2C.c \
50 softPwm.c softServo.c softTone.c
59 @echo "[Link (Static)]"
60 @ar rcs $(STATIC) $(OBJ)
65 @echo "[Link (Dynamic)]"
66 @$(CC) -shared -Wl,-soname,libwiringPi.so.1 -o libwiringPi.so.1.0 -lpthread $(OBJ)
70 @$(CC) -c $(CFLAGS) $< -o $@
74 rm -f $(OBJ) *~ core tags Makefile.bak libwiringPi.*
84 @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
85 @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
86 @install -m 0644 wiringPi.h $(DESTDIR)$(PREFIX)/include
87 @install -m 0644 wiringSerial.h $(DESTDIR)$(PREFIX)/include
88 @install -m 0644 wiringShift.h $(DESTDIR)$(PREFIX)/include
89 @install -m 0644 gertboard.h $(DESTDIR)$(PREFIX)/include
90 @install -m 0644 piNes.h $(DESTDIR)$(PREFIX)/include
91 @install -m 0644 softPwm.h $(DESTDIR)$(PREFIX)/include
92 @install -m 0644 softServo.h $(DESTDIR)$(PREFIX)/include
93 @install -m 0644 softTone.h $(DESTDIR)$(PREFIX)/include
94 @install -m 0644 lcd.h $(DESTDIR)$(PREFIX)/include
95 @install -m 0644 wiringPiSPI.h $(DESTDIR)$(PREFIX)/include
96 @install -m 0644 wiringPiI2C.h $(DESTDIR)$(PREFIX)/include
97 @install -m 0755 libwiringPi.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib
98 @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so
99 @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so.1
102 .PHONEY: install-static
103 install-static: $(STATIC)
104 @echo "[Install Static]"
105 @install -m 0755 libwiringPi.a $(DESTDIR)$(PREFIX)/lib
110 @rm -f $(DESTDIR)$(PREFIX)/include/wiringPi.h
111 @rm -f $(DESTDIR)$(PREFIX)/include/wiringSerial.h
112 @rm -f $(DESTDIR)$(PREFIX)/include/wiringShift.h
113 @rm -f $(DESTDIR)$(PREFIX)/include/gertboard.h
114 @rm -f $(DESTDIR)$(PREFIX)/include/piNes.h
115 @rm -f $(DESTDIR)$(PREFIX)/include/softPwm.h
116 @rm -f $(DESTDIR)$(PREFIX)/include/softServo.h
117 @rm -f $(DESTDIR)$(PREFIX)/include/softTone.h
118 @rm -f $(DESTDIR)$(PREFIX)/include/lcd.h
119 @rm -f $(DESTDIR)$(PREFIX)/include/wiringPiSPI.h
120 @rm -f $(DESTDIR)$(PREFIX)/include/wiringPiI2C.h
121 @rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPi.*
131 wiringPi.o: wiringPi.h
132 wiringPiFace.o: wiringPi.h
133 wiringSerial.o: wiringSerial.h
134 wiringShift.o: wiringPi.h wiringShift.h
135 gertboard.o: wiringPiSPI.h gertboard.h
136 piNes.o: wiringPi.h piNes.h
137 lcd.o: wiringPi.h lcd.h
138 piHiPri.o: wiringPi.h
139 piThread.o: wiringPi.h
140 softPwm.o: wiringPi.h softPwm.h
141 wiringPiSPI.o: wiringPiSPI.h