-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
65 lines (52 loc) · 1.39 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
CC := gcc
CPPFLAGS = `pkg-config glib-2.0 --cflags`
CFLAGS := `pkg-config glib-2.0 --cflags` -Wall -g
LDFLAGS = `pkg-config glib-2.0 --libs`
LDFLAGS = -lglib-2.0
CONF_CRYPTO := linux-kernel
# Main Stack
meshd-objs = \
src/main.o \
src/network.o \
src/transport-low.o \
src/transport-up.o \
src/access.o \
src/provision.o \
src/provision-generic.o \
src/bearer-adv.o \
src/workqueue.o \
src/advertisers/hci-channel.o \
src/crypto-$(CONF_CRYPTO).o
# Models
meshd-objs += \
src/models/configuration-server.o \
src/models/configuration-client.o \
src/models/health-server.o \
src/models/health-client.o
# interfaces
meshd-objs += src/interfaces/cmdline.c
bluez-objs = \
src/external/bluez/io-glib.o \
src/external/bluez/hci.o \
src/external/bluez/queue.o \
src/external/bluez/util.o \
src/external/bluez/ecc.o
bluez-sharedlib = src/external/bluez-sharedlib.a
test-objs = \
src/unit/test-crypto.o \
src/external/bluez/ecc.o \
src/external/bluez/util.o \
src/crypto-$(CONF_CRYPTO).o
all: meshd
meshd: $(meshd-objs) $(bluez-sharedlib)
$(CC) $(meshd-objs) $(bluez-sharedlib) $(LDFLAGS) $(CFLAGS) -o $@
test: $(test-objs)
$(CC) $(test-objs) $(LDFLAGS) $(CFLAGS) -o $@
%.o : %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ -c $<
$(bluez-sharedlib): $(bluez-objs)
$(AR) rcs $@ $^
clean:
rm -R -f src/*~ src/*.o meshd
rm -R -f src/external/bluez/*~ src/external/bluez/*.o meshd
rm -R -f src/external/*.a