Skip to content

Commit

Permalink
Merge pull request #59 from huaweicloud/version112
Browse files Browse the repository at this point in the history
update version 1.1.2
  • Loading branch information
Aimini authored May 31, 2023
2 parents 1887c9b + 4e332c7 commit cc7f41f
Show file tree
Hide file tree
Showing 147 changed files with 16,664 additions and 2,443 deletions.
3 changes: 3 additions & 0 deletions .gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The location of the build configuration file.
buildconfig = "//build/BUILDCONFIG.gn"

90 changes: 90 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright (c) 2022-2022 Huawei Cloud Computing Technology Co., Ltd. All rights reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#import("//build/ohos.gni")
#import("//build/lite/config/component/lite_component.gni")

# 设置使用的demo 以文件名
# 当为bootstrap_demo 编译 ./bootstrap_demo中的bootstrap_demo.c文件
# gateway_demo 编译 ./gateway_demo 中.c文件
declare_args() {
test_demo = "device_demo"
}

# 生成可执行文件 MQTT_Demo
executable("mqtt_device_demo") {

deps = [
":conf_copy",
":lib_copy",
"src/util:util",
"src/third_party/cjson:cjson",
"src/service:service",
"src/base:base",
"src/agentlite:agentlite",
"src/tunnel:tunnel",
"src/service/device_rule:device_rule",
"src/service/sys_hal:sys_hal",
"src/service/detect_anomaly:detect_anomaly",
]

if(test_demo == "device_demo"){
deps += ["src/device_demo:device_demo",]
}
if(test_demo == "bootstrap_demo"){
deps += ["src/bootstrap_demo:bootstrap_demo",]
}
if(test_demo == "gateway_demo"){
deps += ["src/gateway_demo:gateway_demo",]
}

#设置动态依赖
libs = [
"./lib/libboundscheck.so",
"./lib/libssl.so",
"./lib/libcrypto.so",
"./lib/libz.so",
"./lib/libpaho-mqtt3as.so",
"./lib/libssh.so",
"./lib/libnopoll.so",
"pthread",
]

# 输出文件名
output_name = "MQTT_Demo"
}

copy("lib_copy") {
sources = [ "lib" ]
outputs = [ "$root_out_dir/{{source_file_part}}" ]
}

copy("conf_copy") {
sources = [ "conf" ]
outputs = [ "$root_out_dir/{{source_file_part}}"]
}

print("-----------------------> iot-device-sdk-c:$test_demo!")
Binary file modified IoT Device SDK API Reference (C).pdf
Binary file not shown.
Binary file modified IoT Device SDK API文档.pdf
Binary file not shown.
198 changes: 137 additions & 61 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,108 +4,184 @@ CFLAGS = -g -w -lrt -m64 -Wl,-z,relro,-z,now,-z,noexecstack -fno-strict-aliasing
#-D Linux=1
CXXFLAGS = -O2 -g -Wall -fmessage-length=0 -lrt -m64 -Wl,-z,relro,-z,now,-z,noexecstack -fno-strict-aliasing -fno-omit-frame-pointer -pipe -Wall -fPIC -MD -MP -fno-common -freg-struct-return -fno-inline -fno-exceptions -Wfloat-equal -Wshadow -Wformat=2 -Wextra -rdynamic -Wl,-z,relro,-z,noexecstack -fstack-protector-strong -fstrength-reduce -fno-builtin -fsigned-char -ffunction-sections -fdata-sections -Wpointer-arith -Wcast-qual -Waggregate-return -Winline -Wunreachable-code -Wcast-align -Wundef -Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs

OBJS = hmac_sha256.o mqtt_base.o log_util.o string_util.o cJSON.o json_util.o base.o callback_func.o login.o subscribe.o data_trans.o iota_init.o iota_login.o iota_datatrans.o device_demo.o mqttv5_util.o
OUT_PATH=./out
HEADER_PATH = -I./include
LIB_PATH = -L./lib
SRC_PATH = ./src

SSH_OBJS = wss_client.o ssh_client.o
SYS_HAL_OBJS = sys_hal.o sys_hal_imp.o
DETECT_ANOMALY_OBJS = detect_anomaly.o
SOFT_BUS_OBJS = dconncaseone_interface.o soft_bus_datatrans.o soft_bus_init.o

CORE_OBJECTS = hmac_sha256.o mqtt_base.o log_util.o string_util.o cJSON.o json_util.o base.o callback_func.o login.o subscribe.o data_trans.o iota_init.o iota_login.o iota_datatrans.o mqttv5_util.o
OBJS += $(foreach NAME,$(CORE_OBJECTS),$(OUT_PATH)/$(NAME))
OBJS += $(foreach NAME,$(SYS_HAL_OBJS),$(OUT_PATH)/$(NAME))
OBJS += $(foreach NAME,$(DETECT_ANOMALY_OBJS),$(OUT_PATH)/$(NAME))

DEVICE_RULE_FILENAME = ${wildcard $(SRC_PATH)/service/device_rule/*.c}
DEVICE_RULE_OBJS := $(DEVICE_RULE_FILENAME:%.c=$(OUT_PATH)/%.o)
OBJS += $(DEVICE_RULE_OBJS)
#generic_tcp_protocol.o gateway_server_demo.o
#bootstrap_demo.o
#$(warning "OS $(OS)")
#$(warning "OSTYPE $(OSTYPE)")

SSH_SWITCH :=1
ifdef SSH_SWITCH
CFLAGS += -DSSH_SWITCH=1
SSH_OBJS = wss_client.o ssh_client.o
OBJS += $(SSH_OBJS)
endif

HEADER_PATH = -I./include
LIB_PATH = -L./lib
SRC_PATH = ./src

LIBS = $(LIB_PATH) -lpaho-mqtt3as -lssl -lcrypto -lz -lboundscheck -lpthread
#$(LIB_PATH) -lHWMQTT
#$(LIB_PATH) -lpaho-mqtt3cs $(LIB_PATH)

#SOFT_BUS_OPTION2 := 1
ifdef SOFT_BUS_OPTION2
CFLAGS += -DSOFT_BUS_OPTION2=1
OBJS += $(foreach NAME,$(SOFT_BUS_OBJS),$(OUT_PATH)/$(NAME))
endif

#SSH_SWITCH :=1
ifdef SSH_SWITCH
CFLAGS += -DSSH_SWITCH=1
OBJS += $(foreach NAME,$(SSH_OBJS),$(OUT_PATH)/$(NAME))
LIBS += -lnopoll -lssh
endif
#$(LIB_PATH) -lHWMQTT
#$(LIB_PATH) -lpaho-mqtt3cs $(LIB_PATH)

# enable device rule compilation
DEVIC_ERULE_ENALBE:=y
CONFIG_ENALBE_DEVICE_RULE_FILE_STORAGE:=y
ifeq ($(DEVIC_ERULE_ENALBE),y)
CFLAGS += -DDEVIC_ERULE_ENALBE=1
ifeq ($(CONFIG_ENALBE_DEVICE_RULE_FILE_STORAGE),y)
CFLAGS += -DCONFIG_ENALBE_DEVICE_RULE_FILE_STORAGE=1
endif
endif


OBJ_DIRS += $(dir $(OBJS))
OBJ_DIRS := $(sort $(OBJ_DIRS))

ifeq ($(OS), Windows_NT)
TARGET = MQTT_Demo.exe
else
# TARGET = libHWMQTT.so
TARGET = MQTT_Demo.o
TARGET = MQTT_Demo
endif

$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)


$(TARGET): $(OBJ_DIRS) $(OUT_PATH)/device_demo.o $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OUT_PATH)/device_demo.o $(OBJS) $(LIBS)


##-----------base----------------##
hmac_sha256.o: $(SRC_PATH)/base/hmac_sha256.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/base/hmac_sha256.c -o hmac_sha256.o $(HEADER_PATH)/base/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/libboundscheck/ $(HEADER_PATH)
$(OUT_PATH)/hmac_sha256.o: $(SRC_PATH)/base/hmac_sha256.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/base/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/libboundscheck/ $(HEADER_PATH)

mqtt_base.o: $(SRC_PATH)/base/mqtt_base.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/base/mqtt_base.c -o mqtt_base.o $(HEADER_PATH)/base/ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/
$(OUT_PATH)/mqtt_base.o: $(SRC_PATH)/base/mqtt_base.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/base/ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/third_party/libboundscheck/

##-----------util----------------##
log_util.o: $(SRC_PATH)/util/log_util.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/util/log_util.c -o log_util.o $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/
$(OUT_PATH)/log_util.o: $(SRC_PATH)/util/log_util.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/

string_util.o: $(SRC_PATH)/util/string_util.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/util/string_util.c -o string_util.o $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/zlib/ $(HEADER_PATH)/third_party/libboundscheck/
$(OUT_PATH)/string_util.o: $(SRC_PATH)/util/string_util.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/zlib/ $(HEADER_PATH)/third_party/libboundscheck/

mqttv5_util.o: $(SRC_PATH)/util/mqttv5_util.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/util/mqttv5_util.c -o mqttv5_util.o $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/zlib/
$(OUT_PATH)/mqttv5_util.o: $(SRC_PATH)/util/mqttv5_util.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/zlib/

cJSON.o: $(SRC_PATH)/third_party/cjson/cJSON.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/third_party/cjson/cJSON.c -o cJSON.o $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/agentlite/
$(OUT_PATH)/cJSON.o: $(SRC_PATH)/third_party/cjson/cJSON.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/agentlite/

json_util.o: $(SRC_PATH)/util/json_util.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/util/json_util.c -o json_util.o $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/agentlite/
$(OUT_PATH)/json_util.o: $(SRC_PATH)/util/json_util.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/agentlite/

##-----------servcie----------------##
base.o: $(SRC_PATH)/service/base.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/service/base.c -o base.o $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/agentlite/
$(OUT_PATH)/base.o: $(SRC_PATH)/service/base.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/

callback_func.o: $(SRC_PATH)/service/callback_func.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/service/callback_func.c -o callback_func.o $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)
$(OUT_PATH)/callback_func.o: $(SRC_PATH)/service/callback_func.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH) $(HEADER_PATH)/service/device_rule/ $(HEADER_PATH)/service/detect_anomaly/ $(HEADER_PATH)/service/sys_hal/ $(HEADER_PATH)/third_party/libboundscheck/

login.o: $(SRC_PATH)/service/login.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/service/login.c -o login.o $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/agentlite/
$(OUT_PATH)/login.o: $(SRC_PATH)/service/login.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/

subscribe.o: $(SRC_PATH)/service/subscribe.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/service/subscribe.c -o subscribe.o $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/
$(OUT_PATH)/subscribe.o: $(SRC_PATH)/service/subscribe.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/cjson/

data_trans.o: $(SRC_PATH)/service/data_trans.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/service/data_trans.c -o data_trans.o $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/cjson/

$(OUT_PATH)/data_trans.o: $(SRC_PATH)/service/data_trans.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/service/ $(HEADER_PATH)/base/ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/service/device_rule/ $(HEADER_PATH)/third_party/libboundscheck/

##-----------agentlite----------------##
iota_init.o: $(SRC_PATH)/agentlite/iota_init.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/agentlite/iota_init.c -o iota_init.o $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/
$(OUT_PATH)/iota_init.o: $(SRC_PATH)/agentlite/iota_init.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/service/device_rule/ $(HEADER_PATH)/third_party/cjson $(HEADER_PATH)/third_party/libboundscheck/ $(HEADER_PATH)/third_party/cjson/

iota_login.o: $(SRC_PATH)/agentlite/iota_login.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/agentlite/iota_login.c -o iota_login.o $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/agentlite/
$(OUT_PATH)/iota_login.o: $(SRC_PATH)/agentlite/iota_login.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/agentlite/

iota_datatrans.o: $(SRC_PATH)/agentlite/iota_datatrans.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/agentlite/iota_datatrans.c -o iota_datatrans.o $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/third_party/libboundscheck/ $(HEADER_PATH)
$(OUT_PATH)/iota_datatrans.o: $(SRC_PATH)/agentlite/iota_datatrans.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/third_party/libboundscheck/ $(HEADER_PATH) $(HEADER_PATH)/service/device_rule/

generic_tcp_protocol.o: $(SRC_PATH)/gateway_demo/generic_tcp_protocol.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/gateway_demo/generic_tcp_protocol.c -o generic_tcp_protocol.o $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/protocol/ $(HEADER_PATH)
$(OUT_PATH)/generic_tcp_protocol.o: $(SRC_PATH)/gateway_demo/generic_tcp_protocol.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/protocol/ $(HEADER_PATH)

gateway_server_demo.o: $(SRC_PATH)/gateway_demo/gateway_server_demo.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/gateway_demo/gateway_server_demo.c -o gateway_server_demo.o $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/protocol/ $(HEADER_PATH)
$(OUT_PATH)/gateway_server_demo.o: $(SRC_PATH)/gateway_demo/gateway_server_demo.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/protocol/ $(HEADER_PATH)

device_demo.o: $(SRC_PATH)/device_demo/device_demo.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/device_demo/device_demo.c -o device_demo.o $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH) $(HEADER_PATH) $(HEADER_PATH)/tunnel/ $(HEADER_PATH)/nopoll
$(OUT_PATH)/device_demo.o: $(SRC_PATH)/device_demo/device_demo.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/third_party/libboundscheck/ $(HEADER_PATH)/service/device_rule/ $(HEADER_PATH) $(HEADER_PATH)/tunnel/ $(HEADER_PATH)/nopoll

bootstrap_demo.o: $(SRC_PATH)/bootstrap_demo/bootstrap_demo.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/bootstrap_demo/bootstrap_demo.c -o bootstrap_demo.o $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)
$(OUT_PATH)/bootstrap_demo.o: $(SRC_PATH)/bootstrap_demo/bootstrap_demo.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)/util/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)

##--------------tunnel--------------##
wss_client.o: $(SRC_PATH)/tunnel/wss_client.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/tunnel/wss_client.c -o wss_client.o $(HEADER_PATH)/nopoll/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/util/ $(HEADER_PATH)/tunnel/ $(HEADER_PATH)/third_party/cjson/
ssh_client.o: $(SRC_PATH)/tunnel/ssh_client.c
$(CC) $(CFLAGS) -c $(SRC_PATH)/tunnel/ssh_client.c -o ssh_client.o $(HEADER_PATH)/nopoll/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/util/ $(HEADER_PATH)/tunnel/ $(HEADER_PATH)/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/libssh/
$(OUT_PATH)/wss_client.o: $(SRC_PATH)/tunnel/wss_client.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/nopoll/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/util/ $(HEADER_PATH)/tunnel/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH) $(HEADER_PATH)/third_party/libboundscheck/
$(OUT_PATH)/ssh_client.o: $(SRC_PATH)/tunnel/ssh_client.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/nopoll/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/util/ $(HEADER_PATH)/tunnel/ $(HEADER_PATH)/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/libssh/ $(HEADER_PATH)/third_party/libboundscheck/

##-----------soft bus----------------##
$(OUT_PATH)/soft_bus_datatrans.o: $(SRC_PATH)/service/soft_bus_datatrans.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/base/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/util/ $(HEADER_PATH)/service/ $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)

$(OUT_PATH)/soft_bus_init.o: $(SRC_PATH)/service/soft_bus_init.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/base/ $(HEADER_PATH)/util/ $(HEADER_PATH)/agentlite/ $(HEADER_PATH)/service/ $(HEADER_PATH)

$(OUT_PATH)/dconncaseone_interface.o: $(SRC_PATH)/dconncaseone_interface.c
$(CC) $(CFLAGS) -c $< -o $@ $(HEADER_PATH)/

##--------------sysHal--------------##
SYS_HAL_SRC = $(SRC_PATH)/service/sys_hal
SYS_HAL_HEADER_PATH = ./include/service/sys_hal
SYS_HAL_INC = -I$(SYS_HAL_HEADER_PATH) $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/third_party/libboundscheck/ $(HEADER_PATH)/agentlite $(HEADER_PATH)/util/ $(HEADER_PATH)/service/

$(OUT_PATH)/sys_hal_imp.o: $(SYS_HAL_SRC)/sys_hal_imp.c
$(CC) $(CFLAGS) -c $< -o $@ $(SYS_HAL_INC)
$(OUT_PATH)/sys_hal.o: $(SYS_HAL_SRC)/sys_hal.c
$(CC) $(CFLAGS) -c $< -o $@ $(SYS_HAL_INC)

##--------anomaly detection---------##
DETECT_ANOMOLY_SRC = $(SRC_PATH)/service/detect_anomaly
DETECT_ANOMOLY_HEADER_PATH = ./include/service/detect_anomaly
DETECT_ANOMOLY_INC = -I$(DETECT_ANOMOLY_HEADER_PATH) $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/third_party/libboundscheck/ $(HEADER_PATH)/agentlite $(HEADER_PATH)/util/ $(HEADER_PATH)/service/ $(HEADER_PATH)/service/sys_hal/

$(OUT_PATH)/detect_anomaly.o: $(DETECT_ANOMOLY_SRC)/detect_anomaly.c $(OUT_PATH)/sys_hal_imp.o $(OUT_PATH)/sys_hal.o
$(CC) $(CFLAGS) -c $< -o $@ $(DETECT_ANOMOLY_INC) $(HEADER_PATH)

##-----------device rule-------------##
DEVICE_RULE_HEADER_PATH = ./include/service/device_rule/
DEVICE_RULE_INC = -I$(DEVICE_RULE_HEADER_PATH) $(HEADER_PATH)/third_party/cjson/ $(HEADER_PATH)/third_party/libboundscheck/ $(HEADER_PATH)/agentlite $(HEADER_PATH)/util/ $(HEADER_PATH)/service/ $(HEADER_PATH)/base/

$(DEVICE_RULE_OBJS):$(OUT_PATH)/%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@ $(DEVICE_RULE_INC)

.PHONY: all
all: $(TARGET)


$(OBJ_DIRS):
mkdir -p $@

clean:
rm -f $(OBJS) $(TARGET) *.d
rm -f $(TARGET)
rm -rf ./out

Loading

0 comments on commit cc7f41f

Please sign in to comment.