chiark / gitweb /
Updating gpio manual page
[wiringPi.git] / wiringPi / Makefile
1 #
2 # Makefile:
3 #       wiringPi - Wiring Compatable library for the Raspberry Pi
4 #
5 #       Copyright (c) 2012 Gordon Henderson
6 #################################################################################
7 # This file is part of wiringPi:
8 #       https://projects.drogon.net/raspberry-pi/wiringpi/
9 #
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.
14 #
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.
19 #
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 #################################################################################
23
24 DYN_VERS_MAJ=1
25 DYN_VERS_MIN=0
26
27 STATIC=libwiringPi.a
28 DYNAMIC=libwiringPi.so.$(DYN_VERS_MAJ).$(DYN_VERS_MIN)
29
30 #DEBUG  = -g -O0
31 DEBUG   = -O2
32 CC      = gcc
33 INCLUDE = -I.
34 CFLAGS  = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe -fPIC
35
36 LIBS    =
37
38 # Should not alter anything below this line
39 ###############################################################################
40
41 SRC     =       wiringPi.c wiringPiFace.c wiringSerial.c wiringShift.c  \
42                 gertboard.c                                             \
43                 piNes.c                                                 \
44                 lcd.c piHiPri.c piThread.c softPwm.c wiringPiSPI.c
45
46 OBJ     =       wiringPi.o wiringPiFace.o wiringSerial.o wiringShift.o  \
47                 gertboard.o                                             \
48                 piNes.o                                                 \
49                 lcd.o piHiPri.o piThread.o softPwm.o wiringPiSPI.o
50
51 all:            $(STATIC) $(DYNAMIC)
52
53 $(STATIC):      $(OBJ)
54         @echo [STATIC]
55         @ar rcs $(STATIC) $(OBJ)
56         @ranlib $(STATIC)
57
58 #       @size   $(STATIC)
59
60 $(DYNAMIC):     $(OBJ)
61         @echo [DYNAMIC]
62         @gcc -shared -Wl,-soname,libwiringPi.so.1 -o libwiringPi.so.1.0 -lpthread $(OBJ)
63
64 .c.o:
65         @echo [CC] $<
66         @$(CC) -c $(CFLAGS) $< -o $@
67
68 clean:
69         rm -f $(OBJ) *~ core tags Makefile.bak libwiringPi.*
70
71 tags:   $(SRC)
72         @echo [ctags]
73         @ctags $(SRC)
74
75 depend:
76         makedepend -Y $(SRC)
77
78 install:        $(TARGET)
79         @echo [install]
80         @install -m 0755 -d /usr/local/lib
81         @install -m 0755 -d /usr/local/include
82         @install -m 0644 wiringPi.h     /usr/local/include
83         @install -m 0644 wiringSerial.h /usr/local/include
84         @install -m 0644 wiringShift.h  /usr/local/include
85         @install -m 0644 gertboard.h    /usr/local/include
86         @install -m 0644 piNes.h                /usr/local/include
87         @install -m 0644 softPwm.h      /usr/local/include
88         @install -m 0644 lcd.h          /usr/local/include
89         @install -m 0644 wiringPiSPI.h  /usr/local/include
90         @install -m 0644 libwiringPi.a  /usr/local/lib
91         @install        -m 0755 libwiringPi.so.1.0 /usr/local/lib
92         @ln -sf /usr/local/lib/libwiringPi.so.1.0 /usr/local/lib/libwiringPi.so
93         @ln -sf /usr/local/lib/libwiringPi.so.1.0 /usr/local/lib/libwiringPi.so.1
94         @ldconfig
95
96 uninstall:
97         @echo [uninstall]
98         @rm -f /usr/local/include/wiringPi.h
99         @rm -f /usr/local/include/wiringSerial.h
100         @rm -f /usr/local/include/wiringShift.h
101         @rm -f /usr/local/include/gertboard.h
102         @rm -f /usr/local/include/piNes.h
103         @rm -f /usr/local/include/softPwm.h
104         @rm -f /usr/local/include/lcd.h
105         @rm -f /usr/local/include/wiringPiSPI.h
106         @rm -f /usr/local/lib/libwiringPi.*
107         @ldconfig
108
109
110 # DO NOT DELETE
111
112 wiringPi.o: wiringPi.h
113 wiringPiFace.o: wiringPi.h
114 wiringSerial.o: wiringSerial.h
115 wiringShift.o: wiringPi.h wiringShift.h
116 gertboard.o: wiringPiSPI.h gertboard.h
117 piNes.o: wiringPi.h piNes.h
118 lcd.o: wiringPi.h lcd.h
119 piHiPri.o: wiringPi.h
120 piThread.o: wiringPi.h
121 softPwm.o: wiringPi.h softPwm.h
122 wiringPiSPI.o: wiringPiSPI.h