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 wiringPiSPI.c \
49 softPwm.c softServo.c softTone.c
53 all: $(STATIC) $(DYNAMIC)
57 @echo "[Link (Static)]"
58 @ar rcs $(STATIC) $(OBJ)
63 @echo "[Link (Dynamic)]"
64 @$(CC) -shared -Wl,-soname,libwiringPi.so.1 -o libwiringPi.so.1.0 -lpthread $(OBJ)
68 @$(CC) -c $(CFLAGS) $< -o $@
72 rm -f $(OBJ) *~ core tags Makefile.bak libwiringPi.*
82 @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
83 @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
84 @install -m 0644 wiringPi.h $(DESTDIR)$(PREFIX)/include
85 @install -m 0644 wiringSerial.h $(DESTDIR)$(PREFIX)/include
86 @install -m 0644 wiringShift.h $(DESTDIR)$(PREFIX)/include
87 @install -m 0644 gertboard.h $(DESTDIR)$(PREFIX)/include
88 @install -m 0644 piNes.h $(DESTDIR)$(PREFIX)/include
89 @install -m 0644 softPwm.h $(DESTDIR)$(PREFIX)/include
90 @install -m 0644 softServo.h $(DESTDIR)$(PREFIX)/include
91 @install -m 0644 softTone.h $(DESTDIR)$(PREFIX)/include
92 @install -m 0644 lcd.h $(DESTDIR)$(PREFIX)/include
93 @install -m 0644 wiringPiSPI.h $(DESTDIR)$(PREFIX)/include
94 @install -m 0755 libwiringPi.a $(DESTDIR)$(PREFIX)/lib
95 @install -m 0755 libwiringPi.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib
96 @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so
97 @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so.1
103 @rm -f $(DESTDIR)$(PREFIX)/include/wiringPi.h
104 @rm -f $(DESTDIR)$(PREFIX)/include/wiringSerial.h
105 @rm -f $(DESTDIR)$(PREFIX)/include/wiringShift.h
106 @rm -f $(DESTDIR)$(PREFIX)/include/gertboard.h
107 @rm -f $(DESTDIR)$(PREFIX)/include/piNes.h
108 @rm -f $(DESTDIR)$(PREFIX)/include/softPwm.h
109 @rm -f $(DESTDIR)$(PREFIX)/include/softServo.h
110 @rm -f $(DESTDIR)$(PREFIX)/include/softTone.h
111 @rm -f $(DESTDIR)$(PREFIX)/include/lcd.h
112 @rm -f $(DESTDIR)$(PREFIX)/include/wiringPiSPI.h
113 @rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPi.*
123 wiringPi.o: wiringPi.h
124 wiringPiFace.o: wiringPi.h
125 wiringSerial.o: wiringSerial.h
126 wiringShift.o: wiringPi.h wiringShift.h
127 gertboard.o: wiringPiSPI.h gertboard.h
128 piNes.o: wiringPi.h piNes.h
129 lcd.o: wiringPi.h lcd.h
130 piHiPri.o: wiringPi.h
131 piThread.o: wiringPi.h
132 softPwm.o: wiringPi.h softPwm.h
133 wiringPiSPI.o: wiringPiSPI.h