-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
64 lines (46 loc) · 1.45 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
#
# This file defines Makefile for Gateway
#
# define some paths variable
TOP_DIR := $(shell pwd)
SOURCE_DIR := $(TOP_DIR)/source
REF_DIR := $(TOP_DIR)/3rd
# define build macros
CC = $(CXX)
CFLAGS += -g
CFLAGS += -O2
CFLAGS += -DWITH_POSIX
CFLAGS += -I$(SOURCE_DIR)
# not cross compile, include ace and libcoap
ifneq ($(ARCH),arm)
CFLAGS += -I$(REF_DIR)/ace/include
CFLAGS += -I$(REF_DIR)/libcoap/include
LDFLAGS += -L$(REF_DIR)/ace/lib
LDFLAGS += -L$(REF_DIR)/libcoap/lib
endif
LIBS += -lACE
LIBS += -lcoap
LIBS += -lrt
LIBS += -lpthread
LIBS += -lstdc++
APP := gateway
SOURCE_FILES := $(SOURCE_DIR)/main.cpp
SOURCE_FILES += $(SOURCE_DIR)/Gateway.cpp
SOURCE_FILES += $(SOURCE_DIR)/CfgService.cpp
SOURCE_FILES += $(SOURCE_DIR)/NET_Service.cpp
SOURCE_FILES += $(SOURCE_DIR)/NET_Mcast_Service.cpp
SOURCE_FILES += $(SOURCE_DIR)/RD_Service.cpp
SOURCE_FILES += $(SOURCE_DIR)/CoAP_Wrapper.cpp
SOURCE_FILES += $(SOURCE_DIR)/CoAP_Resource.cpp
SOURCE_FILES += $(SOURCE_DIR)/CoAP_RD_Resource.cpp
SOURCE_FILES += $(SOURCE_DIR)/CoAP_RD_Node_Resource.cpp
SOURCE_FILES += $(SOURCE_DIR)/CoAP_RD_Lookup_Resource.cpp
SOURCE_FILES += $(SOURCE_DIR)/CoAP_RD_Lookup_D_Resource.cpp
SOURCE_FILES += $(SOURCE_DIR)/CoAP_RD_Lookup_EP_Resource.cpp
SOURCE_FILES += $(SOURCE_DIR)/CoAP_RD_Lookup_RES_Resource.cpp
SOURCE_FILES += $(SOURCE_DIR)/FW_Proxy_Service.cpp
#deinfe targetes
.PHONY: all
all: $(APP)
$(APP): $(SOURCE_FILES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)