-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (35 loc) · 1.02 KB
/
Makefile
File metadata and controls
49 lines (35 loc) · 1.02 KB
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
ifndef CC
CC = gcc
endif
ifndef CPPFLAGS
CPPFLAGS =
endif
ifndef CFLAGS
CFLAGS = -O0 -g
endif
ifndef LFFLAGS
LDFLAGS = -g
endif
BINDIR = bin
SRCDIR = src
TESTDIR = test
HEADERS = $(addprefix $(SRCDIR)/,globals.h commands.h)
OBJECTS = $(addprefix $(BINDIR)/,att.o commands.o connect.o)
EXAMPLES = $(addprefix $(BINDIR)/,test-led test-port-update test-motor-sync test-tilt-sensor)
.PHONY: all clean
all: $(EXAMPLES)
clean:
rm $(BINDIR)/*.o $(BINDIR)/
$(BINDIR)/.keep :
mkdir -p $(BINDIR)
@touch $@
$(BINDIR)/%.o : $(SRCDIR)/%.c $(BINDIR)/.keep $(HEADERS)
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
$(BINDIR)/test-led: $(TESTDIR)/test_led.c $(OBJECTS)
$(CC) $(LDFLAGS) -Isrc -o $@ $^ -lbluetooth
$(BINDIR)/test-port-update: $(TESTDIR)/test_port_update.c $(OBJECTS)
$(CC) $(LDFLAGS) -Isrc -o $@ $^ -lbluetooth
$(BINDIR)/test-motor-sync: $(TESTDIR)/test_motor_sync.c $(OBJECTS)
$(CC) $(LDFLAGS) -Isrc -o $@ $^ -lbluetooth
$(BINDIR)/test-tilt-sensor: $(TESTDIR)/test_tilt_sensor.c $(OBJECTS)
$(CC) $(LDFLAGS) -Isrc -o $@ $^ -lbluetooth