chiark / gitweb /
Quite a few changes here.
[wiringPi.git] / examples / 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 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 -lpthread -lm
34
35 # Should not alter anything below this line
36 ###############################################################################
37
38 SRC     =       blink.c test1.c test2.c speed.c lcd.c wfi.c isr.c isr-osc.c     \
39                 piface.c gertboard.c nes.c                                      \
40                 pwm.c tone.c servo.c                                            \
41                 delayTest.c serialRead.c serialTest.c okLed.c
42
43 OBJ     =       $(SRC:.c=.o)
44
45 BINS    =       $(SRC:.c=)
46
47 all:    
48         @cat README.TXT
49         @echo "    $(BINS)" | fmt
50         @echo ""
51
52 really-all:     $(BINS)
53
54 blink:  blink.o
55         @echo [link]
56         @$(CC) -o $@ blink.o $(LDFLAGS) $(LDLIBS)
57
58 test1:  test1.o
59         @echo [link]
60         @$(CC) -o $@ test1.o $(LDFLAGS) $(LDLIBS)
61         
62 test2:  test2.o
63         @echo [link]
64         @$(CC) -o $@ test2.o $(LDFLAGS) $(LDLIBS)
65
66 speed:  speed.o
67         @echo [link]
68         @$(CC) -o $@ speed.o $(LDFLAGS) $(LDLIBS)
69
70 lcd:    lcd.o
71         @echo [link]
72         @$(CC) -o $@ lcd.o $(LDFLAGS) $(LDLIBS)
73
74 wfi:    wfi.o
75         @echo [link]
76         @$(CC) -o $@ wfi.o $(LDFLAGS) $(LDLIBS)
77
78 isr:    isr.o
79         @echo [link]
80         @$(CC) -o $@ isr.o $(LDFLAGS) $(LDLIBS)
81
82 isr-osc:        isr-osc.o
83         @echo [link]
84         @$(CC) -o $@ isr-osc.o $(LDFLAGS) $(LDLIBS)
85
86 piface: piface.o
87         @echo [link]
88         @$(CC) -o $@ piface.o $(LDFLAGS) $(LDLIBS)
89
90 gertboard:      gertboard.o
91         @echo [link]
92         @$(CC) -o $@ gertboard.o $(LDFLAGS) $(LDLIBS)
93
94 nes:    nes.o
95         @echo [link]
96         @$(CC) -o $@ nes.o $(LDFLAGS) $(LDLIBS) 
97
98 pwm:    pwm.o
99         @echo [link]
100         @$(CC) -o $@ pwm.o $(LDFLAGS) $(LDLIBS)
101
102 delayTest:      delayTest.o
103         @echo [link]
104         @$(CC) -o $@ delayTest.o $(LDFLAGS) $(LDLIBS)
105
106 serialRead:     serialRead.o
107         @echo [link]
108         @$(CC) -o $@ serialRead.o $(LDFLAGS) $(LDLIBS)
109
110 serialTest:     serialTest.o
111         @echo [link]
112         @$(CC) -o $@ serialTest.o $(LDFLAGS) $(LDLIBS)
113
114 okLed:  okLed.o
115         @echo [link]
116         @$(CC) -o $@ okLed.o $(LDFLAGS) $(LDLIBS)
117
118 tone:   tone.o
119         @echo [link]
120         @$(CC) -o $@ tone.o $(LDFLAGS) $(LDLIBS)
121
122 servo:  servo.o
123         @echo [link]
124         @$(CC) -o $@ servo.o $(LDFLAGS) $(LDLIBS)
125
126
127 .c.o:
128         @echo [CC] $<
129         @$(CC) -c $(CFLAGS) $< -o $@
130
131 clean:
132         rm -f $(OBJ) *~ core tags $(BINS)
133
134 tags:   $(SRC)
135         @echo [ctags]
136         @ctags $(SRC)
137
138 depend:
139         makedepend -Y $(SRC)
140
141 # DO NOT DELETE