3 # wiringPi device - Wiring Compatable library for the Raspberry Pi
5 # Copyright (c) 2012-2015 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 #################################################################################
24 VERSION=$(shell cat ../VERSION)
34 STATIC=libwiringPiDev.a
35 DYNAMIC=libwiringPiDev.so.$(VERSION)
42 CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
46 ###############################################################################
48 SRC = ds1302.c maxdetect.c piNes.c \
49 gertboard.c piFace.c \
55 HEADERS = ds1302.h gertboard.h lcd128x64.h lcd.h maxdetect.h piFace.h piGlow.h piNes.h
62 $Q echo "[Link (Static)]"
63 $Q ar rcs $(STATIC) $(OBJ)
68 $Q echo "[Link (Dynamic)]"
69 $Q $(CC) -shared -Wl,-soname,libwiringPiDev.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
73 $Q $(CC) -c $(CFLAGS) $< -o $@
78 $Q rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
88 $Q echo "[Install Headers]"
89 $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/include
90 $Q install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
91 $Q echo "[Install Dynamic Lib]"
92 $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
93 $Q install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
94 $Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so
97 .PHONY: install-static
98 install-static: $(STATIC)
99 $Q echo "[Install Headers]"
100 $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/include
101 $Q install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
102 $Q echo "[Install Static Lib]"
103 $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
104 $Q install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib
107 install-deb: $(DYNAMIC)
108 $Q echo "[Install Headers: deb]"
109 $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/include
110 $Q install -m 0644 $(HEADERS) ~/wiringPi/debian-template/wiringPi/usr/include
111 $Q echo "[Install Dynamic Lib: deb]"
112 install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/lib
113 install -m 0755 libwiringPiDev.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION)
114 ln -sf ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so
118 $Q echo "[UnInstall]"
119 $Q cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
120 $Q cd $(DESTDIR)$(PREFIX)/lib/ && rm -f libwiringPiDev.*
131 maxdetect.o: maxdetect.h
133 gertboard.o: gertboard.h
135 lcd128x64.o: font.h lcd128x64.h