-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
49 lines (35 loc) · 1.23 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
CC = gcc
CFLAGS = -O3
BUNDLE = Makefile README.txt LICENSE.txt tclled.h tclled.c tcl_speedtest.c blink_test.c simple_example.c blink_hsv.c rainbows.c
VERSION = 1.1
ARCHIVE = elinux-tcl
LIBS = -lm
# Uncomment the line below to compile for beaglebone
CFLAGS += -DSPIFILE=\"/dev/spidev2.0\"
# Uncomment the line below to compile for Raspberry Pi
# CFLAGS += -DSPIFILE=\"/dev/spidev0.0\"
all: tcl_speedtest blink_test simple_example blink_hsv rainbows
archive: $(BUNDLE)
mkdir $(ARCHIVE)-$(VERSION)
cp $(BUNDLE) $(ARCHIVE)-$(VERSION)/
tar cvfz $(ARCHIVE)-$(VERSION).tar.gz $(ARCHIVE)-$(VERSION)
rm -rf $(ARCHIVE)-$(VERSION)
clean:
$(RM) *.o
$(RM) $(ARCHIVE)-$(VERSION).tar.gz
tcl_speedtest: tcl_speedtest.o tclled.o
$(CC) $(CFLAGS) $(LIBS) -o $@ $^
tcl_speedtest.o: tclled.h tcl_speedtest.c
blink_test.o: tclled.h blink_test.c
blink_test: blink_test.o tclled.o
$(CC) $(CFLAGS) $(LIBS) -o $@ $^
blink_hsv.o: tclled.h blink_hsv.c
blink_hsv: blink_hsv.o tclled.o
$(CC) $(CFLAGS) $(LIBS) -o $@ $^
simple_example.o: tclled.h simple_example.c
simple_example: simple_example.o tclled.o
$(CC) $(CFLAGS) $(LIBS) -o $@ $^
rainbows.o: tclled.h rainbows.c
rainbows: rainbows.o tclled.o
$(CC) $(CFLAGS) $(LIBS) -o $@ $^
tclled.o: tclled.h tclled.c