chiark / gitweb /
150c825f6ac7ed46cdcb95fb4ecd908254066968
[wiringPi.git] / examples / q2w / Makefile
1 #
2 # Makefile:
3 #       wiringPi - Wiring Compatable library for the Raspberry Pi
4 #       https://projects.drogon.net/wiring-pi
5 #
6 #       Copyright (c) 2012-2013 Gordon Henderson
7 #################################################################################
8 # This file is part of wiringPi:
9 #       Wiring Compatable library for the Raspberry Pi
10 #
11 #    wiringPi is free software: you can redistribute it and/or modify
12 #    it under the terms of the GNU Lesser General Public License as published by
13 #    the Free Software Foundation, either version 3 of the License, or
14 #    (at your option) any later version.
15 #
16 #    wiringPi is distributed in the hope that it will be useful,
17 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
18 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 #    GNU Lesser General Public License for more details.
20 #
21 #    You should have received a copy of the GNU Lesser General Public License
22 #    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
23 #################################################################################
24
25
26 #DEBUG  = -g -O0
27 DEBUG   = -O3
28 CC      = gcc
29 INCLUDE = -I/usr/local/include
30 CFLAGS  = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
31
32 LDFLAGS = -L/usr/local/lib
33 LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm
34
35 ###############################################################################
36
37 SRC     =       blink.c button.c blink-io.c volts.c bright.c
38
39 OBJ     =       $(SRC:.c=.o)
40
41 BINS    =       $(SRC:.c=)
42
43 all:    $(BINS)
44
45 blink:  blink.o
46         @echo [link]
47         @$(CC) -o $@ blink.o $(LDFLAGS) $(LDLIBS)
48
49 blink-io:       blink-io.o
50         @echo [link]
51         @$(CC) -o $@ blink-io.o $(LDFLAGS) $(LDLIBS)
52
53 button: button.o
54         @echo [link]
55         @$(CC) -o $@ button.o $(LDFLAGS) $(LDLIBS)
56
57 volts:  volts.o
58         @echo [link]
59         @$(CC) -o $@ volts.o $(LDFLAGS) $(LDLIBS)
60
61 bright: bright.o
62         @echo [link]
63         @$(CC) -o $@ bright.o $(LDFLAGS) $(LDLIBS)
64
65
66 .c.o:
67         @echo [CC] $<
68         @$(CC) -c $(CFLAGS) $< -o $@
69
70 clean:
71         @echo "[Clean]"
72         @rm -f $(OBJ) *~ core tags $(BINS)
73
74 tags:   $(SRC)
75         @echo [ctags]
76         @ctags $(SRC)
77
78 depend:
79         makedepend -Y $(SRC)
80
81 # DO NOT DELETE