2 # wiringPi device - Wiring Compatable library for the Raspberry Pi
4 # Copyright (c) 2012-2013 Gordon Henderson
5 #################################################################################
6 # This file is part of wiringPi:
7 # https://projects.drogon.net/raspberry-pi/wiringpi/
9 # wiringPi is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU Lesser General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # wiringPi is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public License
20 # along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
21 #################################################################################
26 VERSION=$(DYN_VERS_MAJ).$(DYN_VERS_MIN)
30 STATIC=libwiringPiDev.a
31 DYNAMIC=libwiringPiDev.so.$(VERSION)
37 CFLAGS = $(DEBUG) -Wformat=2 -Wall $(INCLUDE) -Winline -pipe -fPIC
41 ###############################################################################
43 SRC = ds1302.c maxdetect.c piNes.c \
44 gertboard.c piFace.c \
54 @echo "[Link (Static)]"
55 @ar rcs $(STATIC) $(OBJ)
60 @echo "[Link (Dynamic)]"
61 @$(CC) -shared -Wl,-soname,libwiringPiDev.so -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
65 @$(CC) -c $(CFLAGS) $< -o $@
70 @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
78 .PHONEY: install-headers
80 @echo "[Install Headers]"
81 @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
82 @install -m 0644 ds1302.h $(DESTDIR)$(PREFIX)/include
83 @install -m 0644 maxdetect.h $(DESTDIR)$(PREFIX)/include
84 @install -m 0644 piNes.h $(DESTDIR)$(PREFIX)/include
85 @install -m 0644 gertboard.h $(DESTDIR)$(PREFIX)/include
86 @install -m 0644 piFace.h $(DESTDIR)$(PREFIX)/include
87 @install -m 0644 lcd128x64.h $(DESTDIR)$(PREFIX)/include
88 @install -m 0644 lcd.h $(DESTDIR)$(PREFIX)/include
91 install: $(DYNAMIC) install-headers
92 @echo "[Install Dynamic Lib]"
93 @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
94 @install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
95 @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so
98 .PHONEY: install-static
99 install-static: $(STATIC) install-headers
100 @echo "[Install Static Lib]"
101 @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
102 @install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib
107 @rm -f $(DESTDIR)$(PREFIX)/include/ds1302.h
108 @rm -f $(DESTDIR)$(PREFIX)/include/maxdetect.h
109 @rm -f $(DESTDIR)$(PREFIX)/include/piNes.h
110 @rm -f $(DESTDIR)$(PREFIX)/include/gertboard.h
111 @rm -f $(DESTDIR)$(PREFIX)/include/piFace.h
112 @rm -f $(DESTDIR)$(PREFIX)/include/lcd128x64.h
113 @rm -f $(DESTDIR)$(PREFIX)/include/lcd.h
114 @rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.*
125 maxdetect.o: maxdetect.h
127 gertboard.o: gertboard.h
129 lcd128x64.o: font.h lcd128x64.h