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)
28 STATIC=libwiringPiDev.a
29 DYNAMIC=libwiringPiDev.so.$(VERSION)
36 CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
40 ###############################################################################
42 SRC = ds1302.c maxdetect.c piNes.c \
43 gertboard.c piFace.c \
49 HEADERS = ds1302.h gertboard.h lcd128x64.h lcd.h maxdetect.h piFace.h piGlow.h piNes.h
56 @echo "[Link (Static)]"
57 @ar rcs $(STATIC) $(OBJ)
62 @echo "[Link (Dynamic)]"
63 @$(CC) -shared -Wl,-soname,libwiringPiDev.so -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
67 @$(CC) -c $(CFLAGS) $< -o $@
72 @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
82 @echo "[Install Headers]"
83 @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
84 @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
85 @echo "[Install Dynamic Lib]"
86 @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
87 @install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
88 @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so
91 .PHONY: install-static
92 install-static: $(STATIC)
93 @echo "[Install Headers]"
94 @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
95 @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
96 @echo "[Install Static Lib]"
97 @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
98 @install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib
101 install-deb: $(DYNAMIC)
102 @echo "[Install Headers: deb]"
103 @install -m 0755 -d ~/wiringPi/debian/wiringPi/usr/include
104 @install -m 0644 $(HEADERS) ~/wiringPi/debian/wiringPi/usr/include
105 @echo "[Install Dynamic Lib: deb]"
106 install -m 0755 -d ~/wiringPi/debian/wiringPi/usr/lib
107 install -m 0755 libwiringPiDev.so.$(VERSION) ~/wiringPi/debian/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION)
108 ln -sf ~/wiringPi/debian/wiringPi/usr/lib/libwiringPi.so.$(VERSION) ~/wiringPi/debian/wiringPi/usr/lib/libwiringPiDev.so
113 @cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
114 @cd $(DESTDIR)$(PREFIX)/lib/ && rm -f libwiringPiDev.*
125 maxdetect.o: maxdetect.h
127 gertboard.o: gertboard.h
129 lcd128x64.o: font.h lcd128x64.h