Gordons Projects

--> Projects Top-Level GIT

Initial creating of GIT repository for the wiringPi + Gertboard
[gertboard] / Makefile
1 #
2 # Makefile:
3 #       Gertboard - Examples using wiringPi
4 #
5 #       Copyright (c) 2013 Gordon Henderson
6 #################################################################################
7
8 #DEBUG  = -g -O0
9 DEBUG   = -O3
10 CC      = gcc
11 INCLUDE = -I/usr/local/include
12 CFLAGS  = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
13
14 LDFLAGS = -L/usr/local/lib
15 LDLIBS    = -lwiringPi -lpthread -lm
16
17 # Should not alter anything below this line
18 ###############################################################################
19
20 SRC     =       blink.c blink8.c blink12.c      \
21                 buttons.c 7segments.c
22
23 OBJ     =       $(SRC:.c=.o)
24
25 BINS    =       $(SRC:.c=)
26
27 all:    
28         @cat README.TXT
29         @echo "    $(BINS)" | fmt
30         @echo ""
31
32 really-all:     $(BINS)
33
34 blink:  blink.o
35         @echo [link]
36         @$(CC) -o $@ blink.o $(LDFLAGS) $(LDLIBS)
37
38 blink8: blink8.o
39         @echo [link]
40         @$(CC) -o $@ blink8.o $(LDFLAGS) $(LDLIBS)
41
42 blink12:        blink12.o
43         @echo [link]
44         @$(CC) -o $@ blink12.o $(LDFLAGS) $(LDLIBS)
45
46 buttons:        buttons.o
47         @echo [link]
48         @$(CC) -o $@ buttons.o $(LDFLAGS) $(LDLIBS)
49
50 7segments:      7segments.o
51         @echo [link]
52         @$(CC) -o $@ 7segments.o $(LDFLAGS) $(LDLIBS)
53
54 .c.o:
55         @echo [CC] $<
56         @$(CC) -c $(CFLAGS) $< -o $@
57
58 clean:
59         rm -f $(OBJ) *~ core tags $(BINS)
60
61 tags:   $(SRC)
62         @echo [ctags]
63         @ctags $(SRC)
64
65 depend:
66         makedepend -Y $(SRC)
67
68 # DO NOT DELETE