This repository has been archived by the owner on Jul 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·60 lines (50 loc) · 1.72 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
CC := gcc -O3
CFLAGS=-DPOSIX
_XBEE_SRC_DIR := thirdparty/xbee_ansic_library/src
_XBEE_NET_FILES := \
$(_XBEE_SRC_DIR)/posix/xbee_platform_posix.o \
$(_XBEE_SRC_DIR)/posix/xbee_readline.o \
$(_XBEE_SRC_DIR)/posix/xbee_serial_posix.o \
$(_XBEE_SRC_DIR)/xbee/xbee_atmode.o \
$(_XBEE_SRC_DIR)/xbee/xbee_atcmd.o \
$(_XBEE_SRC_DIR)/xbee/xbee_device.o \
$(_XBEE_SRC_DIR)/xbee/xbee_wpan.o \
$(_XBEE_SRC_DIR)/wpan/wpan_aps.o \
$(_XBEE_SRC_DIR)/xbee/xbee_discovery.o \
$(_XBEE_SRC_DIR)/zigbee/zigbee_zcl.o \
$(_XBEE_SRC_DIR)/zigbee/zcl_types.o \
$(_XBEE_SRC_DIR)/util/swapbytes.o \
$(_XBEE_SRC_DIR)/util/hexstrtobyte.o \
$(_XBEE_SRC_DIR)/wpan/wpan_types.o \
src/hexdump.o \
src/n_xbee.o
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
CFLAGS += -I$(PWD)/thirdparty/xbee_ansic_library/include
# CFLAGS += -DPOSIX
# These will enabel verbosity in various parts.
# CFLAGS += -DXBEE_ATMODE_VERBOSE
# CFLAGS += -DXBEE_ATCMD_VERBOSE
# this is required
CFLAGS += -DXBEE_DEVICE_ENABLE_ATMODE -DXBEE_CMD_DISABLE_REMOTE
# If you enable this you will get a LOT of debugging output
# EXTRA_CFLAGS += -DXBEE_SERIAL_VERBOSE
# EXTRA_CFLAGS += -DXBEE_DEVICE_VERBOSE
# CFLAGS += -DWPAN_APS_VERBOSE
# Enabel verbsity of this module
# CFLAGS += -DN_XBEE_VERBOSE
# Handle arp packets in the driver
CFLAGS += -DN_XBEE_ARP_RESPONDER
CFLAGS += -DN_XBEE_PING_RESPONDER
# CFLAGS += -g
DEPS += -pthread
default: xbee_netdev
xbee_netdev: ensure-submodule $(_XBEE_NET_FILES)
$(CC) -o xbee_netdev $(DEPS) $(CFLAGS) $(_XBEE_NET_FILES)
ensure-submodule:
@if [ ! -f ./thirdparty/xbee_ansic_library/README.md ]; then \
echo "Attempting to update submodule..." && \
git submodule update --init \
;fi
clean:
-git clean -Xfd && cd ./thirdparty/xbee_ansic_library/ && git clean -Xfd