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)
32 STATIC=libwiringPiDev.a
33 DYNAMIC=libwiringPiDev.so.$(VERSION)
40 CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
44 ###############################################################################
46 SRC = ds1302.c maxdetect.c piNes.c \
47 gertboard.c piFace.c \
53 HEADERS = ds1302.h gertboard.h lcd128x64.h lcd.h maxdetect.h piFace.h piGlow.h piNes.h
60 @echo "[Link (Static)]"
61 @ar rcs $(STATIC) $(OBJ)
66 @echo "[Link (Dynamic)]"
67 @$(CC) -shared -Wl,-soname,libwiringPiDev.so -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
71 @$(CC) -c $(CFLAGS) $< -o $@
76 @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
86 @echo "[Install Headers]"
87 @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
88 @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
89 @echo "[Install Dynamic Lib]"
90 @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
91 @install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
92 @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so
95 .PHONY: install-static
96 install-static: $(STATIC)
97 @echo "[Install Headers]"
98 @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
99 @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
100 @echo "[Install Static Lib]"
101 @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
102 @install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib
105 install-deb: $(DYNAMIC)
106 @echo "[Install Headers: deb]"
107 @install -m 0755 -d ~/wiringPi/debian/wiringPi/usr/include
108 @install -m 0644 $(HEADERS) ~/wiringPi/debian/wiringPi/usr/include
109 @echo "[Install Dynamic Lib: deb]"
110 install -m 0755 -d ~/wiringPi/debian/wiringPi/usr/lib
111 install -m 0755 libwiringPiDev.so.$(VERSION) ~/wiringPi/debian/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION)
112 ln -sf ~/wiringPi/debian/wiringPi/usr/lib/libwiringPi.so.$(VERSION) ~/wiringPi/debian/wiringPi/usr/lib/libwiringPiDev.so
117 @cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
118 @cd $(DESTDIR)$(PREFIX)/lib/ && rm -f libwiringPiDev.*
129 maxdetect.o: maxdetect.h
131 gertboard.o: gertboard.h
133 lcd128x64.o: font.h lcd128x64.h