Gordons Projects

--> Projects Top-Level GIT

6d87885cda18799acaad1f6c867fecdf5a76c3c6
[wiringPi] / examples / Makefile
1 #
2 # Makefile:
3 #       wiringPi - A "wiring" library for the Raspberry Pi
4 #       https://projects.drogon.net/wiring-pi
5 #
6 #       Copyright (c) 2012-2015 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 ifneq ($V,1)
26 Q ?= @
27 endif
28
29 #DEBUG  = -g -O0
30 DEBUG   = -O3
31 CC      = gcc
32 INCLUDE = -I/usr/local/include
33 CFLAGS  = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
34
35 LDFLAGS = -L/usr/local/lib
36 LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm -lcrypt -lrt
37
38 # Should not alter anything below this line
39 ###############################################################################
40
41 SRC     =       blink.c blink8.c blink12.c                                      \
42                 blink12drcs.c                                                   \
43                 pwm.c                                                           \
44                 speed.c wfi.c isr.c isr-osc.c                                   \
45                 lcd.c lcd-adafruit.c clock.c                                    \
46                 nes.c                                                           \
47                 softPwm.c softTone.c                                            \
48                 delayTest.c serialRead.c serialTest.c okLed.c ds1302.c          \
49                 lowPower.c                                                      \
50                 max31855.c                                                      \
51                 rht03.c
52
53 OBJ     =       $(SRC:.c=.o)
54
55 BINS    =       $(SRC:.c=)
56
57 all:    
58         $Q cat README.TXT
59         $Q echo "    $(BINS)" | fmt
60         $Q echo ""
61
62 really-all:     $(BINS)
63
64 blink:  blink.o
65         $Q echo [link]
66         $Q $(CC) -o $@ blink.o $(LDFLAGS) $(LDLIBS)
67
68 blink8: blink8.o
69         $Q echo [link]
70         $Q $(CC) -o $@ blink8.o $(LDFLAGS) $(LDLIBS)
71
72 blink12drcs:    blink12drcs.o
73         $Q echo [link]
74         $Q $(CC) -o $@ blink12drcs.o $(LDFLAGS) $(LDLIBS)
75
76 blink12:        blink12.o
77         $Q echo [link]
78         $Q $(CC) -o $@ blink12.o $(LDFLAGS) $(LDLIBS)
79
80 speed:  speed.o
81         $Q echo [link]
82         $Q $(CC) -o $@ speed.o $(LDFLAGS) $(LDLIBS)
83
84 lcd:    lcd.o
85         $Q echo [link]
86         $Q $(CC) -o $@ lcd.o $(LDFLAGS) $(LDLIBS)
87
88 lcd-adafruit:   lcd-adafruit.o
89         $Q echo [link]
90         $Q $(CC) -o $@ lcd-adafruit.o $(LDFLAGS) $(LDLIBS)
91
92 clock:  clock.o
93         $Q echo [link]
94         $Q $(CC) -o $@ clock.o $(LDFLAGS) $(LDLIBS)
95
96 wfi:    wfi.o
97         $Q echo [link]
98         $Q $(CC) -o $@ wfi.o $(LDFLAGS) $(LDLIBS)
99
100 isr:    isr.o
101         $Q echo [link]
102         $Q $(CC) -o $@ isr.o $(LDFLAGS) $(LDLIBS)
103
104 isr-osc:        isr-osc.o
105         $Q echo [link]
106         $Q $(CC) -o $@ isr-osc.o $(LDFLAGS) $(LDLIBS)
107
108 nes:    nes.o
109         $Q echo [link]
110         $Q $(CC) -o $@ nes.o $(LDFLAGS) $(LDLIBS) 
111
112 rht03:  rht03.o
113         $Q echo [link]
114         $Q $(CC) -o $@ rht03.o $(LDFLAGS) $(LDLIBS) 
115
116 pwm:    pwm.o
117         $Q echo [link]
118         $Q $(CC) -o $@ pwm.o $(LDFLAGS) $(LDLIBS)
119
120 softPwm:        softPwm.o
121         $Q echo [link]
122         $Q $(CC) -o $@ softPwm.o $(LDFLAGS) $(LDLIBS)
123
124 softTone:       softTone.o
125         $Q echo [link]
126         $Q $(CC) -o $@ softTone.o $(LDFLAGS) $(LDLIBS)
127
128 delayTest:      delayTest.o
129         $Q echo [link]
130         $Q $(CC) -o $@ delayTest.o $(LDFLAGS) $(LDLIBS)
131
132 serialRead:     serialRead.o
133         $Q echo [link]
134         $Q $(CC) -o $@ serialRead.o $(LDFLAGS) $(LDLIBS)
135
136 serialTest:     serialTest.o
137         $Q echo [link]
138         $Q $(CC) -o $@ serialTest.o $(LDFLAGS) $(LDLIBS)
139
140 okLed:  okLed.o
141         $Q echo [link]
142         $Q $(CC) -o $@ okLed.o $(LDFLAGS) $(LDLIBS)
143
144 tone:   tone.o
145         $Q echo [link]
146         $Q $(CC) -o $@ tone.o $(LDFLAGS) $(LDLIBS)
147
148 ds1302: ds1302.o
149         $Q echo [link]
150         $Q $(CC) -o $@ ds1302.o $(LDFLAGS) $(LDLIBS)
151
152 max31855:       max31855.o
153         $Q echo [link]
154         $Q $(CC) -o $@ max31855.o $(LDFLAGS) $(LDLIBS)
155
156 .c.o:
157         $Q echo [CC] $<
158         $Q $(CC) -c $(CFLAGS) $< -o $@
159
160 clean:
161         $Q echo "[Clean]"
162         $Q rm -f $(OBJ) *~ core tags $(BINS)
163
164 tags:   $(SRC)
165         $Q echo [ctags]
166         $Q ctags $(SRC)
167
168 depend:
169         makedepend -Y $(SRC)
170
171 # DO NOT DELETE